[BUG] Text wrapping breaks long URLs in assistant output

Resolved 💬 2 comments Opened May 6, 2026 by peterjmag Closed Jun 4, 2026

Preflight Checklist

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

What's Wrong?

When Claude outputs a URL that wraps onto multiple lines, I can't easily copy/paste the URL or open it in my browser.

Example

Using the following test prompt when wrapping is set to 49 columns:

output this URL and nothing else: https://github.com/anthropics/claude-code/issues/609#issuecomment-3721545051

This results in the following:

❯ output this URL and nothing else:              
  https://github.com/anthropics/claude-code/issu 
  es/609#issuecomment-3721545051                 

⏺ https://github.com/anthropics/claude-code/issue
  s/609#issuecomment-3721545051

If I copy and paste the URL into a text editor (or even Claude's own user input field), I get this:

https://github.com/anthropics/claude-code/issue
  s/609#issuecomment-3721545051

(Note the extra spaces and line break between issue and s/609)

In Terminal.app on macOS, I can use <kbd>Command</kbd> + <kbd>double click</kbd> (or <kbd>right click</kbd> > "Open Link") to open a URL in my browser. When I do either of those things with the above output, my browser opens the following URL, which doesn't exist:
https://github.com/anthropics/claude-code/issue

| Before right-clicking | After right-clicking | After clicking "Open Link" |
|--------|--------|--------|
| <img alt="Image" src="https://github.com/user-attachments/assets/ed29ef77-3c8e-457d-99dc-8ef572094d3c" /> | <img alt="Image" src="https://github.com/user-attachments/assets/9d1e1300-f85f-4330-88b3-c749a6800c8e" /> | <img alt="Image" src="https://github.com/user-attachments/assets/45a96160-6758-4c6d-8906-3de4997f415f" /> |

What Should Happen?

Given the following assistant output:

⏺ https://github.com/anthropics/claude-code/issue
  s/609#issuecomment-3721545051

When I trigger the "Open Link" action on the URL (either with <kbd>Command</kbd> + <kbd>double click</kbd> or by selecting "Open Link" from the right-click contextual menu thing), the following URL should open in my browser:
https://github.com/anthropics/claude-code/issues/609#issuecomment-3721545051

When I copy the URL, my clipboard contents should exactly match the following:
https://github.com/anthropics/claude-code/issues/609#issuecomment-3721545051

Error Messages/Logs

Steps to Reproduce

  1. Set your terminal to a width of 49 columns.
  2. Run claude
  3. Enter the following prompt:

``
output this URL and nothing else: https://github.com/anthropics/claude-code/issues/609#issuecomment-3721545051
``

  1. Copy the resulting output to your clipboard and paste it into a text editor.
  2. Alternatively, try opening the URL directly from your terminal. In Terminal.app on macOS, you can do this by either holding down <kbd>Command</kbd> and double clicking on the URL, or right clicking on the URL and selecting "Open Link".

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.131 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Version info
  • Terminal.app version: Version 2.14 (455.1)
  • macOS version: 15.6.1 (24G90)
Other issues
A few bonus test screen recordings just for fun

View original on GitHub ↗

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