[BUG] Clickable file-path links resolve against the wrong base dir (repo subfolder, not the session cwd) → file-not-found on click
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?
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
When the working directory is a parent of the project I'm asking about,
Claude renders a file reference as a clickable markdown link but emits the path
relative to the project/repo subfolder, not relative to the session
working directory. The link therefore resolves to a path that doesn't exist,
and clicking it fails (file not found / nothing opens).
Example from a real session — cwd was C:\Users\<me>, the repo lived atC:\Users\<me>\hermes-agent\:
- Claude wrote a link to
agent/foo.py - The client resolved it against the cwd →
C:\Users\<me>\agent\foo.py(does not exist) → click fails - The correct, clickable path would have been
hermes-agent/agent/foo.py
This is distinct from the existing clickability issues:
- #69645 — backtick/plain-text paths not clickable at all
- #90336 — links with spaces/umlauts not found
- #88936 (closed) — absolute-path links render but don't resolve (so "just use absolute paths" is already known not to work)
Here the link IS clickable and the format is fine — the base directory used
to resolve the relative path is wrong.
What Should Happen?
What Should Happen?
A relative file-path link should resolve against (and be emitted relative to)
the session working directory, so it is clickable regardless of whether the
file lives in a subfolder of the cwd. At minimum, clicking a rendered file link
should open the file when that file exists on disk under the cwd tree.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce
- Start Claude Code with the working directory set to a folder that contains
a git repo as a subfolder (e.g. cwd = C:\Users\me, repo at
C:\Users\me\myrepo).
- Ask Claude about a file inside the subfolder repo (e.g. "what does
myrepo/src/app.py do?").
- Claude replies with a clickable link whose href is
src/app.py
(relative to the repo), not myrepo/src/app.py (relative to cwd).
- Click the link.
Result: file-not-found / nothing opens (the path resolves toC:\Users\me\src\app.py, which doesn't exist).
Expected: the link opens C:\Users\me\myrepo\src\app.py.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.223
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗