[BUG] VS Code extension, multi-root workspace: file links in chat unclickable outside primary folder (re-filed from #62718)
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?
This is a re-file of #62718 (itself a re-file of #50936). Both were closed automatically by the stale bot as "not planned" without the bug being fixed or triaged, and only maintainers can reopen them. The closing message asks to open a new issue if the problem is still relevant: it is.
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.
On every cross-folder file reference the user has to copy/paste the path into Quick Open. In codebases made of related repos opened side by side, that is most file references.
Related issues:
- #62718 (closed as stale, 5 👍)
- #50936 (original report, closed as stale)
- #83089 and #80126 (both marked as duplicates of #62718 by a maintainer)
- #87827 (same root cause: @-mention file picker only searches the first folder)
- #53919, #41112 (Windows absolute paths in links)
What Should Happen?
Any one of the following would fix it:
(A) The relative-path resolver searches across all workspace folders, not just the primary one.
(B) The renderer accepts absolute filesystem paths (forward- or backslash) and rewrites them to vscode://file/...:line URIs at render time.
(C) The agent's system prompt specifies a link format known to work in multi-root workspaces, and the extension supports it.
Error Messages/Logs
Steps to Reproduce
- Open a multi-root workspace in VS Code 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 of them is clickable:
- Relative:
[mcp.js](src/mcp.js#L89)(resolved against the 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)
Workaround: the agent falls back to plain path:line text with no clickable link.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.288 (VS Code extension anthropic.claude-code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗