claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Windows desktop: a `:N` line suffix on a markdown-file link silently kills the link, while the same suffix works on code files

Open its-coughfee opened this issue 4 months ago • 5 comments

What's Wrong?

On the Windows desktop app (2.1.219), a relative markdown link to a .md file opens correctly — until a line-number suffix is added, at which point the click is silently dropped. The identical suffix works on a code file.

Tested in one session, same pane, same project, four link forms:

Link form Result
[notes.md](notes.md) ✅ opens, at top
[notes.md:9](notes.md:9) ❌ click does nothing at all
[notes.md#some-heading](notes.md#some-heading) ✅ opens, anchor ignored — lands at top
[script.py:479](src/script.py:479) ✅ opens at line 479

So the :N form is supported (code files honour it precisely), and .md links are supported (they open), but the combination fails closed rather than degrading.

Why this one bites harder than it looks: Claude Code's own guidance tells the model to emit file references as path/to/file.md:42 markdown links because they're clickable. For .md targets that instruction produces a dead link every time — and because the styling still looks clickable, neither the model nor the user gets any signal it failed.

What Should Happen?

A .md link with a :N suffix should open the file — at that line if the preview supports it, at the top if not. Degrade, don't drop. Ideally #heading anchors would scroll the markdown preview to the heading too, but the silent failure is the actual bug.

Environment

Windows 11, Claude Code desktop app 2.1.219.

Related, not duplicate

  • #81817 (absolute-path hrefs dropped on Windows desktop — ours are relative and work without the suffix)
  • #73417 (heading anchors in the VSCode extension)

its-coughfee avatar Aug 03 '26 05:08 its-coughfee

Follow-up testing — the :N form works, .md is the outlier, plus two adjacent observations

Further clicks on this, all on Windows desktop 2.1.219. Splitting confirmed results from unconfirmed ones, because my later test vehicle turned out to be unreliable.

Confirmed — on files that already existed in the repo and are git-tracked:

Link Result
[notes.md](notes.md) opens, at top
[notes.md:9](notes.md:9) dead — no navigation, no error
[notes.md#heading](notes.md#heading) opens at top, anchor ignored
[script.py:479](path/script.py:479) opens at line 479
[config.json:3](path/config.json:3) opens at line 3

So the :N suffix is well supported for code files and lands precisely. Markdown is the outlier: it's the one type where adding the suffix turns a working link into a dead one.

Adjacent observation — affordance mismatch on .markdown. A link to a .markdown file opened correctly but rendered with no underline and no hover state, so it didn't look clickable at all. That's the inverse of #81817, where a dead link renders with full link affordance. Both point at styling being decided separately from actual clickability.

Not confirmed, but possibly worth a look. I tried to test whether other extensions honour :N by creating fresh test files at the repo root. Every one failed to open — including a .py, which works reliably elsewhere in the same project. So something other than extension was in play; the failing files were all newly created, untracked and at the repo root, while every working example was pre-existing, tracked and in a subdirectory. I didn't isolate which of those matters, so I'm not claiming a second bug — only flagging that newly created or untracked files may not resolve, in case that's a known behaviour or an easy thing for you to check.

its-coughfee avatar Aug 03 '26 14:08 its-coughfee

Adding context: this is one of several Markdown-viewer problems that together pushed me to build my own reader rather than keep working around them. Leaving it open — it's a real inconsistency between how code and Markdown files are treated, whatever I end up using myself.

its-coughfee avatar Aug 06 '26 06:08 its-coughfee

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] avatar Oct 07 '26 10:10 github-actions[bot]

This issue was incorrectly closed by the github-actions bot, despite having reproduction steps and Claude version. This bot behavior is tracked in https://github.com/anthropics/claude-code/issues/87647. Consider upvoting that issue for visibilty, maybe the bot behavior gets fixed.

marcindulak avatar Oct 08 '26 06:10 marcindulak

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Nov 30 '26 14:11 github-actions[bot]