Skip to content

sessions-index.json not updated - claude -c fails to find sessions #22462

@georgesamuelson

Description

@georgesamuelson

Summary

sessions-index.json files are created with empty entries: [] and never updated, even though session .jsonl files are being written correctly. This causes claude -c (continue) to fail to find previous sessions.

Claude Code Version: 2.1.29
Platform: macOS Darwin 25.2.0

Affected Projects

Project Session Files Index Entries Status
georgesamuelson-com-website 5 files (1.5MB main session) 0 ❌ Broken
ea-jorts 11 files (multi-MB sessions) 1 ❌ Partial
bg-wayne-website 47 files 13 ❌ Partial
mac-terminal 5 files 0 ❌ Broken

Steps to Reproduce

  1. Start a new Claude Code session in a project directory
  2. Have a conversation (verified: 459 messages recorded in .jsonl)
  3. Exit cleanly with /exit
  4. Run claude -c to continue

Expected: Previous session loads
Actual: "No sessions found" or starts fresh session

Technical Details

Session storage location:

~/.claude/projects/-Users-{user}-Projects-{project-name}/
├── sessions-index.json      # Created empty, never updated
├── {uuid}.jsonl             # Session data IS written correctly
└── {uuid}/                  # Subagent data exists

Evidence of bug:

# Index created at 18:11, never modified despite active sessions
$ stat sessions-index.json
"Feb  1 18:11:09 2026" "Feb  1 18:11:09 2026"  # birth = modify time

# But session file actively growing
$ ls -la *.jsonl
-rw------- 1.5M Feb  1 19:41 47d613a9-....jsonl  # 459 messages

Contents of broken index:

{
  "version": 1,
  "entries": [],
  "originalPath": "/Users/georgesamuelson/Projects/georgesamuelson-com-website"
}

Workaround

Manually rebuild index from .jsonl files by parsing each session file and creating index entries.

Impact

  • Data NOT lost - all conversation history is in .jsonl files
  • Resume broken - claude -c and claude --resume fail to find sessions
  • Inconsistent - some projects work fine, others don't (possible race condition?)

Additional Context

  • Some projects have working indexes while others in the same environment are broken
  • Bug appears to be project-specific, not global
  • Using Ghostty terminal
  • Clean /exit used, not terminal close

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions