[BUG] File paths in chat panel responses not ctrl+clickable (plain text and backtick format)
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
- Open Claude Code in the VSCode side panel
- Ask Claude to reference a file in the project (e.g. "what does tools/books.py do?")
- Claude responds with the path in plain text or backtick format: `
tools/books.py` - Try ctrl+click on the path text
- 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.
4 Comments
Chiming in from macOS with the Claude Code desktop app (client v2.1.187) — this same issue affects
area:apptoo, not just the VSCode extension. Might warrant anarea:applabel alongsidearea: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:
notes/foo.tex,plans/....md` style).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:
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):
Related in this repo, for triage:
Happy to open a separate
area:appissue if the tracker split is cleaner — otherwise this is meant as a scope-expansion signal for the existing enhancement.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 separatearea:desktopissue if that's the preferred tracker.Update from the macOS desktop app (Claude for Mac 2.110.0, engine 2.1.271): backtick paths such as
dir/file.mdare now rendered as clickable links — thanks. Two things still make many of these links open to "Couldn't find this file":/plus an extension). A path that doesn't exist anywhere is still turned into a link.cdin 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.
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):
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 aftercd subdir.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.