Resume after compaction loses conversation content — exports truncated
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Apr 3, 2026 · closed Apr 3, 2026
Description
When a long session is compacted (via /compact) and then resumed later (via --resume or /resume picker), the resumed session loads from a late checkpoint instead of the compaction point. This causes:
- Truncated exports — /export from the resumed session produces a fraction of the content vs /export from the original running session (527 lines vs 8,902 lines for the same session)
- Lost context for Claude — Claude operates with partial conversation history after resume, degrading response quality
- Non-deterministic checkpoint selection — the same session ID resumes from different points depending on when you resume
Reproduction
- Start a session, work for several hours (4,000+ messages)
- /compact mid-session
- Continue working (adds ~2,000 more messages)
- /export from the running session → complete export (8,902 lines)
- Exit
claude --resume <session-id>- /export from resumed session → truncated export (527 lines, starts from a random late point)
Expected
Resume should load from the compaction point (or the full session), and exports should be identical regardless of whether exported from the original or resumed session.
Environment
- Claude Code v2.1.91
- Opus 4.6 (1M context)
- Windows 11 / MSYS2/Git Bash
- Session JSONL: 41MB, 6,149 lines, 4,451 messages
- Multiple compactions in the same session
4 Comments
Closing — filed prematurely without proper diagnosis. The resume issue appears to be related to /desktop session transfer, not a general compaction bug. Will refile with accurate root cause if confirmed.
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
@belumume Don't refile — the root cause is already identified and documented.
Your symptoms (41MB JSONL, truncated resume, 527 vs 8,902 lines) match exactly what we found through source code analysis. It's NOT specific to /desktop session transfer — it's a general v2.1.91 regression in the session loading pipeline.
Three specific code changes cause this:
walkChainBeforeParseremoved in v2.1.91 — fork pruning for >5 MB files no longer happensExYtimestamp fallback bridges across unrelated fork branchesleafUuidscheck ingetLastSessionLog(line 3900)Full analysis with exact file:line references from v2.1.88 TypeScript source: #43044
If you need to recover the lost session content now, you can use our Go tool that reads JSONL directly (bypassing the broken resume):
https://github.com/kolkov/ccdiag
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.