[BUG] Multi-root workspace: agent-emitted file links unclickable outside primary folder

Resolved 💬 5 comments Opened Apr 19, 2026 by pmario Closed May 26, 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?

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/...:line URIs 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

  1. Open a multi-root workspace in VSCode where the primary folder is apps/server and an additional folder is packages/plugin.
  2. Ask the agent to reference a file in packages/plugin/src/mcp.js.
  3. 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_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗