[BUG] Markdown output does not display correctly due to leading whitespace

Resolved 💬 4 comments Opened Dec 24, 2025 by nazmulidris Closed Feb 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code adds a 2 space padding on each row of output that it dumps to stdout in a prompt response. Here's a screenshot:

<img width="2842" height="970" alt="Image" src="https://github.com/user-attachments/assets/9dd382f3-46a8-45c4-9243-ea5c34072674" />

What Should Happen?

Account for the leading whitespace per line, and reduce the term width by that amount to determine what the max display width of each line should be, before writing it to stdout.

Or simply just remove this leading whitespace. It adds NO value. It hinders copy/paste, breaks markdown tables. I don't see how this makes the output "visually appealing".

Error Messages/Logs

Steps to Reproduce

  1. Open claude code
  2. Ask it to generate wide markdown tables
  3. See the wrapping break due to the leading whitespace (that's not accounted for in the term width, which is now reduced by the leading pointless whitespace)

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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