Damaged streamed replies now fail with an error, with an environment variable to turn the check off
Claude Code now checks streamed replies for corruption and stops with 'Reply damaged in transit'; CLAUDE_CODE_DISABLE_STREAM_DAMAGE_CHECK turns the check off
You'll noticeTier: how much it should matter to you
4Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
API StreamingArea: what it touches
ImprovementsKind: in v2.1.337,
What probably matters to youSection of the release
What
Claude's replies arrive as a stream of small pieces called SSE frames. Claude Code now checks those frames for signs of corruption. It treats a frame as damaged when it finds:
NUL or U+FFFD characters in field names
event names wrapped in quotes
events with no name
event names one letter off from a real one
pings joined together
data whose type differs from the event it arrived under
When this happens, Claude Code stops with the message 'Reply damaged in transit. Try again. (--debug for details)'. It also logs a warning that the stream failed as damaged.
Setting the environment variable CLAUDE_CODE_DISABLE_STREAM_DAMAGE_CHECK to 1, true, yes or on turns the check off. This variable did not exist before. The warning itself points out the risk: with the check off, a tool could run on incomplete input. Before this change, malformed frames were parsed or passed through.
Why
A reply garbled in transit now stops with a clear error instead of producing broken output, or a tool run on partial instructions. If the check gets in your way, you can turn it off, at the cost of that protection. Running with --debug (Claude Code's debug mode) shows more detail.