Follow Discord
Sweep 22 Sep 2026 · 17:19Z Build v2.1.280 501 read Stable v2.1.267 Latest v2.1.280 Next v2.1.280 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.265 ·

Code blocks can now render as unified diffs

A new diff format for code blocks parses and validates unified-diff/patch text before displaying it

TierUnder the hoodhow much it should matter to you
Useful2my rating, 1 to 5
Signal1worth watching, 1 to 5
AreaElsewherewhat it touches
KindInternal Changesin v2.1.265,
Group of 2 Under the hood

A new diff format for code blocks parses and validates unified-diff/patch text before displaying it

What

A new self-contained unified-diff parser reads Index:/diff/---/+++/@@ headers and hunks into structured objects, validating that the added/removed line counts match what the hunk header claims.

The Code component gained a new format value, "diff", alongside the existing "source" format. When set, the text is validated and parsed through this new parser, and anything with a malformed @@ -a,b +c,d @@ header (missing, non-numeric, or out-of-bound numbers) is rejected with a specific error such as "no @@ hunk header found" or "header is not @@ -a,b +c,d @@ within N lines". A companion wrap prop accepts "wrap" or "truncate-end" to control how long diff lines are displayed.

Why

This lets diff/patch text be rendered as a properly parsed, validated diff view instead of plain text, catching malformed diffs before they're displayed.

See this entry in the whole of v2.1.265 →

Feedback