Text output adds leading spaces and embedded newlines, breaks copy-paste
When Claude drafts text for the user to copy-paste (e.g. an email reply), the CLI renderer adds leading whitespace to every line and wraps paragraphs with embedded newlines. When the user pastes this into an email client, Slack, or any other tool, the formatting is broken and they have to manually strip spaces and rejoin lines every time.
This is a frequent pain point when using Claude Code to draft messages, emails, or any prose that needs to be copied elsewhere.
Expected behaviour: A way to output plain text blocks that preserve the original formatting exactly, with no added indentation or line wrapping — so copy-paste just works.
Workarounds considered and rejected:
- Writing to a temp file and using
pbcopy— too clunky for routine use - Asking the user to manually clean up — defeats the purpose
Environment: macOS, zsh, default terminal
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗