[BUG] Sessions repeatedly disappearing from sidebar when using VS Code extension + Desktop Code mode simultaneously (Windows)
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?
Sessions repeatedly disappear from the sidebar in both Claude Desktop app and VS Code extension. This is a recurring issue — not a one-time occurrence after an update. The JSONL session data files remain intact on disk, but the sessions are not displayed in either UI.
Environment
OS: Windows 10/11
Claude Code VS Code extension: v2.1.71 (anthropic.claude-code-2.1.71-win32-x64)
Claude Desktop: latest version (as of 2026-03-07)
Usage pattern: VS Code extension and Claude Desktop Code mode used simultaneously/interchangeably on the same machine
Detailed Investigation
Session data is intact
The JSONL files exist in ~/.claude/projects/ with valid content:
~/.claude/projects/g--WORK-HOME-BackTestEngine/
├── 6fc9c5ae-...jsonl (Mar 6, 22:44, valid assistant/user entries)
├── cf50fef2-...jsonl (Mar 6, 13:27, valid assistant/user entries)
├── 05810551-...jsonl (Mar 7, 08:33, valid entries)
├── c44b2381-...jsonl (Mar 4, 18:31, valid entries)
├── 77941790-...jsonl (Mar 5, 23:31, valid entries)
└── ... (other sessions that DO appear in sidebar)
Session registry (local_*.json) is missing entries
The claude-code-sessions directory contains two account/org subfolders:
29f52fc6-.../322da7cf-... → 22 registered local_*.json files (VS Code sessions)
64115aa7-.../50b297bf-... → 13 registered local_*.json files (Desktop Code sessions)
The missing JSONL session IDs (6fc9c5ae, cf50fef2, 05810551, c44b2381, 77941790) do not have corresponding local_*.json entries in either folder.
Manual recovery attempt failed
Manually creating local_.json files with the correct structure (matching existing files byte-for-byte in format and encoding) did not restore sessions to the sidebar. The app appears to read session lists from IndexedDB (%APPDATA%\Claude\IndexedDB\https_claude.ai_0.indexeddb.leveldb\), not directly from the local_.json files.
No sessions-index.json exists
Unlike CLI-based Claude Code installations, no sessions-index.json file exists in the ~/.claude/projects/ directory, so CLI-based recovery methods are not applicable.
Actual Behavior
Some sessions are created with valid JSONL data but never get registered in the session index (IndexedDB / local_*.json), making them invisible in both the Desktop app and VS Code extension sidebar. This happens repeatedly, not just after updates.
What Should Happen?
Expected Behavior
All sessions should appear in the sidebar regardless of whether they were created from VS Code extension or Desktop Code mode. Session registration should be atomic/reliable and not silently fail.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Open a project in VS Code with Claude Code extension (v2.1.71)
- Have Claude Desktop app running simultaneously
- Create sessions from both VS Code extension and Desktop Code mode
- Use normally for several days
- At some point, recent sessions stop appearing in the sidebar of both apps
- The JSONL files for those sessions exist and are not corrupted
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code VS Code extension: v2.1.71 (anthropic.claude-code-2.1.71-win32-x64)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
Possible Root Cause
The simultaneous use of VS Code extension and Desktop Code mode may cause a race condition or conflict when writing to the shared claude-code-sessions directory or IndexedDB. The two apps use different account/org subfolders (29f52fc6 vs 64115aa7) but share the same Electron storage layer.
Related Issues
#27752 — Session history disappears from UI after restarting
#25524 — Previous sessions not showing in desktop app sidebar
#29154 — Session history lost after update
#29373 — Desktop update loses Code session history (migration issue)
#26452 — Sessions disappeared after logout/restart
#9581 — All session data lost after logout/login
Suggested Fix
Add a consistency check at startup that reconciles JSONL files in ~/.claude/projects/ with the session registry (IndexedDB + local_*.json)
If a JSONL file exists without a corresponding registry entry, automatically create one
Ensure atomic session registration so that the JSONL file and index entry are always created together
[mad by Claude Chat]
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗