Session .jsonl files silently deleted, sessions-index.json stops updating — causes --resume failures
Bug Description
Session .jsonl files are silently deleted from disk over time, and sessions-index.json stops being updated after a certain point. This causes --resume to fail with "No conversation found with session ID" because the session data no longer exists.
This is distinct from #33912 (where files exist but resume fails) — in this case, the files are actually gone.
Environment
- Claude Code version: 2.1.85
- OS: macOS 26.3.1 (Darwin 25.3.0)
- Platform: CLI (terminal)
Evidence
Investigation of ~/.claude/projects/-Users-kit-go/ reveals:
1. sessions-index.json is stale
The index contains 47 session entries, but the most recent entry is from January 29, 2026 — nearly two months old. Sessions created after that date are not registered in the index.
2. Session .jsonl files are missing
Of the 47 sessions listed in the index, zero have corresponding .jsonl files on disk. The files were silently deleted.
Sessions in index: 47
Sessions with files: 0 (all 47 lost)
3. New sessions bypass the index
There are 10 .jsonl files on disk (from March 2026) that are not in the index. These are newer sessions that were written directly as files but never registered.
Files on disk not in index: 10
Index entries without files: 47
4. UUID subdirectories with subagent data remain
Old sessions still have their <session-id>/subagents/ directories preserved even though the parent .jsonl was deleted — orphaned data.
Steps to Reproduce
- Use Claude Code over several weeks/months
- Exit a session, note the session ID from the "Resume this session with:" message
- Wait some time (days/weeks)
- Run
claude --resume <session-id> - Get:
No conversation found with session ID: <id> - Verify: the
.jsonlfile no longer exists on disk
Expected Behavior
- Session
.jsonlfiles should not be silently deleted (or if rotation is intentional,--resumeshould give a clear message like "Session expired" instead of "not found") sessions-index.jsonshould stay in sync with actual files on disk- The "Resume this session with:" message shown at exit should not suggest a command that will fail
Actual Behavior
.jsonlfiles disappear silentlysessions-index.jsonfreezes and stops being updated--resumefails with a generic "not found" error- User has no way to know which sessions are still resumable
Related
- #33912 — resume fails even when files exist (different root cause)
- #38459 — memory/conversation history lost between sessions
- #5768 — resume only works from the original directory
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗