[BUG] Copy-paste from terminal includes collapsed tool call blocks in clipboard
What's Wrong?
When selecting and copying text from a Claude Code response in the terminal, collapsed tool call blocks (e.g., Bash(...) with ... +22 lines (ctrl+o to expand)) are included in the clipboard along with the actual response text.
This means pasting into Slack, Notion, or any other app includes the tool execution details that the user didn't intend to copy — just the response text.
What Should Happen?
Copy-to-clipboard should only include the visible response text, not the collapsed tool call blocks. Alternatively, there could be a way to copy just the assistant's message text (e.g., a keybinding or right-click option).
Steps to Reproduce
- Run any prompt that triggers a tool call, e.g.:
claude "run pytest and tell me the results" - Claude runs
Bash(pytest ...)and shows a collapsed tool block followed by a text response - Select the text response by clicking and dragging — the collapsed tool block above it gets included in the selection
- Paste into any external app (Slack, Notion, browser text field)
- The pasted content includes
Bash(source venv/bin/activate && pytest ...)and the collapsed output preview, not just the response text
Error Messages/Logs
N/A — no error, just unintended clipboard content.
Environment
- Claude Code Version: 2.1.104 (Claude Code)
- Claude Model: Opus 4.6
- Platform: Anthropic (Max)
- Operating System: macOS (Darwin 25.2.0)
- Terminal/Shell: zsh
Is this a regression?
Unknown — may have always been this way.
Additional Information
A potential fix could be: when rendering to clipboard, strip tool call blocks and only include assistant text. Or provide a "copy response" action that extracts just the message.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗