Large integer precision error in Bash command output rendering (github.com)

🤖 AI Summary
Claude Code v2.0.37 (Sonnet 4.5 / Claude Max on macOS) was found to display an incorrect integer: running echo '348555896224571969' (or echo '{"value": 348555896224571969}' | jq -c .value) shows 348555896224571970 in the Claude Code output pane, while a native terminal prints the correct 348555896224571969. The discrepancy is deterministic (off by one) and reproducible, confirming the UI is altering the displayed numeric value even though the command itself produced the correct bytes. This is significant because it undermines trust in in-editor shells and JSON handling—especially for large integers well beyond JavaScript/IEEE‑754 safe-integer range (2^53), where incorrect display or inadvertent conversion to a floating-point format can introduce subtle bugs. The behavior suggests Claude Code’s output pipeline or renderer is serializing/parsing numbers with limited precision (or otherwise mutating output) rather than preserving raw text. Developers should avoid relying on Claude Code’s displayed numeric outputs for critical data, quote large integers as strings, and verify with a native terminal or checksum. The issue warrants a prompt fix from Anthropic to preserve fidelity of CLI/JSON outputs and prevent data corruption in debugging and automation workflows.
Loading comments...
loading comments...