session-restore

session-restore is a skill for Claude Code from IlyaGorsky/memory-toolkit. It costs 25 tokens per session (1,309 once invoked), scanned A, original, MIT.

A tool for restoring context from saved Claude Code session backups stored as JSONL files, a text format with one JSON object per line. It reads session history, reconstructs its timeline, and records important decisions.

In plain words
What is it for?
Use it to list saved sessions, restore a recent or selected session, review user and assistant messages, and recover key decisions.
Why use it?
It helps resume work when a coding session was compacted, interrupted, or needs to be revisited without reading the entire raw backup.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Part of the memory-toolkit plugin — 11 skills, 5 hooks shipped together

Good fit Use it to list saved sessions, restore a recent or selected session, review user and assistant messages, and recover key decisions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ilyagorsky/memory-toolkit/session-restore
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add IlyaGorsky/memory-toolkit --skill session-restore
Clone the repo
git clone --depth 1 https://github.com/IlyaGorsky/memory-toolkit

Made for: Claude Code.

Or install memory-toolkit, the plugin that ships this one along with the rest of its 11 skills, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-restore

README.md
[![agentmods](https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-restore/github.svg)](https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-restore)
Your own site
<a href="https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-restore"><img src="https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-restore/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for session-restore

Your own site · 80×15
<a href="https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-restore"><img src="https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-restore.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.01309
Opus 5.5 $0.00010 $0.00524
Sonnet 5.5 $0.00005 $0.00262
Haiku 4.5 $0.00003 $0.00131

Measured 1mo ago against content hash 0bb1fd21d374, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

session-restore scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/session-restore/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Session Restore — backup and context restoration

Parses .jsonl files of Claude Code sessions, extracts chronology and key decisions.

Where data is stored

~/.claude/projects/-<project-key>/
├── <UUID>.jsonl          # current session (or completed)
├── <UUID>.jsonl.bak      # backup before last compact
└── <UUID>/
    └── subagents/        # subagent logs

Commands

/session-restore list

Show all sessions with dates and sizes:

SESSIONS_DIR=~/.claude/projects/-$(pwd | tr '/.' '-' | sed 's/^-//')
ls -lat "$SESSIONS_DIR"/*.jsonl 2>/dev/null | head -20

Output a table: | File | Date | Size | .bak |

/session-restore restore

Restore context from the latest (or specified) session:

  1. Find the file — by default the most recent .jsonl, or by UUID from the argument
  2. Parse — extract USER and CLAUDE messages using python3:
import json, sys

path = sys.argv[1]
with open(path) as f:
    lines = f.readlines()

for i, line in enumerate(lines):
    try:
        obj = json.loads(line.strip())
        role = obj.get('role', '?')
        msg_type = obj.get('type', '?')
        c = obj.get('message', {}).get('content', obj.get('content', ''))

        if isinstance(c, list):
            for item in c:
                if isinstance(item, dict):
                    tp = item.get('type', '')
                    if tp == 'text':
                        text = item.get('text', '').strip()
                        if role == '?' and msg_type == 'user':
                            if text and not text.startswith('<ide_') and not text.startswith('<system') and not text.startswith('<local-command') and not text.startswith('<command-') and len(text) > 5:
                                print(f'USER [{i}]: {text[:200]}')
                        elif role == '?' and msg_type == 'assistant':
                            if text and len(text) > 20:
                                print(f'  CLAUDE [{i}]: {text.split(chr(10))[0][:200]}')
        elif isinstance(c, str):
            clean = c.strip()
            if role == '?' and msg_type == 'user' and clean and not clean.startswith('<') and len(clean) > 3:
                print(f'USER [{i}]: {clean[:200]}')
            elif role == '?' and msg_type == 'assistant' and clean and len(clean) > 20:
                print(f'  CLAUDE [{i}]: {clean.split(chr(10))[0][:200]}')
    except:
        pass

Read the full file on GitHub · 177 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 177 lines · 25 tokens per session scan A 0bb1fd21d374

Subscribe to this mod's changes

session-restore is a skill published in the GitHub repository IlyaGorsky/memory-toolkit (13 stars, last pushed 10d ago), licensed MIT. It adds 25 tokens to every session and 1,309 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

67-agency-vendor-brief-global

Use when briefing or managing an EXTERNAL agency, freelancer, or production vendor — scope of work, deliverable specs, revision rounds, approval process, USD payment milestones, IP assignment and confidentiality terms, communication rules, and a post-project vendor scorecard. Trigger on 'brief an agency', 'hire a…

minhnv0807/ai-business-skills · 166 tokens

nav-compact

Clear conversation context while preserving knowledge via context marker. Use when user says "clear context", "start fresh", "done with this task", or when approaching token limits.

qf-studio/navigator · 38 tokens

context

Transfer context from the current Claude Code terminal session to the Telegram bot session. Use when the user says "send this to telegram", "transfer context", "telegram:context", "teleport to telegram", or wants the Telegram bot to continue work from this session.

k1p1l0/claude-telegram-supercharged · 55 tokens

close

Commit the session to durable vault memory and prepare a clean resume point.

wrg32786/aigent-os · 15 tokens

context-capsule

The capsule verb, invoked explicitly — reconcile from the live memory, write a resume-ready capsule, then stop. Mid-session checkpoint or completion capsule; a rolling best-effort version of the same write also runs automatically on every Stop event via daemons/stop-capsule-writer.mjs.

wrg32786/aigent-os · 64 tokens

Promote

Take a slice of the current conversation and promote it to a durable vault artifact — concept note, project update, person profile, or doctrine entry. Pairs with /close. /close writes the daily note (transient outcome record); /promote elevates specific insights to permanent vault content the framework can refer back…

wrg32786/aigent-os · 68 tokens