[BUG] VSCode extension: multi-root workspace closes and reopens as single folder when running a BMAD skill
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?
Description
Using a multi-root .code-workspace file (three folders: an API repo, a web repo, and a BMAD repo), running a BMAD agent skill (bmad-agent-dev, a plain markdown-instructions Claude Code skill with no shell or VSCode-API calls) causes VSCode to drop the multi-root workspace and reopen as a single-folder window scoped to just the BMAD folder — the other two folders disappear from the window entirely.
Related issues
- #36949 — extension only recognizes the first folder in a multi-root workspace as its working directory
- #71710 — switching the open folder hides/loses sessions tied to other folders
- #49082 — chat session lost when opening a folder in VS Code
This may be the same underlying mechanism as #49082/#71710, but the visible symptom (whole workspace replaced by a single folder) doesn't appear to be filed yet.
Environment
- OS: Linux (WSL2)
- Claude Code: VSCode native extension
What Should Happen?
The multi-root workspace should remain open; the extension should operate within its assigned working directory without altering the VSCode window/workspace scope.
Error Messages/Logs
Steps to Reproduce
- Open a multi-root
.code-workspacecontaining 3+ folders in VSCode with the Claude Code extension. - Point Claude Code's working directory at one of the non-first folders (or the first — needs confirmation) in that workspace.
- Run a Claude Code skill/command (e.g. a custom skill under
.claude/skills/) from that folder. - Observe: the VSCode window closes the multi-root workspace and reopens showing only that one folder.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.221 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_