[BUG] In vscode workspace, Claude Code always starts in first project

Open 💬 22 comments Opened Dec 1, 2025 by precisionpete

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?

I have a VScode workspace with multiple projects with Claude Code.

If I open a file in project 2 then click the Claude icon, It always opens the context in the first project. The only way I can get a context in the second project is to reorder the projects in the workspace. I asked CC how to open it in the second project and it says to do exactly what I was trying to do...

Using Linux Mint 22.2 (24.04), VScode 1.106.3, Claude Code plugin 2.0.55

The behavior has always been like this for me.

What Should Happen?

If I open a file an a project other than the first project in the workspace, CC should launce in that working folder.

Error Messages/Logs

No errors. It works fine. Just not in the correct folder.

Steps to Reproduce

Try it.

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.28

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

22 Comments

riptscripts · 7 months ago

My current workaround is having a hook/CLAUDE.md that routes to the right project. So annoying.

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

JoeEarly · 6 months ago

Is anyone going to look at this as I see it has been reported a few times but they all get automatically closed

hmeerlo · 5 months ago

Ok this is really annoying. This should be fixed somehow, by either opening with the root folder of the file that is currently open, or a dropdown where the user can select the root.

andygeorge · 4 months ago

I am also running into this.

jtmueller · 3 months ago

The Gemini CLI extension for VS Code will, upon opening, open a dropdown for you to pick which top-level folder in your workspace to use. The extension doesn't even have a UI, it's just a terminal window with some knowledge of what files you have open, and they managed to figure this one out.

mathieu166 · 3 months ago

same problem here. are you going to do something?

davidklein-dev · 3 months ago

Same issue here. This is extremely annoying and might make me switch back to cursor. I have a multiroot with a service and ux that are closely paired so being able to work on them in conjunction from vscode in a single workspace greatly increases productivity so claude code not supporting that is a breaking feature thats missing.

mathieu166 · 3 months ago

I found a workaround with claudeCode.claudeProcessWrapper... create a sh script that cd in the dir you want Claude to start, then call Claude.

claude-wrapper.sh:
`#!/usr/bin/env bash
set -euo pipefail

cd /the/path/you/want
pwd >&2
exec claude "$@"`

In your vscode settings:
claudeCode.claudeProcessWrapper="/path/to/claude-wrapper.sh

ffjeremy · 3 months ago

Still an issue on v2.1.81. In a multi-root workspace, the extension hardcodes the first folder as the working directory.

Attempted workaround: using claudeCode.claudeProcessWrapper with a script that cds to the parent directory before execing claude. The wrapper runs and the cd succeeds (verified via logging), but the extension appears to send the working directory over the JSON stream protocol after spawning the process, so the cwd override has no effect.

This means sessions created from the CLI in the parent directory don't show up in /resume in the extension, and project-level context (CLAUDE.md, .claude/, memory) scoped to the parent directory isn't picked up correctly.

Would love a claudeCode.workingDirectory setting, or for the extension to respect terminal.integrated.cwd from the workspace file.

gustawaio · 3 months ago

Can confirm this is still a problem for the Claude Code Extension for VS Code 1.113.0

talchemist112-ops · 3 months ago

Same issue and it is very basic i am surprised to see this in 2026

talchemist112-ops · 3 months ago

I have the same issue. I work with 20+ independent repositories under one VS Code workspace. Every Claude Code session defaults to the first folder regardless of which project I am working in. The reorder workaround is not practical when switching between 5 parallel sessions on different projects.
Please add a claudeCode.workingDirectory setting or make the panel detect the active file’s folder as the working directory. This is a blocker for anyone

talchemist112-ops · 3 months ago
Can confirm this is still a problem for the Claude Code Extension for VS Code 1.113.0

Yes with

Me did you find a solution or workaround

Leeiio · 3 months ago

Can confirm this is still a problem for the Claude Code Extension for VS Code 2.1.112

gustawaio · 3 months ago

The team i behind VS Code is probably focusing on solving this via "VS Code Agents" instead. VS Code Agents was just released with a preview version: https://code.visualstudio.com/updates/v1_116#_visual-studio-code-agents-insiders

VS Code Agents targets this precise use case with a GUI specifically tailored for working with parallel agents across multiple projects.

EronWright · 1 month ago

Current workaround remains launching claude manually via integrated vscode terminal.

manjunath-satyamurthy · 1 month ago

Sharing a related pain point that stems from the same root cause:

Even if claude config living in a single working directory is acceptable, the problem is that a session has no concept of a VS Code workspace (.code-workspace file). VS Code workspaces let you group multiple unrelated repositories/folders into a named context — and that grouping is persistent across window reloads.

Since Claude Code sessions are tied to a directory rather than a workspace, any additional repos or folders that the agent needs to be aware of are lost when the session or VS Code window is reloaded. You have to manually re-add them every time.

Expected behavior: Starting a session from a VS Code workspace should restore the full set of workspace folders automatically, so the agent has the right context without manual re-configuration on every reload.

mariendeau · 1 month ago
Sharing a related pain point that stems from the same root cause: Even if claude config living in a single working directory is acceptable, the problem is that a session has no concept of a VS Code workspace (.code-workspace file). VS Code workspaces let you group multiple unrelated repositories/folders into a named context — and that grouping is persistent across window reloads. Since Claude Code sessions are tied to a directory rather than a workspace, any additional repos or folders that the agent needs to be aware of are lost when the session or VS Code window is reloaded. You have to manually re-add them every time. Expected behavior: Starting a session from a VS Code workspace should restore the full set of workspace folders automatically, so the agent has the right context without manual re-configuration on every reload.

That makes total sense, Kiro does that exactly. It knows about every folder part of the workspace no matter where they are located on the disk. But Kiro agent is built in the IDE, wonder if a plugin have that capability.

manpreets · 1 month ago

Similar issue on Mac where a multi-root workspace is used in VSCode. Claude-Code only recognizes index 0 or root_1 below as the project folder -

{
"folders": [
{
"path": "/Users/xxxx/.local/share/vip/dev-environment/root_1" // Wordpress
},
{
"path": "/Users/xxxx/sites/root_2" // Custom plugins
}
],
....

The files or folders under /root_2/ are not indexed for @ suggestions.

Response from Claude-Code -

That's a Claude Code limitation — the @ file mention autocomplete only indexes the primary working directory (/Users/xxxx/.local/share/vip/dev-environment/root_1), not additional directories configured in the workspace.

The additional working directory (/Users/xxxx/sites/root_2 is accessible to me via tools (I can read/write files there), but it isn't included in the @ suggestion index.

arbalan33 · 20 days ago

One workaround is to add the workspace root directory itself to the workspace (File -> Add Folder to Workspace...) and move it to be first in the list, this way Claude will start at the workspace root

gustawaio · 20 days ago
One workaround is to add the workspace root directory itself to the workspace (File -> Add Folder to Workspace...) and move it to be first in the list, this way Claude will start at the workspace root

That's a clever workaround and might work well for some setups. Though for many of us the assumption of a workspace root doesn't hold — the whole point of a .code-workspace file is often to group unrelated sibling projects that might live in completely different locations on disk with no shared parent that means anything.

Even when a common parent technically exists, putting it first just to trick Claude into starting there isn't ideal since it breaks per-project .claude/ config pickup. Claude would then be rooted at some arbitrary parent folder instead of the actual project you're working in.

The real fix should be: Claude Code detects which folder the currently active file belongs to and starts there, respecting that project's own .claude/ files. That's the behavior that would actually make multi-root workspaces work properly for everyone.