Title: [BUG] Session in one VS Code window keeps reading files from a different project open in another window (folder names share a prefix)
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?
Title: [BUG] Session in one VS Code window keeps reading files from a different
project open in another window (folder names share a prefix)
What's Wrong?
I have two separate VS Code windows open, each with its own single-root project
and its own Claude Code session:
- Window A: project
ns16 - Window B: project
ns16-florisse(note: folder name shares the prefixns16)
While the session in Window B (ns16-florisse) is running a heavy, long
multi-step development task, I ask the session in Window A (ns16) to do an
unrelated task. The Window A session keeps erroring and repeatedly reads files
from the ns16-florisse project instead of ns16.
What Should Happen?
Expected Behavior
Each session stays scoped to its own window's workspace folder. The ns16
session should only read/edit files under ns16.
Actual Behavior
The ns16 session repeatedly reads files under ns16-florisse and keeps
producing errors, as if its working directory / IDE context is attached to the
other window's project.
Possibly Relevant Details
- The two folder names share a prefix (
ns16vsns16-florisse) — may matter
if any project/path matching is prefix-based
- Both windows have the extension active at the same time; the session may be
connecting to the wrong window's IDE server, leaking the other window's
active-file context
- Related but different: #12808 / #30771 are about multi-root workspaces; this
is two separate single-root windows
Environment
- Claude Code version: <FILL IN — run
claude --version> - VS Code version: <FILL IN>
- Claude Code extension version: <FILL IN>
- OS / Platform: <FILL IN>
- Model: <FILL IN>
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Open two VS Code windows: one with folder
ns16, another with folder
ns16-florisse (one folder name is a prefix of the other)
- In the
ns16-florissewindow, start a Claude Code session and give it a
heavy, long-running multi-step coding task
- While that task is running, switch to the
ns16window and ask its Claude
Code session to do a task inside ns16
- Watch the
ns16session's tool calls
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.205
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_