claude-code - 💡(How to fix) Fix [BUG] User-input markdown autolinker treats `.md`/`.rs` filename extensions as TLDs, mangles `<word>_<filename>.md` references in chat [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#53188Fetched 2026-04-26 05:22:06
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
1
Participants
Timeline (top)
labeled ×4

Error Message

No error messages. This is a silent rendering issue — no exception, no warning. The session debug log (with /debug enabled) does not capture it because it's a UI/rendering concern rather than a backend event.

The bug is observable purely by visual inspection of rendered chat messages in the conversation transcript.

Root Cause

File extensions like .md and .rs are common in software projects (Markdown documentation, Rust source files) and should not be interpreted as URL hostnames just because they happen to also be valid TLDs.

Fix Action

Fix / Workaround

Workaround: Wrapping filenames in backticks suppresses the autolinker — `CODE_STANDARDS.md` renders correctly. This is the only workaround found.

Code Example

No error messages. This is a silent rendering issue — no exception, no warning. The session debug log (with `/debug` enabled) does not capture it because it's a UI/rendering concern rather than a backend event.

The bug is observable purely by visual inspection of rendered chat messages in the conversation transcript.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The chat input rendering pipeline auto-converts filenames containing underscores followed by TLD-matching extensions into broken markdown links.

For example, typing CODE_STANDARDS.md in a chat message renders as CODE_[STANDARDS.md](http://STANDARDS.md) — everything after the underscore gets wrapped as a markdown link with http://STANDARDS.md as the URL. The .md extension is being interpreted as Moldova's country-code TLD.

This affects any filename matching the pattern <word>_<filename>.<TLD-matching-ext>. Common file extensions in software projects that match valid TLDs and trigger this bug: .md, .rs, .io, .ai, .app, .dev, .co. The leading <word>_ portion is left outside the broken link, and the rendered link tries to navigate to a non-existent hostname.

What Should Happen?

The text CODE_STANDARDS.md should render verbatim as CODE_STANDARDS.md — no link wrapping, no URL transformation, no autolinking.

File extensions like .md and .rs are common in software projects (Markdown documentation, Rust source files) and should not be interpreted as URL hostnames just because they happen to also be valid TLDs.

Error Messages/Logs

No error messages. This is a silent rendering issue — no exception, no warning. The session debug log (with `/debug` enabled) does not capture it because it's a UI/rendering concern rather than a backend event.

The bug is observable purely by visual inspection of rendered chat messages in the conversation transcript.

Steps to Reproduce

  1. Open Claude Code.
  2. In chat input, type a message containing a filename matching <word>_<filename>.md — for example, CODE_STANDARDS.md.
  3. Send the message.
  4. Observe the rendered message in the conversation transcript: it appears as CODE_[STANDARDS.md](http://STANDARDS.md) instead of the verbatim filename.

Comparison test (confirms TLD-aware behavior):

  1. In the same chat, type README_NOTES.txt and send.
  2. Observe: this renders correctly as README_NOTES.txt with no autolinking, because .txt is not a TLD.

The contrast between steps 4 and 6 confirms the autolinker is matching against a TLD list rather than treating dot-extensions generically.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.117

Claude Code Version

2.1.119

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

I'm submitting this bug with the help of Claude AI, though I do wish that once the AI realized this was a bug that it could have sent the bug report in for me. Also, many of the slash commands it and the "Get Help" AI were telling me to use were not available (/bug, /version, /doctor) which was frustrating.

Environment:

  • OS: Windows 11 (Build 10.0.26100.8246)
  • Claude Code version: 2.1.119
  • Surface: Claude Desktop App
  • Node version: v24.13.0

Workaround: Wrapping filenames in backticks suppresses the autolinker — `CODE_STANDARDS.md` renders correctly. This is the only workaround found.

Settings checked (none control this behavior):

  • User: ~/.claude/settings.json
  • Project: <project>/.claude/settings.json
  • Local: <project>/.claude/settings.local.json

None contain any rendering / markdown / autolink configuration. There is no settings key to disable this behavior.

Affected file extensions in software projects:

  • .md (Moldova ccTLD) — confirmed broken
  • .rs (Serbia ccTLD) — likely affects Rust source filenames like Cargo.rs, build.rs
  • .io, .ai, .app, .dev, .co — likely affected (gTLDs and ccTLDs commonly used in software)

Project impact: In a project with documentation files like CODE_STANDARDS.md, DATA_MODEL.md, DESIGN_SYSTEM.md, ROADMAP.md, and Rust source files like Cargo.rs / build.rs, every chat message that references any of these by name gets mangled. The user has to remember to wrap each filename in backticks, and forgetting (which is easy in conversational chat) produces broken renders that look like real markdown links and may even be clickable to nowhere.

Naturally-occurring evidence: The user's prior messages in many Claude Code chats show this bug occurring inline in real conversations — examples are easy to capture as screenshots from any active session for visual proof.

extent analysis

TL;DR

The issue can be temporarily worked around by wrapping filenames in backticks to suppress the autolinker.

Guidance

  • The autolinker is incorrectly interpreting file extensions that match valid TLDs as URLs, causing broken markdown links.
  • To verify the issue, type a message containing a filename with a TLD-matching extension (e.g., CODE_STANDARDS.md) and observe the rendered message.
  • The workaround of wrapping filenames in backticks (e.g., `CODE_STANDARDS.md`) can be used to render filenames correctly.
  • The bug is likely due to an overzealous autolinking feature that needs to be tweaked to ignore common file extensions.
  • Reviewing the rendering pipeline and autolinking logic may help identify the root cause and lead to a permanent fix.

Example

No code snippet is provided as the issue is related to the rendering pipeline and autolinking logic, which is not explicitly stated in the issue.

Notes

The issue is specific to the Claude Code version 2.1.119 and may not affect other versions. The workaround provided is temporary and may not be suitable for all use cases.

Recommendation

Apply the workaround of wrapping filenames in backticks until a permanent fix is available, as it is a simple and effective way to render filenames correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] User-input markdown autolinker treats `.md`/`.rs` filename extensions as TLDs, mangles `<word>_<filename>.md` references in chat [1 participants]