claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Session lost after helper tool update — transcript intact but unrecoverable

Open carlaghosn opened this issue 2 months ago • 3 comments

Bug Description

A long-running Claude Code session (nearly 3 months, 1.2 GB transcript, 118,156 lines) became permanently unrecoverable after the Claude desktop app prompted to install a helper tool update. The session process died during the update prompt, and the app lost the session from its internal index. The transcript file and all associated data remain fully intact on disk, but no recovery mechanism exists.

Steps to Reproduce

  1. Have a long-running Claude Code session active in the desktop app
  2. Claude prompts to install a helper tool update (macOS authorization dialog)
  3. If the user's account lacks admin privileges at that moment, the update fails
  4. The session process dies
  5. The session disappears from the sidebar and /resume picker

What Happened

  • Session vanished from the desktop app sidebar
  • /resume does not list the session (even with search by title or ID)
  • claude --resume <session-id> from CLI shows fresh setup wizard instead of resuming
  • get_session via MCP returns "Session not found"
  • list_sessions (including archived) does not include the session

What's Still on Disk (intact)

  • Transcript: ~/.claude/projects/<project>/68cc8f0f-c179-4b57-9a3a-937af2c57ad1.jsonl — 1.2 GB, 118,156 lines
  • Session directory: 68cc8f0f-c179-4b57-9a3a-937af2c57ad1/ with 4,011 subagents, 46 tool-results, and workflows
  • All data is intact and readable — user messages, assistant responses, tool outputs all present

Session Details

  • Session ID: 68cc8f0f-c179-4b57-9a3a-937af2c57ad1
  • Auto-title: "Assess lawsuit strategy and research defenses"
  • Started: June 18, 2026
  • Last active: September 11, 2026 (the morning it was lost)
  • Duration: ~85 days of continuous use
  • Size: 1.2 GB transcript, 4,011 subagents
  • Platform: macOS Darwin 23.6.0 (Apple Silicon)
  • Claude Code version at creation: 2.1.177
  • Entrypoint: claude-desktop

Expected Behavior

  1. The app should not lose session registration when the helper tool update fails
  2. /resume should be able to rediscover sessions from intact JSONL transcript files on disk
  3. There should be a recovery mechanism (e.g., claude --recover <session-id>) for orphaned sessions whose transcripts are intact

Impact

This session contained nearly 3 months of complex legal research and document preparation work. All the files produced are intact, but the conversational context, accumulated understanding, and session state are inaccessible. The user relied on being able to continue this session.

Environment

  • macOS 14.x (Darwin 23.6.0)
  • Claude Desktop App
  • Claude Code

carlaghosn avatar Sep 11 '26 15:09 carlaghosn

The data model here is the key: the transcript on disk is the durable record, and the sidebar/resume index is a derived store. This report shows the durable copy survived intact while the derived copy was lost, which means the situation is recoverable twice over, once in product and once as a manual path.

1. Reconcile the index against disk on startup. The information needed to re-adopt orphaned transcripts already exists on disk: the project transcript .jsonl plus the session directory carry the id, project, and timing metadata. A scan pass at startup (or on a /resume miss) that parses unindexed transcripts and rebuilds index entries would have recovered this session, and the class generally. The deeper fix is treating the index as a rebuildable cache over the transcripts rather than as authoritative state.

2. Make resume fall back to the transcript. Right now claude --resume <id> shows the setup wizard when the index lookup misses, which reads as "your session is gone forever" while 1.2 GB of intact transcript sits on disk. A fallback that loads the transcript directly, or reports "transcript found, re-adopt?", converts something that looks like data loss into a warning.

3. Ordering around the helper update. The session process died during the helper update prompt, and a failed update should not be able to take the session down with it. Two protections: checkpoint the session index before prompting, so no index write is pending when the process is killed, and either defer non-critical updates until the session is idle or make the update non-fatal to the running session.

For this specific session: with both the transcript and the session directory intact, a hand-rebuilt index entry sourced from those files is the natural first attempt. Worth testing on a copy before anything writes to the transcript path itself.

Why this shape is worth fixing at the root: we ran into a milder version of the same lesson at corpusiq.io. Any derived index over durable user data needs a rebuild-from-source path from day one, because index loss is indistinguishable from data loss from the user's side, and support cannot tell them apart without one.

Ben-Home avatar Sep 11 '26 17:09 Ben-Home

That massively sucks: nearly three months of context went missing while the 1.2 GB transcript and companion files stayed on disk. I would first check whether Desktop still has a metadata record for that JSONL.

On macOS, the metadata files are under ~/Library/Application Support/Claude/claude-code-sessions/ and the transcripts under ~/.claude/projects/. I built BasedGPT/claude-code-session-recovery for orphaned transcripts. It is Windows-tested, but these metadata and JSONL formats are the same; from its checkout, run python3 tools/diagnose.py first and follow the exact command it prints.

If diagnosis identifies this JSONL as an orphan with no metadata record, use the printed synth_session_metadata.py command and review its dry run before applying. Its synthesis scan reads the full transcript to derive metadata, so 1.2 GB may take a while. Keep copies of both directories and fully quit Claude Desktop before any --apply.

That route can recreate the Desktop session-list record if diagnosis confirms the metadata is missing. The toolkit does not stop the helper-update failure or recreate the CLI registration behind the fresh setup wizard. If diagnosis reports another state, share its redacted output before applying anything.

Hope this helps, if my tools are able to help you, would appreciate a ⭐ :)

BasedGPT avatar Sep 12 '26 09:09 BasedGPT

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Nov 18 '26 22:11 github-actions[bot]