[FEATURE] Back up session transcripts and let resume and fork recover from the backup
Problem Statement
When a session's transcript goes missing, the session is gone for good. claude --resume and --fork-session answer No conversation found with session ID, even though most of the session's other records are still on disk: file-edit checkpoints, saved tool outputs, subagent metadata.
This is not hypothetical. In #99938 I lost the transcripts of 61 working sessions over two months, with nothing warning me at the time. I only found out days later, when I tried to resume.
Today the only protection is to build your own backup with hooks and shell scripts, which most users will never do.
Proposed Solution
Give Claude Code a built-in safety net for session transcripts:
- Keep a second copy of each transcript (for example under
~/.claude/backups/transcripts/), updated at the end of each turn, with its own retention setting. - Fall back to that copy on resume and fork. If the transcript is missing but a backup exists, restore it and continue, and say that it was restored.
- Say clearly when a session cannot be resumed and why. Instead of
No conversation found, tell the user whether the session was never saved (for example, it never received a message) or whether its transcript disappeared, and list what survived.
Alternative Solutions
- A user-level hook that copies the transcript at
StopandSessionEndworks, but needsjq, a script and settings edits, and every user has to discover it after they have already lost work. - A
/doctorcheck that lists sessions with missing transcripts would at least make the loss visible early.
Priority
High - Significant impact on productivity
Feature Category
Other
Use Case Example
I keep several sessions open in parallel and park some of them for days. I come back to one, run claude --resume <id>, and today get No conversation found. With this feature, Claude Code would notice the transcript is gone, restore it from the backup copy, tell me it did so, and I would continue where I left off.
Additional Context
Related bug report with the full evidence: #99938.
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗