Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
area:corebugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existshas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Codeplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on Windows
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- 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
.jsonlsession 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:
- Had a conversation session from Feb 13, 2026 (1.2 MB, 154 lines, 64 assistant messages) - verified intact and uncorrupted on disk
- The session tab was visible in VSCode tab bar with its title
- When clicking the tab to open it, the session disappeared from the UI entirely
- The
.jsonlfile remains on disk, intact and parseable - The session is NOT in
sessions-index.json - Searching in the session search box does not find it
cleanupPeriodDaysis set to99999in 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:
- [BUG] Closed conversation disappears from Past Conversations despite .jsonl file existing on disk #27422 (closed conversation disappears despite .jsonl existing)
- [BUG] Past conversations not showing in dropdown - sessions-index.json not being updated. #18619 (sessions-index.json not being updated)
- sessions-index.json stops updating, breaking /resume and --resume #28587 (sessions-index.json stops updating)
- /resume missing sessions: sessions-index.json out of sync with actual session files #25552 (/resume missing sessions, index out of sync)
- [BUG] /resume not listing sessions in v2.1.30 - sessions-index.json not populated #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
- The UI should rebuild/reconcile the index by scanning
.jsonlfiles on disk when a mismatch is detected - Or provide a manual "rebuild session index" command
- 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
Reacted by David Miller, andrewbistras and Tim Harsch
Metadata
Metadata
Assignees
Labels
area:corebugSomething isn't workingSomething isn't workingduplicateThis issue or pull request already existsThis issue or pull request already existshas reproHas detailed reproduction stepsHas detailed reproduction stepsplatform:vscodeIssue specifically occurs in VS CodeIssue specifically occurs in VS Codeplatform:windowsIssue specifically occurs on WindowsIssue specifically occurs on Windows
Activity
github-actions commentedon Feb 27, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
xmeloun commentedon Feb 27, 2026
Additional findings after investigation
sessions-index.json rebuild does NOT fix the issue
I rebuilt
sessions-index.jsonfrom scratch by scanning all 61.jsonlfiles on disk. The rebuilt index has correct format (matching the original working entries exactly - same fields, same structure). After VSCode restart, the missing sessions still don't appear in the UI.This confirms the VSCode extension does not rely on
sessions-index.jsonfor populating the "Past Conversations" list. It uses its own internal mechanism.Sessions disappear from OPEN TABS too
While investigating this bug, another session ("JANA NEDVĚDOVÁ: Nákupní...") disappeared from the UI. The user had it open as a tab in VSCode - when they clicked the tab, the session vanished. The
.jsonlfile remains intact on disk.Extension's internal state
Checked VSCode's global state database (
state.vscdb). TheAnthropic.claude-codekey contains only 5 fields (settingsMigrated,lastClaudeLocation,experimentGates,lastClaudeLocationMigrated,yearEndPromoViewCount) - no session tracking data.Key facts:
.jsonlfiles on disk, all intact and parseablecleanupPeriodDays: 99999- files are NOT being deletedsessions-index.jsonwith all 61 entries has no effectanthropic.claude-code-2.1.61-win32-x64Difference from duplicates #22462, #24729, #18619
Those issues focus on
sessions-index.jsonsync problems. This report demonstrates that even with a perfectly rebuilt index, sessions remain invisible, pointing to a deeper issue in the extension's session management, not just index file sync.github-actions commentedon Mar 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
xmeloun commentedon Mar 31, 2026
Still reproducible on v2.1.72 (2026-03-31)
This bug is still present on the latest VS Code extension version
anthropic.claude-code-2.1.72-win32-x64, Windows 11 Pro.Current state:
.jsonlsession files exist on disk in~/.claude/projects/<project>/cleanupPeriodDays: 99999— files are NOT being deletedsessions-index.jsonrebuild has no effect (as documented in my previous comment)Nothing has changed since the original report — the extension still fails to list all sessions. The core issue remains: the VS Code extension's internal session discovery mechanism silently drops older/some sessions from the UI while the files remain intact on disk.
CLI workaround confirms data is there:
claude --resumein the terminal correctly lists and can resume ALL sessions, including those invisible in the VS Code extension UI.Please reopen — this was auto-closed as stale, not as fixed.
github-actions commentedon Apr 8, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.