Long URLs in output become unclickable when wrapped

Resolved 💬 2 comments Opened Jan 25, 2026 by jonschull Closed Feb 28, 2026

Problem

When Claude Code outputs a long URL that exceeds the terminal width, the URL wraps to multiple lines and becomes unclickable (or only partially clickable, leading to truncated URLs when clicked).

Example

When Claude outputs:

https://docs.google.com/spreadsheets/d/1836BdZt5pEHKmbZ9pJdy3SImoduZYJ1vUnmnnDy54W8/edit?gid=716186809#gid=716186809

In a typical terminal width, this wraps and:

  • Clicking opens a truncated URL (e.g., https://docs.google.com/spreadsheets/d/1836Bd)
  • Or the URL isn't recognized as clickable at all

Environment

  • Claude Code CLI running in xterm.js-based terminal
  • Also reproducible in native terminals with narrower widths
  • Using @xterm/addon-web-links for URL detection

Possible Solutions

  1. Auto-shorten long URLs: When outputting a URL longer than ~60 chars, also output a shortened/redirect version that fits on one line
  2. Copy affordance: Add a small "copy URL" indicator next to long URLs
  3. URL reference list: At the end of responses containing long URLs, list them as numbered references: [1] full-url-here
  4. Markdown-style links: Output as [link text](url) where link text is short, if the terminal supports it

Workaround Attempted

I tried implementing server-side URL detection and injection of short redirect URLs, but Claude Code's output appears to bypass the PTY data stream (rendering client-side), so server-side processing can't intercept it.

Impact

This significantly affects usability when Claude shares documentation links, GitHub URLs with long paths, or any URL with query parameters.

Thank you for considering this enhancement!

View original on GitHub ↗

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