[Bug] Empty sessions appearing in --resume list due to file-history-snapshot-only entries

Resolved 💬 2 comments Opened Mar 7, 2026 by berniegreen Closed Apr 4, 2026

[Bug] Empty sessions appearing in --resume list

Steps to reproduce

  1. Run claude in any project directory, submit a message, /exit
  2. Run claude --resume

Expected: Only sessions with conversation content appear.
Actual: One or more (session) entries appear with no title, no content, and no way to distinguish them from real sessions.

Investigation

Inspected the .jsonl files in ~/.claude/projects/ corresponding to the unnamed (session) entries. All three contained only type: file-history-snapshot entries — no user, assistant, or other conversation-type entries:

┌──────────────────┬───────────┬──────────────────────────────────────────┐
│ File │ Size │ Entry types │
├──────────────────┼───────────┼──────────────────────────────────────────┤
│ a099d9e4...jsonl │ 472 bytes │ 2× file-history-snapshot │
├──────────────────┼───────────┼──────────────────────────────────────────┤
│ 92691fc6...jsonl │ 27.7 KB │ 5× file-history-snapshot │
├──────────────────┼───────────┼──────────────────────────────────────────┤
│ ebf510a8...jsonl │ 944 bytes │ (artifact-only, not visible in --resume) │
└──────────────────┴───────────┴──────────────────────────────────────────┘

A fourth real session with conversation content appeared correctly titled in the same list. The unnamed sessions appeared alongside it.

Sample entry from one of the files:
{"type":"file-history-snapshot","messageId":"c3724898-...","snapshot":{"trackedFileBackups":{},"timestamp":"2026-03-07T18:06:49.770Z"},"isSnapshotUpdate":false}

Impact

  • Confusing UX: phantom sessions appear that the user never started
  • No way to distinguish them from real sessions in the --resume UI
  • Files accumulate and are never auto-cleaned

Suggested fixes

  • Filter sessions from --resume where no entry has a conversation type (user, assistant, system, custom-title, etc.)
  • Auto-cleanup these files on exit or session start

Environment

  • Platform: macOS (Darwin 25.3.0), zsh
  • Claude Code version: 2.1.69

View original on GitHub ↗

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