[BUG] Claude Code chat session lost when opening a folder in VS Code

Resolved 💬 3 comments Opened Apr 16, 2026 by websiteutco Closed May 26, 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?

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

  1. Open VS Code with no folder/workspace open
  2. Start a Claude Code conversation (plan a project, generate files, etc.)
  3. Once the project folder exists on your local drive, open it via File → Open Folder in the same VS Code window
  4. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗