@readmodelmag
MODEL

AI News

Anthropic moved its Messages API from Python to Rust, with Claude agents checking the work

SummaryAnthropic says the Rust version uses about 70% less CPU per request and cut median time to first token by about 20%, with no downtime. The numbers are Anthropic's own. Not tested by MODEL.

· MODEL Editors · 2 min read

Some links may be affiliate links. Disclosure

MODEL news card on a cream background. Small red kicker: RUST MIGRATION / ANTHROPIC. Large red text: -70% CPU. Black headline: Messages API moved from Python to Rust. Bottom left: MODEL. Bottom right: Sources: Anthropic engineering blog, Nov 25 2026.
Anthropic described the migration on its engineering blog on Nov. 25, 2026. Not tested by MODEL. Illustration by MODEL. Original. Image source.

What happened. Anthropic has moved its Messages API, the main way customers and its own apps such as Claude Code reach Claude, from Python to Rust. In an engineering post (opens in a new tab) published Nov. 25, the company says public traffic moved to Rust in September 2026, without taking the service offline or freezing feature work.

Why bother. Anthropic says API traffic grew roughly 1,800 times from early 2024 to fall 2026, and Python added overhead at every step of a request: validating it, building the prompt, safety screening, then sorting the streamed reply into text, thinking and tool calls. An earlier partial rewrite of just the output parser cut CPU use by about 8% to 10%, but each token then crossed between Python and Rust three times, so the team went for a full rewrite.

The results, per Anthropic. The Rust API uses about 70% less CPU per request and cut median time to first token by about 20%. The time-to-first-token figure was measured on customers' Claude Code requests over a shorter period.

Writing it was the easy part. Claude wrote a first version of the core request path in about a week. Proving it behaved like the old service took months. In April the Rust version passed about 98% of the roughly 700 integration tests, yet only about a quarter of inputs matched Python on real production traffic. One example: Python escaped some characters, like emoji, in JSON tool calls, while Rust wrote them as is.

How they checked it. Anthropic ran production requests through both versions ("shadowing"), ran the model once and replayed its output to Rust so Claude's varying replies didn't count as bugs, and made sure no request counted twice toward a customer's limits or bill. Because the team couldn't read customer requests, it logged only the "shape" of each difference: which step, which part of the prompt, where the bytes first differed. A coordinating Claude agent handed each new kind of difference to a worker agent, which tried to reproduce it in a sandbox, fixed the Rust code and added a test.

Humans still had the final say. Fixes went through PR review before reaching shadowed production traffic. In one case an agent made prompts match by copying the web search tool's description into a file. An engineer rejected it as throwaway code, and the real fix took weeks.

Who it's for. Teams weighing a big rewrite of a live service with AI agents. The useful part is the method: use the old system as the judge, compare step by step, and keep a human gate on fixes. There's nothing new to install, and Anthropic doesn't say API users need to change anything.

The catch. All the figures are Anthropic's own internal measurements, with no outside benchmark, and the post says verification, not code generation, was the bottleneck. Its setup (shadowed production traffic, sandboxes, a fleet of agents) is far more than most teams have.

Not tested by MODEL. Not sponsored. No affiliate links.

Get three tested tools every Friday

Free, weekly. Unsubscribe anytime.

Sources

  1. Migrating our Messages API to Rust

    Anthropic (Nov. 25, 2026)

  2. Anthropic: We recently migrated our Messages API from Python to Rust

    X

FREE · EVERY WEEK

The top AI tools this week, tested.

Every week MODEL's editors pick the AI tools worth your time, try them hands-on, and tell you what's good, what's not, and who it's for. Free, in your inbox.

Free. Unsubscribe anytime. Our picks are editorial and can't be bought.