/clave:recover-sessionsfrom clave
Rebuilds a lost Clave workspace by finding past Claude Code sessions on disk, mapping them to projects, and reopening groups with full history. Use after a crash, restart, or accidental close.
Ships in clave. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Clave tabs are disposable; the conversations behind them are not. Claude Code writes every session to a local transcript file that survives an app crash, a machine reboot, and Clave's own state being wiped. This skill finds those transcripts, works out what each session was about, and rebuilds the user's groups and tabs with the real conversations restored — not empty tabs.
Use it when the user says any of: "I lost my sessions", "my computer crashed, get my workspace back", "what was I working on?", "recover what I had".
Their history, verbatim. claude --resume <session-id> reopens a session with its full context, so a recovered tab picks up exactly where it stopped. What is genuinely lost is only Clave's own arrangement — which group a tab sat in and what it was called — and that is what you reconstruct from evidence plus the user's memory.
~/.claude/projects/<path-encoded-cwd>/<session-uuid>.jsonl
One JSONL file per session; the filename stem IS the session id you resume with. The directory name is the session's working directory with / replaced by -.
Retention is a local setting, cleanupPeriodDays in ~/.claude/settings.json (default 30 days). It is not a server-side policy — nothing is fetched from Anthropic and nothing expires in the cloud. If the user's setting is low and they care about recovery, mention raising it; that is the whole fix.
Before scanning, get the user's own picture in one short exchange: roughly how many groups, what the big ones were about, and when they were last working. Do not interrogate them. Vague answers are fine and normal ("one group for the mobile app, a big one for the API rewrite, and something about billing") — the scan supplies the precision, their memory supplies the grouping and the names.
If they cannot remember anything, skip straight to the scan and present what you find, newest first.
Run the bundled script:
python3 <skill-dir>/scripts/scan-transcripts.py --since 14
Useful flags: --since DAYS (default 14), --min-size KB (default 50, skips stubs), --json for machine-readable output, --all to include the one-shot helper sessions it filters out by default.
It is read-only, takes a few seconds over a couple of hundred transcripts, and prints one block per session:
=== 3f9c1a7e-… 4.3MB 2026-03-11T10:50 -> 2026-03-11T13:33 (31 msgs)
cwd: /Users/you/work
repos: api-server(36), api-client(2)
tasks: ENG-412, ENG-418, …
ask: <the first thing the user asked>
end: <the last substantial thing the assistant said>
note: <Claude Code's own compaction summaries, when present>
If the script is unavailable, the same signals can be extracted by hand from the JSONL — see Reading a transcript directly below.
Read the blocks in this order of trust:
repos — the reliable project signal. It is derived from the file paths in the session's tool calls, resolved to the git repo containing them. A session with 36 hits in one repo belongs to that project, whatever the rest of the block suggests.ask — the user's opening message, which usually names the goal outright.end — where the session actually stopped: shipped, mid-plan, waiting on approval, or blocked. This is what makes the "worth bringing back?" judgment possible.tasks — issue ids, ranked by how often they appear. Useful for matching a session to a known piece of work.note — Claude Code's own summaries of long sessions.⚠️ Do not trust cwd. Most sessions are started from a workspace root shared by dozens of unrelated sessions, so it separates almost nothing. Two sessions with identical cwd are routinely about completely different projects.
⚠️ Long sessions drift. A session that ran for days may have started on one topic and ended on another. When ask and end disagree, the recent end state is what matters for grouping and for deciding whether to resume it.
Map sessions to the groups the user described, and say what you are doing as you go. Prefer acting over asking: build the groups and report, rather than presenting a plan and waiting. Ask only where evidence genuinely conflicts with what the user remembers, or where two sessions are plausible candidates for one remembered tab.
Naming that has worked well:
1 · schema design, 2 · migration, 3 · rollout) so the sequence is legible at a glance.Then create them:
clave_create_group → { name: "<group name>" }
clave_open_session → { groupId, mode: "terminal", name: "1 · schema design",
cwd: "<the session's cwd>",
command: "claude --resume <session-id>" }
Two mechanics that will bite you otherwise:
⚠️ Clave has no native resume. clave_open_session in claude mode always starts a fresh conversation. To restore history, open the tab in terminal mode running claude --resume <session-id>. It behaves like a normal Claude tab once it starts. Run it from the session's original cwd.
⚠️ Empty groups get pruned. Creating several groups and then filling them in a later batch silently loses the empty ones. Always create one group and immediately open a session in it, then move to the next group.
Close with a short account of what came back, and — the part users value most — a triage of everything else that was open, in four buckets:
Offer to add any of them. Say plainly that a tab is a terminal running --resume rather than a native Clave session, so nothing about the setup is a surprise later.
A prompt that never reached disk. A session opened moments before a crash may have only its bootstrap context saved, with the user's real question lost. Resuming it restores a conversation that never heard the question. Say so, ask the user to restate the idea, and pass it as the resume argument so the session starts on the right foot:
claude --resume <session-id> '<the restated request>'
A transcript that is gone. If retention wiped it, the conversation is unrecoverable — do not pretend otherwise. Offer to start a fresh session seeded with what the user remembers, and mention raising cleanupPeriodDays.
Sessions that are noise. The ~/.claude/projects/-/ directory holds one-shot helpers Claude Code runs for itself (tab-title and commit-message generation). The script filters them; never offer them as recoverable work.
Forks and duplicates. Resumed sessions share a prefix with their parent, so two transcripts can look nearly identical. Prefer the one with the later end timestamp and mention the other exists rather than restoring both.
Sessions spanning several projects. Put the tab in the group matching its dominant repo, and note the overlap in the report instead of duplicating the tab.
If you need to inspect one session without the script: each line is a JSON object. Lines with "type": "summary" carry Claude Code's compaction summaries. Lines with "type": "user" hold the user's turns — skip ones whose text starts with < or Caveat:, or contains system-reminder, since those are injected context rather than something the user typed. Lines with "type": "assistant" hold message.content blocks; type: "text" blocks are the visible reply and type: "tool_use" blocks carry the file paths that reveal the project. Records with isSidechain: true belong to subagents, not the main conversation.
What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub antasphere/clave --plugin claveOther plugins' skills for the same job