[BUG] Local session history disappears after VS Code restart
Status Open
Reported on v2.1.121
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 14 comments · opened Apr 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?
Sessions listed under Local → Session History are not persistent across restarts of Visual Studio Code.
While working, sessions appear correctly in the dropdown. However, after closing and reopening VS Code, some sessions disappear from the list even though they still exist and can be resumed manually using:
claude --resume <session-id>
This creates a major usability issue because session names are not reliable identifiers, making it difficult to locate and resume previous work.
---
Expected Behavior
- All previously created local sessions should persist
- Session history should remain consistent after restart
- UI should reflect all available sessions accurately
---
Actual Behavior
- Some sessions are missing from the Local session list after restart
- Sessions still exist and can be resumed via CLI
- UI does not reflect the actual session state
---
Environment
- VS Code Version: 1.113.0
- OS: macOS (Darwin arm64 25.0.0)
- Electron: 39.8.3
- Node.js: 22.22.1
- Claude Code Extension Version: (fill this)
---
Additional Context
- Issue appears intermittently (not always 100% reproducible)
- Affects workflow continuity significantly
- Requires manual recovery using session IDs
What Should Happen?
What Should Happen?
- All sessions created under Local → Session History should persist after restarting Visual Studio Code
- The session list should remain consistent and not lose entries across restarts
- Previously created sessions should be visible and selectable without requiring manual CLI recovery
- The UI should accurately reflect all existing local sessions at all times
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Open Visual Studio Code
- Start multiple sessions using Claude Code extension
- Confirm sessions are visible under Local → Session History
- Close VS Code completely
- Reopen VS Code
- Open the session dropdown again
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.121 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
14 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I've had this issue. Any ideas whether the sessions are retrievable?
Same here, looking for a fix to this it is quite annoying.
Path: /Users/harry/.claude/projects
All sessions are stored locally on your system. The exact path depends on your OS, but it typically follows your user directory and is organized per project.
If you don’t want to manually search, you can ask Claude Code to scan that folder. While asking, describe what you did in that session (features worked on, files edited, topic, etc.) so it can find the correct one faster. It will:
How to resume a session
From your terminal, run:
Steps to make it appear back in UI
The session will now reappear in the Claude chat UI.
I am having the same issue. Very annoying. I cannot make it re-appear in VS Code. Please fix or at least provide a workaround to re-import sessions into the UI. This is very annoying. Using Windows 11 here with current version of VS Code and Claude Code Extension.
here is a solution
https://youtu.be/Zlgky62oPuk?si=UIaosll59BP30AFr
me what i did i went here and copied the contents from the old folder then pasted them in the new folder here under projects
C:\Users\bk\.claude\projects
C:\Users\<windows logged in user account>\.claude\projects
Here's what fixed this for me 👇
The sessions aren't actually lost — Claude Code hides the older ones from the panel and auto-deletes them after a while, so they quietly disappear from the UI even though they still exist.
I built a small free desktop app — Brightgoal Hub — that solves exactly this:
⬇️ Download for macOS & Windows →
Hope it helps 🙏
@Harvindar994 what programming lunguage did u use to make that windows app
@bloodykheeng TypeScript + React + Electron. The UI is built with shadcn/ui and Tailwind CSS, bundled with Vite, and packaged as a native desktop app with electron-builder. it's for both Windows & Mac
The intermittency is the tell — it points to the extension's 64KB read buffer. When building the sidebar list, the extension reads only the first and last 64KB of each transcript file. If your session grew long enough that the title entry (
custom-titleorai-title) landed in the middle, outside those windows, the session gets silently skipped. Short sessions stay visible; longer ones drop out after restart. The transcript files are intact, which is whyclaude --resume <session-id>works.Quickest workaround while the upstream bug is open:
claude --listin the integrated terminal. It reads~/.claude/projects/directly, bypassing the extension's session cache entirely, so it surfaces everything regardless of size.For sessions already dropped from the list,
DeveloperAlly/claude-code-survival-toolkithasscripts/recover-dropped-sessions.sh— a macOS bash script that reads the extension's workspace SQLite database, compares it against what's on disk, and injects the missing entries back in. Run it with VS Code closed; it has a dry-run mode.My toolkit,
BasedGPT/claude-code-session-recovery, covers the Desktop app's metadata layer rather than the VS Code extension sidebar — butdiagnose.pyruns on macOS and will tell you whether transcript files are intact and how many exist on disk. Useful if you want a full picture before touching anything.If it helps, a ⭐ on
BasedGPT/claude-code-session-recoveryis always appreciated.Hey team,
Any plans to fix the extension properly?
Tip: you can use Opus/Fable to get the job done... Hope Anthropic devs have access to it 😉
If you need some inspiration, look at VS Code Chat. It's amazing.
Never lost a single session there plus makes it very easy to run several sessions at the same time, with good visibility on the progress.
how is that this is still broken... having the same issue on Windows
I'm still experiencing this issue every day, because I have a lot of projects I like to switch between.
E.g. in VS Code, using CTRL+R to open a recent project, and then going back to the directory I came from just empties the history.
@Harvindar994 instructions sadly does nothing for me. Yes I can see the chat history in claude code CLI, but they will not appear in VS code history no matter what I do.
That workaround shouldn't be the fix anyway!