Add claudeCode.workingDirectory VS Code setting for multi-root workspaces

Open 💬 4 comments Opened Mar 21, 2026 by ffjeremy

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

In a multi-root VS Code workspace, the extension always uses the first folder as the working directory. There is no way to override this.

My workspace has 40+ repos under a shared parent directory (~/Development/MyProject/), with shared Claude context (CLAUDE.md, .claude/, memory) in that parent directory. The .code-workspace file lives there too. But the extension always starts in the first listed folder, so:

  • Sessions created from the CLI in the parent directory don't appear in /resume
  • Project-level memory is scoped to the wrong directory
  • CLAUDE.md discovery starts from the wrong root

Attempted workarounds (all failed)

  1. claudeCode.claudeProcessWrapper with a script that cds to the parent before execing claude — the wrapper runs and cd succeeds (verified via logging), but the extension sends the working directory over the JSON stream protocol after spawn, overriding it
  2. Adding "." as the first workspace folder — causes VS Code to scan all subdirectories, discover every nested git repo, duplicate folders in the explorer, and slow everything down significantly
  3. Opening the parent folder directly instead of using a workspace file — breaks git behavior in sub-repos

Proposed Solution

Add a claudeCode.workingDirectory VS Code extension setting:

{
  "settings": {
    "claudeCode.workingDirectory": "/Users/me/Development/MyProject"
  }
}

This would let users explicitly set the working directory independent of the workspace folder list.

Alternatively, respecting terminal.integrated.cwd from the workspace file would also solve this (as suggested in #24739).

Related issues

  • #12808 — OP wants active-file-based folder selection (different ask, but same underlying inflexibility)
  • #24739 — requested respecting terminal.integrated.cwd (closed as duplicate of #12808)
  • #29825 — multi-root workspace support

Priority

High - This is a blocker for my workflow

Feature Category

IDE Integration

Use Case Example

Multiple independent repos (40+) under a shared parent directory, each in its own git repo, managed via a .code-workspace file. Shared Claude context (CLAUDE.md, .claude/, memory) lives in the parent directory alongside the workspace file.

Additional Context

Claude Code v2.1.81, macOS, VS Code multi-root workspace

View original on GitHub ↗

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