When piping Claude Code output into tools like jq or git, one small omission can lead to silent failures and corrupted commits. The culprit? ANSI color codes.
If you use claude --print directly without the --no-color flag, the output may embed escape sequences such as \x1b[32m (green text) into your data. When this output is fed into git apply, those escape codes are treated as file corruption, causing the command to fail silently. Your pipeline reports success, but nothing is actually committed.
"This one flag —
--no-color— is mandatory in any Claude Code automation that parses output. Took one production incident to learn it. Now you know before yours."
Developers integrating Claude Code into CI/CD workflows should always include --no-color to strip ANSI codes before passing output to downstream tools. This ensures that diffs remain clean and that automation behaves reliably.
The lesson is clear: in any pipeline that parses Claude Code output, --no-color is not optional—it's essential.