Sessions not added to sessions-index.json, invisible to resume

Resolved 💬 8 comments Opened Jan 31, 2026 by pmoran-dev Closed Apr 5, 2026

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

  1. Start Claude Code in a directory
  2. Have a conversation and exit
  3. Run claude --resume to see available sessions
  4. 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

  1. Race condition when writing to sessions-index.json
  2. Error during index update that fails silently
  3. Index file being overwritten/reset under certain conditions
  4. Sessions created via certain code paths that skip indexing

View original on GitHub ↗

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