[BUG] Text copied from the Claude Code TUI and pasted into the prompt is shown on separate lines in the sent message

Status Open
Reported on v2.1.277
Maintainer reply None cached
Activity 4 comments · opened Sep 19, 2026

What's wrong

When a message contains text copied from the Claude Code TUI itself (for example, a phrase from an assistant reply), the sent message renders the pasted text on its own lines, with blank lines added before and after it. The prompt box shows the text inline before sending.

The session JSONL shows the cause. Each paste is stored wrapped as:

\n\n<pasted_content id="3940">\n<pasted text>\n</pasted_content id="3940">\n\n

The transcript view hides the tags but keeps the newlines around them.

This only happens with text copied out of the Claude Code TUI. Text copied from another app and pasted the same way renders inline as expected.

Also, every paste in the session gets the same id (3940).

Steps to reproduce

  1. Switch to fullscreen rendering with /tui fullscreen, if it is not already the current mode.
  2. Type some text in the prompt.
  3. Select and copy a phrase from an earlier assistant message in the Claude Code TUI, then paste it into the prompt.
  4. Type some more text and press Enter.

Expected: the sent message looks the way it did in the prompt box.
Actual: the pasted phrase appears on separate lines, broken away from the text around it.

Example as stored in the JSONL:

"content":"regarding \"\n\n<pasted_content id=\"3940\">\nDo you want the design doc, or one of the other two routes\n</pasted_content id=\"3940\">\n\n\" - what \"other two routes\" are you talking about?"

Pasting text copied from any other app in step 3 does not reproduce the bug.

Environment

  • Claude Code 2.1.277 and 2.1.278
  • TUI mode: fullscreen (/tui fullscreen)
  • macOS 27.0
  • Terminal: Nice, a native macOS terminal. It reports TERM_PROGRAM=ghostty.

View original on GitHub ↗

3 Comments

manymee · 26 days ago

Same on 2.1.278, macOS. Not limited to text copied from the TUI: text copied from a browser (Brave) and dictated text inserted via Cmd+V by Handy (github.com/cjpais/Handy) are both wrapped as <pasted_content> with blank lines around them, so each paste shows as its own line in the sent message. Typed text soft-wraps normally. All pastes in the session share one id here too.

Environment: macOS 15.7.5, kitty, fullscreen TUI mode.

dimitri-vs · 24 days ago

Same on Windows 11, 2.1.278. Hits pastes from any app, even one-sentence ones, and every paste in a session shares the same id.

Also breaks > quoted text then reply: the > ends up alone on its own line with the pasted text under it.

pasted_content is absent from my Sep 12 build and present from Sep 16 on.

SteveEasley · 23 days ago

Same issue here. When dictating with Wispr Flow into the Claude Code prompt, chunks of the dictated text arrive wrapped as pasted content instead of typed text:

Some typed-looking text.\n\n<pasted_content id="324a">\nA dictated chunk.\n</pasted_content id="324a">\n\n more text

Three effects:

  1. The \n\n around each wrapper renders as extra blank lines in the sent message.
  2. One dictation can be split into several wrappers, so a single spoken sentence breaks into multiple blocks.
  3. Every wrapper in the session reuses the same id (324a here), rather than a unique one per paste.

Showing cached comments. Read the full discussion on GitHub ↗