[BUG] Multi-root workspace: agent-emitted file links unclickable outside primary folder
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?
Environment
- Claude Code VSCode extension
- VSCode multi-root workspace (multiple folders in
.code-workspace) - Windows 11
- Model: Claude Opus 4.7
Problem
When the agent emits a markdown link to a file located in any workspace folder OTHER than the primary one, no link format produces a clickable result. The system prompt instructs the agent to use markdown relative paths (e.g. [file.ts](src/file.ts#L42)), which only works for files under the primary workspace folder.
What Should Happen?
Expected
Either:
- (A) The relative-path resolver should search across all workspace folders, not just the primary.
- (B) The renderer should accept absolute filesystem paths (forward- or backslash) and rewrite them to
vscode://file/...:lineURIs at render time. - (C) The agent's system prompt should specify a link format known to work in multi-root workspaces, and the extension should support it.
Workaround
Currently the agent has to fall back to plain path:line text with no clickable link, forcing the user to copy/paste the path into Quick Open.
Impact
On every cross-folder file reference, the user has to manually navigate. In codebases composed of related repos opened side-by-side (monorepo-like setups), this is most file references.
Error Messages/Logs
Steps to Reproduce
Reproduction
- Open a multi-root workspace in VSCode where the primary folder is
apps/serverand an additional folder ispackages/plugin. - Ask the agent to reference a file in
packages/plugin/src/mcp.js. - The agent emits one of these formats — none click:
- Relative:
[mcp.js](src/mcp.js#L89)— resolved against primary folder, file not found - Windows absolute:
[mcp.js](e:\repo\packages\plugin\src\mcp.js)— invalid URL (backslashes) - Forward-slash absolute:
[mcp.js](e:/repo/packages/plugin/src/mcp.js)— non-standard, ignored - file:// URI:
[mcp.js](file:///e:/repo/packages/plugin/src/mcp.js)— does not click - vscode:// URI:
[mcp.js](vscode://file/e:/repo/packages/plugin/src/mcp.js:89)— does not click
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.81 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
6 Comments
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Just because there is not much activity, does not mean the problem goes away. There have been 2 thumbs up. So at least 2 other users had the same problem and found this issue.
Adding labels does not notify users. So adding a stale label will not trigger additional activity.
I confirm I have this problem and waiting for a resolution.
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"
},
{
"path": "/Users/xxxx/sites/root_2"
}
],
....
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.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.