Code blocks have automatic indentation making commands un-copy-pasteable

Resolved 💬 3 comments Opened May 15, 2026 by idahood Closed May 19, 2026

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

  1. Ask Claude Code to provide a shell command with JSON input
  2. Copy the command from the code block
  3. Paste into terminal
  4. 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.

View original on GitHub ↗

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