Source Intelligence

DisclaimerUnofficial, and not affiliated with Anthropic. Nearly all of this is read straight out of what ships: npm bundles, captured prompts, published docs. Anthropic's own notes go in verbatim, marked as theirs. The rest is my reading, and every entry carries the strings behind it. If one looks wrong, vote it down and say why.

All of v2.1.228 Home All releases olderv2.1.227 v2.1.229newer
Claude Code v2.1.228

SDK client gains fetch middleware and wider streaming event coverage

Under the hood
Useful2 Signal2
SDK

The bundled API client can wrap network calls and understands more streaming event types.

What

The bundled API client can now wrap its own network calls in middleware, and its streaming event filter passes through many more event types. Middleware that reads the response body is rejected with an error telling you to clone it or return a replacement.

Details
  • Middleware runs around fetch and receives a parse context.
  • The rejection message is exact: middleware must use response.clone() to inspect the body, or return new Response(body, response) to consume and replace it.
  • Newly forwarded streaming events include session.updated, outcome-evaluation spans, agent thread messages, session thread status transitions, event_start/event_delta and system.message.
  • New client namespaces: deployments, deployment runs, webhooks, dreams and tunnels.
Evidence

middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it

Strings lifted out of the shipped bundle, so the claim above can be checked against them.

See this entry in the whole of v2.1.228 →