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.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Developers usually bring limit questions to their admin, so it helps to know which ceiling they hit. These situations mean different things:costs see the edit
<img className="block dark:hidden" src="https://mintcdn.com/claude-ai/oY6LusJt4c576Dc3/images/claude-tag/diagrams/request-path.svg?fit=max&auto=format&n=oY6LusJt4c576Dc3&q=85&s=a7f2e0f4303072b4c8e4f3197bf0cb12" alt="Diagram showing the req…claude-tag/concepts/agent-identity see the edit
Claude Science reads optional settings from a TOML file named `config.toml` in its default data folder, which is `~/.claude-science/config.toml` on macOS and Linux and `%USERPROFILE%\.claude-science\config.toml` on Windows. Every key has a…claude-science/configuration-file-reference see the edit
* If the message asks you to convert the image, convert it to PNG, JPEG, GIF, or WebP and attach it again. Claude Code can verify dimensions for these formats from the file header, without decoding the image.errors see the edit
```text wrap theme={null}claude-tag/users/use-cases/triage-requests see the edit
Anthropic's documentation has since written up wrap, on Triage requests.