Session .jsonl files silently deleted, sessions-index.json stops updating — causes --resume failures

Resolved 💬 5 comments Opened Mar 27, 2026 by itboat Closed Apr 28, 2026

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

  1. Use Claude Code over several weeks/months
  2. Exit a session, note the session ID from the "Resume this session with:" message
  3. Wait some time (days/weeks)
  4. Run claude --resume <session-id>
  5. Get: No conversation found with session ID: <id>
  6. Verify: the .jsonl file no longer exists on disk

Expected Behavior

  1. Session .jsonl files should not be silently deleted (or if rotation is intentional, --resume should give a clear message like "Session expired" instead of "not found")
  2. sessions-index.json should stay in sync with actual files on disk
  3. The "Resume this session with:" message shown at exit should not suggest a command that will fail

Actual Behavior

  • .jsonl files disappear silently
  • sessions-index.json freezes and stops being updated
  • --resume fails 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

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗