Skip to content

VSCode Extension Regression: Multi-Root Workspace Context Not Switching Based on Active File Body: Environment #8559

Description

@fatlard1993

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?

The Claude Code VSCode extension has regressed in its handling of multi-root workspaces. Previously, opening a file from a different workspace folder would cause Claude Code to switch its working directory context to match that folder. This behavior no longer works in the latest extension version.

Current "Actual Behavior":
Claude Code sets its working directory to the first folder in the workspace instead of the folder containing the active file. The extension ignores which file is currently open and defaults to the first workspace folder

What Should Happen?

Claude Code's working directory should be set to the workspace folder containing the active file

(This is standard VSCode extension behavior using workspace.getWorkspaceFolder(uri) API)

Error Messages/Logs

N/A

Steps to Reproduce

  1. Open a multi-root VSCode workspace (.code-workspace file with multiple folders)
  2. Open a file from a project that is NOT the first folder in the explorer (e.g., void-driller/constants/worlds.js when log is the first folder)
  3. Start a new Claude Code session
  4. Ask Claude Code what directory it's working in

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.1 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Workaround:

  • Drag to reorder the folders in the explorer to make the desired project the first in the list

Impact:

  • Multi-root workspaces are a core VSCode feature
  • This regression makes the extension unintuitive for developers working with multi-root setups

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions