Markdown [#N](url) links emit OSC 8 hyperlink to current repo instead of specified URL

Resolved 💬 2 comments Opened Feb 27, 2026 by maurorozco Closed Mar 27, 2026

Bug Description

When Claude Code's TUI markdown renderer outputs a link where the link text matches #<number> (e.g., [#16901](https://github.com/anthropics/claude-code/issues/16901)), the emitted OSC 8 hyperlink points to the current git repo's issue tracker instead of the URL specified in the markdown.

Steps to Reproduce

  1. Open Claude Code CLI in a terminal that supports OSC 8 (tested in Ghostty, VS Code integrated terminal, and Cursor IDE terminal) inside any git repo with a GitHub remote
  2. Have Claude output a markdown link like [#16901](https://github.com/anthropics/claude-code/issues/16901)
  3. Hover over or cmd+click the rendered #16901 link

Expected: Link opens https://github.com/anthropics/claude-code/issues/16901
Actual: Link opens https://github.com/<your-user>/<your-repo>/issues/16901

Note: Apple Terminal does not exhibit this issue because Claude Code falls back to displaying full URLs as plain text instead of OSC 8 hyperlinks.

Verification

We isolated the issue through several tests:

  • [click here](https://example.com) → works correctly, opens example.com (no #number pattern in text)
  • [#99999](https://github.com/anthropics/claude-code/issues/99999) → opens https://github.com/<current-repo>/issues/99999 (wrong URL, confirms it's not a real issue lookup)
  • Raw OSC 8 via printfprintf '\e]8;;https://github.com/anthropics/claude-code/issues/16901\e\\#16901\e]8;;\e\\' renders correctly in the same terminals, confirming the terminals handle OSC 8 correctly
  • Claude Code VS Code extension (webview panel) → renders the correct URL, confirming the bug is specific to the TUI markdown renderer
  • Apple Terminal → falls back to showing full URLs as plain text (no OSC 8), so the issue doesn't manifest

Root Cause

The TUI markdown renderer appears to have a GitHub issue autolink feature that detects #<number> patterns in link text and resolves them against the current git remote. This overrides the explicit URL provided in the [text](url) markdown syntax when emitting OSC 8 escape sequences.

Environment

  • Claude Code CLI (Bun binary)
  • macOS (Darwin 24.6.0)
  • Tested in: Ghostty, VS Code integrated terminal, Cursor IDE terminal
  • Shell: fish (not relevant — confirmed issue is in Claude Code's output, not the shell)

View original on GitHub ↗

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