Repository navigation
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?
Past Conversations are not appearing in the VSCode extension, even though all session files (.jsonl) and the sessions-index.json exist and are valid. After quitting and reopening VSCode, the conversation history is empty or missing sessions.
The extension logs reveal it's using a cached session index from a different project:
Using cached index entry for session: b186ea61-819c-4036-b856-26f113e06b80
This session ID belongs to Project A, but I'm working in Project B. The extension appears to cross-contaminate session caches between different workspace projects.
What Should Happen?
Sessions listed in ~/.claude/projects/{project-path}/sessions-index.json should appear in "Past Conversations" for that specific project. Each project's session index should be read independently without cache contamination from other projects.
Error Messages/Logs
From Claude VSCode.log (~/Library/Application Support/Code/logs/.../Anthropic.claude-code/):
2026-01-31 18:59:55.743 [info] From claude: 2026-01-31T17:59:55.743Z [DEBUG] Using cached index entry for session: b186ea61-819c-4036-b856-26f113e06b80
This session ID does not exist in the current project's sessions-index.json - it belongs to a completely different project workspace.
No other errors related to session loading are shown.Steps to Reproduce
- Open VSCode with multiple different project folders (separate windows)
- Have conversations in each project
- Quit VSCode completely (⌘+Q on macOS)
- Reopen VSCode and open one of the projects
- Check "Past Conversations" → list is empty or shows wrong/missing sessions
- Verify that ~/.claude/projects/{project-path}/sessions-index.json contains valid entries
- Verify that all .jsonl session files exist in the same directory
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
No response
Claude Code Version
2.0.55 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Environment:
- Claude Code VSCode Extension: 2.1.27
- OS: macOS 15.2 (Darwin 25.2.0)
- Architecture: darwin-arm64
Verified manually:
- sessions-index.json is valid JSON (confirmed with python3 json.load)
- Contains 6 session entries with correct sessionId, fullPath, and metadata
- All referenced .jsonl files exist with correct permissions (600)
- File sizes range from 13KB to 21MB
- Removed macOS extended attributes with: xattr -cr ~/.claude/projects/{path}/
Workarounds attempted (none successful):
- Developer: Reload Window
- Full VSCode restart (⌘+Q and reopen)
- Manually editing/repairing sessions-index.json
- Removing macOS extended attributes
- Deleting lock files
The project folder is synced via Dropbox, but all files have correct permissions and no sync conflicts.
Activity
github-actions commentedon Jan 31, 2026
Found 3 possible duplicate issues:
--resumeshows sessions from wrong project directory in devcontainer #16250This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
asalcedo29 commentedon Feb 3, 2026
Having same issue
utibeokodi commentedon Feb 8, 2026
Having a similar issue
dibbla commentedon Feb 14, 2026
Same issue
igrushkas commentedon Feb 18, 2026
Having the same issue, how to fix?
olcor1 commentedon Feb 21, 2026
Same problem here
sstklen commentedon Feb 24, 2026
Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.
What's happening: VSCode extension caches session index globally instead of per-project. When switching between projects, the cached session IDs from Project A are used when loading Project B, causing sessions to not appear because the cached IDs don't match the current project's sessions-index.json entries.
What worked for us:
The fix correctly identifies the need to scope the session index cache key per-project. Beyond just the
getoperation, ensure that sessions are stored in the cache using a project-scoped key (${projectPath}:${sessionId}) and that mechanisms are in place to clear or refresh the cache for a given project when itssessions-index.jsonfile changes or when the active workspace changes.Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.
carlosbelardi commentedon Feb 24, 2026
Seeing a similar issue, used Claude itself to help me debug and this is what the final output was
Good news and bad news. Here's what I found:
Your conversations ARE being saved
The sessions are stored at
~/.claude/projects/current-project/— 7.jsonlfiles with full user/assistant message history. So nothing is being lost to the wrong location.The Past Conversations dropdown sounds like a bug
The data exists on disk in exactly the right place, but the VSCode extension's UI isn't surfacing it. A few things worth noting:
There's no
globalStorageentry foranthropic.claude-codeunder~/Library/Application Support/Code/User/globalStorage/— so the extension isn't using VSCode's standard extension storage for session discoveryThere are 5 stale lock files in
~/.claude/ide/(PIDs from previous sessions) — unclear if this interferes with session listingWhat to do
File a bug report — the sessions are there on disk, the UI just isn't showing them
sstklen commentedon Feb 26, 2026
Updating my earlier analysis based on further findings in this thread.
Correction to my previous comment: My per-project cache key theory was directionally right (cache contamination IS happening per OP's logs), but the TypeScript code example was speculative — I don't have access to the extension source, and the actual implementation may differ.
What we know (with evidence):
.jsonlfiles andsessions-index.jsonexist and are valid under~/.claude/projects/Using cached index entry for session: b186ea61...where that session ID belongs to a different project (this is from the original bug report)globalStorageentry — @carlosbelardi found the extension doesn't use VSCode's standardglobalStoragefor session discovery, which is an interesting data point about the architectureWhat remains unclear:
globalStorageis the root cause, or just how the extension is designed (it may intentionally read from~/.claude/projects/directly)~/.claude/ide/contribute to the problem (OP already tried deleting lock files without success)Workaround that works:
claude --resumefrom terminal can access past sessions.Credit to @carlosbelardi for the additional data points.
🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.
robsonsilvaof commentedon Mar 9, 2026
Same issue on Windows 11, Claude Code v2.1.71, VS Code extension.
Session files exist on disk at ~/.claude/projects// and are fully intact (verified by reading the .jsonl files directly). However, they don't appear in the Past Conversations dropdown after restarting VS Code.
Workaround that works: claude --resume from the terminal finds and loads the session perfectly — confirming the data is there, just not indexed by the extension.
Workaround that doesn't work: Reloading the VS Code window (Developer: Reload Window) does not make the missing sessions appear.
This is happening regularly — not a one-time occurrence.
silkfire commentedon Mar 9, 2026
It works if you rename the session. Any session whose name is just a hash value is not visible in VSCode but visible in the CLI.
Razseal commentedon Mar 10, 2026
I rolled back a week to plugin version 2.1.63 and all my chat history returned,
interconnectedMe commentedon Mar 16, 2026
This issue is part of a family of ~20 bugs that all stem from the same root cause: the VS Code extension reads titles by raw-string-scanning the last 64KB of each JSONL file, which causes title eviction on long sessions, cross-session contamination from tool result content, and overwrite-on-resume.
See #33165 (comment: #33165 (comment)) for the full root cause analysis, all related issues collected, and a working workaround (persistent title registry + hook).