VS Code chat-panel webview ignores leading-slash workspace-rooted markdown links

Resolved 💬 3 comments Opened Apr 29, 2026 by AlexKalenik Closed May 31, 2026

Summary

In the Claude Code VS Code extension's chat-panel webview, markdown links with leading-slash workspace-rooted paths — e.g. [name.cpp](/Development/Src/name.cpp) — do not open files. The same syntax works correctly in VS Code's native markdown preview when used in .md files inside the workspace.

Repro

  1. Open a workspace folder in VS Code (e.g. D:\repo).
  2. Have Claude emit a chat message containing: [file.cpp](/Development/Src/file.cpp) where the file exists at D:\repo\Development\Src\file.cpp.
  3. Click the link in the chat panel.

Expected: Opens D:\repo\Development\Src\file.cpp — same workspace-root resolution as VS Code's markdown preview (VS Code markdown docs).

Actual: Link does not open / fails silently. No diagnostic surfaced.

If the same [file.cpp](/Development/Src/file.cpp) text is placed in a .md file rendered by VS Code's native markdown preview within the same workspace, the link opens correctly. The divergence is in the chat-panel webview's link handler, not in VS Code itself.

Workaround

Use bare relative paths from workspace root in chat output: [file.cpp](Development/Src/file.cpp) — no leading slash. This works in the chat panel but is inconsistent with VS Code's native markdown convention, forcing authors to maintain different link forms in the same project depending on render destination.

Why this matters

The Claude Code system context currently instructs both formats in different places:

  • VSCode Extension Context (chat output): [filename.ts](src/filename.ts) — relative without leading slash.
  • Per-repo CLAUDE.md authoring guides commonly say: [filename.ts](/src/filename.ts) — leading slash for workspace root, matching VS Code's native preview behavior.

Aligning the chat-panel webview's link resolver with VS Code's native markdown preview (treat leading-slash as workspace-root) would let authors and agents use one link format consistently across .md files and chat output.

Environment

  • VS Code: 1.117.0
  • Claude Code extension: 2.1.123 (anthropic.claude-code)
  • OS: Windows 11 Enterprise (10.0.26200)
  • Workspace context: Windows-mounted P4 depot under D:\ accessed both natively and via WSL2 — link click happens in Windows-native VS Code regardless

View original on GitHub ↗

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