[BUG] Claude Code chat session lost when opening a folder in VS Code
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?
Description:
I started a new project in VS Code with Claude Code. Since it was a fresh start, no files or folders were open in the workspace yet. After an ongoing conversation where we were planning and building the project, the project folder was already created on my local drive. I simply opened that folder in the same VS Code window while the chat was still in progress. The moment I opened the folder, the entire Claude Code chat disappeared — no history, no way to recover it. The conversation was completely gone.
What Should Happen?
What Should Happen?
The chat session should persist when opening a folder in the same VS Code window
If the session must restart due to workspace change, there should be a warning before the conversation is lost
Conversation history should be recoverable — either through auto-save or a session restore option
Error Messages/Logs
Steps to Reproduce
- Open VS Code with no folder/workspace open
- Start a Claude Code conversation (plan a project, generate files, etc.)
- Once the project folder exists on your local drive, open it via File → Open Folder in the same VS Code window
- Claude Code chat disappears — session and conversation history are gone
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.110 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗