[BUG] VSCode: sessions-index.json severely out of sync - only 3 of 61 sessions indexed, older sessions invisible in UI

Resolved 💬 5 comments Opened Feb 27, 2026 by xmeloun Closed Mar 28, 2026

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?

The sessions-index.json file is severely out of sync with actual session files on disk. In my case:

  • 61 .jsonl session files exist in the project directory (~/.claude/projects/<project>/)
  • Only 3 sessions are listed in sessions-index.json
  • The remaining 58 sessions are invisible in the VSCode extension UI - they don't appear in the "Past Conversations" dropdown, they can't be found via the search box, and they are not resumable

Specific reproduction scenario:

  1. Had a conversation session from Feb 13, 2026 (1.2 MB, 154 lines, 64 assistant messages) - verified intact and uncorrupted on disk
  2. The session tab was visible in VSCode tab bar with its title
  3. When clicking the tab to open it, the session disappeared from the UI entirely
  4. The .jsonl file remains on disk, intact and parseable
  5. The session is NOT in sessions-index.json
  6. Searching in the session search box does not find it
  7. cleanupPeriodDays is set to 99999 in settings.json - files are not being deleted, just not indexed

The root cause appears to be that sessions-index.json stops updating at some point, leaving newly created sessions unindexed and invisible to the UI.

Related Issues

This appears to be the same underlying issue as:

  • #27422 (closed conversation disappears despite .jsonl existing)
  • #18619 (sessions-index.json not being updated)
  • #28587 (sessions-index.json stops updating)
  • #25552 (/resume missing sessions, index out of sync)
  • #22878 (/resume not listing sessions)

The common thread across all these issues is that sessions-index.json becomes stale/corrupt and stops tracking new sessions.

Suggested Fix

  1. The UI should rebuild/reconcile the index by scanning .jsonl files on disk when a mismatch is detected
  2. Or provide a manual "rebuild session index" command
  3. The index write operation should be more resilient (perhaps atomic writes, or a recovery mechanism)

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Claude Code: VSCode Extension (latest)
  • Shell: Git Bash
  • Project sessions on disk: 61
  • Sessions in index: 3
  • cleanupPeriodDays: 99999

View original on GitHub ↗

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