Skip to content

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

Description

@websiteutco

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?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idebugSomething isn't workingplatform:macosIssue specifically occurs on macOSplatform:vscodeIssue specifically occurs in VS CodestaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions