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

Resolved 💬 7 comments Opened Oct 1, 2025 by fatlard1993 Closed Jan 11, 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?

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

View original on GitHub ↗

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