claude-code - 💡(How to fix) Fix VS Code chat-panel webview ignores leading-slash workspace-rooted markdown links [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54815Fetched 2026-04-30 06:35:11
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

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.

Root Cause

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.

Fix Action

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.

RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Update the Claude Code extension to handle markdown links with leading-slash workspace-rooted paths consistently with VS Code's native markdown preview.

Guidance

  • Verify that the issue is specific to the Claude Code extension's chat-panel webview by comparing its behavior to VS Code's native markdown preview.
  • Check if the extension's link handler can be modified to treat leading-slash paths as workspace-rooted, similar to VS Code's native markdown preview.
  • Consider using a consistent link format across the project, either with or without leading slashes, to avoid confusion.
  • Test the workaround of using bare relative paths from the workspace root in chat output to ensure it works as expected.

Example

No code snippet is provided as the issue is related to the extension's behavior rather than a specific code implementation.

Notes

The issue may be specific to the Claude Code extension and its interaction with VS Code's native markdown preview. The workaround provided may not be ideal as it requires maintaining different link formats.

Recommendation

Apply the workaround of using bare relative paths from the workspace root in chat output, as it is a temporary solution that allows for consistent link behavior until the extension is updated to handle leading-slash paths correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix VS Code chat-panel webview ignores leading-slash workspace-rooted markdown links [2 comments, 2 participants]