Sessions not added to sessions-index.json, invisible to resume
Bug: Sessions not added to sessions-index.json, making them invisible to resume
Summary
Session files (.jsonl) are being created correctly in ~/.claude/projects/<project>/, but they are not being added to the sessions-index.json file. This causes claude --resume to show no available sessions even though the session data exists.
Steps to Reproduce
- Start Claude Code in a directory
- Have a conversation and exit
- Run
claude --resumeto see available sessions - Observe: No sessions are listed
Expected Behavior
The previous session should appear in the resume list.
Actual Behavior
No sessions are shown, even though session files exist in the project directory.
Diagnostic Information
Session files present:
~/.claude/projects/<project-path>/
├── <session-id>.jsonl (45 lines, valid session data)
├── sessions-index.json
sessions-index.json contents:
{
"version": 1,
"entries": [],
"originalPath": "/path/to/project"
}
The entries array is empty despite valid session files existing.
Comparison with working project:
Another project directory has a properly populated sessions-index.json with entries for each session.
Workaround
Sessions can still be resumed manually by ID:
claude --resume <session-id>
The index can also be manually reconstructed by extracting metadata from the .jsonl files.
Environment
- Claude Code version: 2.1.27 (from session file)
- Platform: macOS (Darwin 25.2.0)
Possible Causes
- Race condition when writing to sessions-index.json
- Error during index update that fails silently
- Index file being overwritten/reset under certain conditions
- Sessions created via certain code paths that skip indexing
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗