Code blocks have automatic indentation making commands un-copy-pasteable
Bug Description
When Claude Code outputs code blocks (using triple backticks), the rendered output automatically adds 2-space indentation to every line. This makes commands un-copy-pasteable when they contain whitespace-sensitive content like JSON.
Steps to Reproduce
- Ask Claude Code to provide a shell command with JSON input
- Copy the command from the code block
- Paste into terminal
- The command fails because JSON has extra indentation/whitespace
Example
Claude outputs:
ct temporal prod workflow start --input '{"foo":"bar"}'
User copies and pastes, but it actually becomes:
ct temporal prod workflow start --input '{"foo":"bar"}'
The 2-space indent breaks the command.
Expected Behavior
Code blocks should not have any automatic indentation added. Content should be copy-pasteable exactly as written.
Impact
This affects any workflow where users need to copy-paste commands with JSON, heredocs, or other whitespace-sensitive content. It's particularly problematic for infrastructure/DevOps workflows.
Workaround
Use file-based input instead of inline JSON.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗