Absolute-path file links render as clickable but never resolve; only file:// URIs work

Status Closed — duplicate
Maintainer reply None cached
Activity 2 comments · opened Aug 23, 2026 · closed Aug 25, 2026

Summary

Claude Code emits markdown file links whose href is a path relative to the session's working directory. For a file outside that directory no such path exists, so the link is unresolvable — but it still renders as a styled, clickable link. Clicking does nothing, with no error and no indication the target was never resolvable.

The user then has to ask for the full path. One wasted turn, every time, and the failure is silent so it is only discovered by clicking.

Environment

  • Claude Code desktop, Windows 11
  • Session cwd is a git worktree of one repo; the target file lives in a sibling repo (a common multi-repo / worktree setup)

Measured

Four href forms, same target file, same message. Verified by the user clicking each one:

| href | renders as a link | resolves on click |
|---|---|---|
| roles/CLEANER.md (cwd-relative; target is outside cwd) | yes | no |
| C:\Users\Scott\...\CLEANER.md (absolute, backslashes) | yes | no |
| C:/Users/Scott/.../CLEANER.md (absolute, forward slashes) | yes | no |
| file:///C:/Users/Scott/.../CLEANER.md | yes | yes |

Forward slashes failing rules out markdown backslash-escaping as the cause. The discriminator is the URI scheme, not the path separator — a bare absolute path is not treated as a link target at all.

Confirmed the relative form points at nothing: ls roles/CLEANER.md from the session cwd returns No such file or directory.

Two defects

  1. Bare absolute paths are not resolvable link targets. Only a file:// URI works.
  2. Unresolvable hrefs are still styled as links. This is the one that costs time — a dead link is visually identical to a working one.

Why it recurs rather than being an edge case

The guidance is to use a path relative to the working directory. That format cannot express a file outside the working directory, and no fallback is specified, so the model emits a broken relative link rather than an unlinked absolute path. Anyone running two repos side by side, or working in git worktrees, hits this constantly.

Suggested fix, cheapest first

  1. Resolve bare absolute paths as link targets (handling Windows separators), or instruct the model to emit a file:// URI when the target is outside cwd.
  2. Failing that, instruct the model to emit an unlinked absolute path in that case. A correct non-link beats a link that does nothing.
  3. At minimum, do not apply link styling to an href that could not be resolved.

View original on GitHub ↗

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