Auto-linker wraps filenames as URLs (e.g. `CLAUDE.md` → `[CLAUDE.md](http://CLAUDE.md)`)
Summary
The implicit auto-linker in Claude Code's chat rendering treats any token matching word.tld-style patterns as a URL and wraps it in a markdown link to http://<token>. In practice this fires far more often on filenames in prose than on actual bare URLs, producing dead/incorrect links the vast majority of the time.
Repro
Send (or have the model emit) a message containing a bare filename in prose, e.g.:
Just write CLAUDE.md as plain text.
Rendered output:
Just write CLAUDE.md as plain text.
The same happens with package.json, tsconfig.json, Program.cs, appsettings.json, Cargo.toml, etc. — the link target http://CLAUDE.md (or http://package.json, etc.) is not a real URL and resolves to nothing.
This also corrupts copy/paste round-trips: when a user copies the rendered text and pastes it back into chat (or into another tool), the markdown-link form is preserved, so future messages now contain [CLAUDE.md](http://CLAUDE.md) instead of the original CLAUDE.md. The artifact then propagates.
Why this is a regression
Before the auto-linker, filenames in prose rendered as plain inline code or plain text — correct. The new behavior:
- False positives dominate. Filenames-in-prose are vastly more common in dev workflows than bare unlinked domains. The heuristic is wrong by default.
- True positives are trivially user-fixable. If someone genuinely wants
example.comto be clickable, they can write[example.com](https://example.com)or<https://example.com>. The implicit case is the lossy one. - Already-formatted links survive. Users and the model both already use explicit
[text](url)markdown when a real link is intended. The implicit wrapper adds noise without solving an unmet need. - It mangles model-generated file references too. When the assistant mentions
CLAUDE.mdortsconfig.jsonin a response, the rendering layer converts those to brokenhttp://links — which then look like the assistant did something wrong.
Requested change
At minimum, make implicit auto-linking opt-in via settings (default off), or restrict the heuristic to tokens that look like real domains (require a known TLD AND no path-style filename extension like .md/.json/.cs/.ts/.py/.toml/.yaml/.yml/.lock/.config).
Removing the auto-linker entirely is also reasonable — explicit markdown link syntax already covers the legitimate case.
Environment
- Claude Code 2.1.119
- Windows 11 Pro
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗