[BUG] /resume index suddenly missing 80% of sessions
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
/resume (and the session picker on startup) only shows a fraction of actual sessions. In my case, 139 out of 654
session JSONL files are present in sessions-index.json. The remaining 515 sessions — including 329 non-trivial ones
(>5KB, some up to 32MB) — are silently dropped and never appear in the resume list.
Actively running sessions that are being updated in real time also fail to appear in the index.
What Should Happen?
All saved session jsonls should appear in index accessed by /resume
Error Messages/Logs
Steps to Reproduce
- Use Claude Code extensively over several weeks (~650 sessions)
- Run /resume or claude --resume — only a small subset of sessions appear
- Inspect ~/.claude/projects/<project>/sessions-index.json — far fewer entries than .jsonl files on disk
- Sessions that are missing from the index can still be resumed manually with claude --resume <session-id>,
confirming they are valid
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.23
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Debugging details
I decompiled the relevant indexer function (ygD in the binary). The issue appears to be in the message tree builder
(H21), which constructs a tree from leafUuids. When this function returns null (fails to build a valid tree), the
entire session is silently skipped with if(!g) continue — no warning, no log entry.
This means any session whose JSONL has a message graph structure that H21 doesn't expect gets permanently excluded
from the index. Since the indexer rewrites sessions-index.json on every startup, manually adding entries doesn't
help — they get removed on the next launch.
Impact
- /resume is unreliable — most sessions are invisible
- No error messages or warnings when sessions are dropped
- Users have no way to discover or fix the issue without inspecting the index file directly
- The only workaround is claude --resume <uuid>, but that requires knowing the session ID
Environment
- Claude Code version: 2.1.23 (native install)
- Platform: Linux (RHEL 9, x86_64)
- ~654 session files, 139 indexed (21%)
- 329 missing sessions are >5KB with real conversation content
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗