Skip to content

sessions-index.json not updated, causing claude --resume to show stale/missing sessions #25032

@RileyLeff

Description

@RileyLeff

Bug Description

claude --resume only shows a random smattering of old sessions (from ~2 weeks ago), despite having run many sessions recently. The session data itself is being saved correctly — the .jsonl files are all present on disk — but they don't appear in the resume picker.

Root Cause (identified with Claude's help)

The sessions-index.json files in ~/.claude/projects/ are either:

  1. Missing entirely for many active project directories
  2. Stale — not being updated when new sessions are created

For example, on my system (v2.1.39, macOS):

  • 11 out of 18 project directories have no sessions-index.json at all, including directories with very recent session activity
  • The index files that do exist haven't been updated since late January, despite session .jsonl files being written as recently as today
HAS INDEX: -Users-...-dev-ozzydb (Feb  4)   ← stale, sessions exist from Feb 10
NO INDEX:  -Users-...-dev-rileyviewer        ← no index, 20MB+ session from Feb 10
NO INDEX:  -Users-...-dev                    ← no index, sessions from Feb 10
NO INDEX:  -Users-...-hard-saptest1          ← no index, sessions from Feb 10

The session .jsonl files are all intact — data is not being lost. But since --resume appears to read from sessions-index.json, these sessions are invisible to the resume picker (both CLI and VS Code extension).

Steps to Reproduce

  1. Run several Claude Code sessions across different project directories
  2. Close them (I typically just close the terminal)
  3. Run claude --resume — only old sessions appear
  4. Check ~/.claude/projects/*/sessions-index.json — many are missing or stale
  5. Check for .jsonl files — they exist and are recent

Expected Behavior

claude --resume should list all recent sessions, and sessions-index.json should be updated whenever a session is created or modified.

Environment

  • Claude Code version: 2.1.39
  • OS: macOS (Darwin 25.1.0)
  • Sessions are closed by closing the terminal (no explicit exit command)

Notes

I found this bug myself; Claude helped identify the specific root cause (the stale/missing index files) by examining the session storage on disk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsmemoryplatform:macosIssue specifically occurs on macOS

    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