[Bug] "Open in Tab" uses first workspace folder instead of active file's root in multi-root workspace
Resolved 💬 3 comments Opened Apr 19, 2026 by karroo Closed Apr 22, 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?
Bug Report
In a multi-root workspace, Claude Code behaves inconsistently depending on how it's opened:
- Open in Terminal: correctly uses the active file's root folder as primary working directory ✅
- Open in Tab: always uses the first folder in the workspace, ignoring the active file's root ❌
Expected behavior
Both "Open in Terminal" and "Open in Tab" should use the active file's root folder as the primary working directory, consistent with each other.
Environment
- Multi-root workspace (multiple independent projects in one VSCode window)
- VSCode extension
What Should Happen?
Both "Open in Terminal" and "Open in Tab" should use the active file's root folder as the primary working directory, consistent with each other.
Error Messages/Logs
Steps to Reproduce
1, Open file in vs
- claude code: open in new tab
- opne claude code based the folder of open file
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.98 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗