[BUG] File paths in chat panel responses not ctrl+clickable (plain text and backtick format)

Status Open
Reported on v2.1.183
Maintainer reply None cached
Activity 4 comments · opened Jun 19, 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?

File paths referenced in Claude's responses as plain text or in backtick format (e.g. ` tools/books.py ) are not ctrl+clickable to open in the editor. Only markdown link format [file](path)` works in some cases, but even those don't consistently trigger VSCode's file-open behavior on ctrl+click.

Note: This is distinct from #69240 which reports a regression where previously-working markdown links stopped opening files. This issue is about plain-text and backtick-formatted paths that have never been clickable.

What Should Happen?

File paths in Claude's responses (whether plain text, backtick-wrapped, or markdown link format) should be ctrl+clickable and open the file in the editor — similar to how file paths in VSCode's integrated terminal output are already clickable.

Error Messages/Logs

N/A — no error; ctrl+click simply has no effect on the path.

Steps to Reproduce

  1. Open Claude Code in the VSCode side panel
  2. Ask Claude to reference a file in the project (e.g. "what does tools/books.py do?")
  3. Claude responds with the path in plain text or backtick format: ` tools/books.py `
  4. Try ctrl+click on the path text
  5. Nothing happens — file does not open in editor

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.183 (Claude Code)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Related: #69240 (regression for markdown-style links that previously worked). This issue covers the broader case: plain text and backtick-formatted paths are never handled.

VSCode's integrated terminal already detects file paths in output and makes them ctrl+clickable — extending similar detection to the Claude Code chat panel would significantly improve the navigation experience.

View original on GitHub ↗

4 Comments

odakin · 3 months ago

Chiming in from macOS with the Claude Code desktop app (client v2.1.187) — this same issue affects area:app too, not just the VSCode extension. Might warrant an area:app label alongside area:ide, or a separate tracker if that's cleaner (happy to file).

Concrete failure mode I've been living with, since the diagnosis may be useful for prioritization:

The system prompt already instructs the model to "format them as markdown links so the user can click to open them", and my personal CLAUDE.md reinforces the same rule with a cwd-basis clarification. But in dense technical writing, the model consistently defaults to backtick-code form and the paths become uninteractable. Illustrative recent session:

  • 2 assistant turns in a technical-writing context → 15 file mentions, 0 markdown links (all ` notes/foo.tex , plans/....md ` style).
  • User live-flagged the pattern in chat.
  • Model then read the personal SoT doc (full text) via a Read tool call.
  • In the next assistant turn, another backtick-form path.

So the "wrap in a markdown link" instruction was present at four loading layers simultaneously (harness system prompt + user CLAUDE.md + fresh Read of the specific rule doc + a live user flag on the previous turn) and still didn't fire. This is my 5th user-visible occurrence in ~10 weeks; each targeted fix (rule wording, doc structure, hook) has stopped the specific face of the failure but not the underlying generator. Dense technical prose puts backtick-wrapped file names into the model's local convention, and the ambient "wrap it" rule only fires when the topic is the rule.

Why renderer-layer feels like the right layer:

  • The rule is already documented in the harness itself. Tighter documentation is at its ceiling — no room for more presence.
  • A renderer that auto-linkifies inline-code text when it resolves against the session cwd is model-agnostic (survives model swaps, register drift, and future training changes).
  • It can piggy-back on the resolver the desktop app already uses when a user clicks a markdown link into the right panel.
  • A cwd-relative existence check is a strong false-positive filter — an unrelated ` import.py ` won't linkify unless a real file at that cwd-relative path exists.

Concretely, the behavior I'd love (matches OP + desktop-app-specific):

  • Inline-code (backtick) text → run cwd-relative existence check → if it resolves to an existing file under the session's cwd, make it clickable and open the resolved file in the right panel (the same affordance markdown links get today).
  • On basename ambiguity: use the exact path as written; no fuzzy matching.
  • No behavior change if the resolved path doesn't exist — plain inline code as today.

Related in this repo, for triage:

  • #73417 (VSCode chat panel md#anchor click)
  • #70070 (VSCode chat panel spaces in path)
  • #13008 / #72695 (TUI OSC 8, adjacent area)

Happy to open a separate area:app issue if the tracker split is cleaner — otherwise this is meant as a scope-expansion signal for the existing enhancement.

odakin · 1 month ago

Still reproducible on Claude desktop 1.34493.1: bare backtick paths in the chat renderer remain non-clickable, while [label](path) links work. Keeping this open; happy to file a separate area:desktop issue if that's the preferred tracker.

odakin · 27 days ago

Update from the macOS desktop app (Claude for Mac 2.110.0, engine 2.1.271): backtick paths such as dir/file.md are now rendered as clickable links — thanks. Two things still make many of these links open to "Couldn't find this file":

  1. Linkification is purely lexical (a / plus an extension). A path that doesn't exist anywhere is still turned into a link.
  2. Relative paths are resolved against the folder the session was started in. But after the agent runs cd in Bash, the harness tells it "Primary working directory: <subdir>", and the system prompt says to write paths relative to the working directory. Paths written relative to that subdirectory are linkified but can't be opened.

Suggestions: only linkify (or style as a link) when the resolved file exists, and resolve relative paths against the current working directory as well as the starting folder — or keep the harness notice and the renderer on the same base. Absolute paths work fine. In the desktop turns I sampled, roughly 8% contained such an unopenable path; I'm working around it locally with a Stop hook that asks the model to rewrite them.

odakin · 27 days ago

Follow-up / correction to my comment above, after reading the desktop app's main-process code (Claude for Mac 2.110.0, engine 2.1.271):

  • "Relative paths are resolved against the folder the session was started in" is only the first step. If the file isn't there and the session folder is a git repository, the app falls back to a suffix match over git ls-files (then untracked files) and opens the file when exactly one path ends with the link target. So a session started at a repo root mostly keeps working after cd subdir.
  • The failure I reported is specific to sessions started in a folder that is not itself a git repo (e.g. a parent folder holding several repos). There is no suffix fallback there, so every subdirectory-relative path gives "Couldn't find this file".
  • Inline code inside a markdown link label is not linkified separately — clicking it opens the href. So a link whose label is a backticked relative path and whose href is absolute works fine.

Narrowed suggestion: in the non-git case, also try the agent's current working directory (the one the harness reports as "Primary working directory"), or fall back to a plain directory walk for the suffix match when the session folder is not a repo.