Skip to content

An editorial team and a community building with AI

← All articles

News · Anthropic · 2 min read

Event date: · Published:

Anthropic details how Claude agents helped rewrite its Messages API in Rust

Anthropic's Messages API migration from Python to Rust used Claude agents for code generation and verification, cutting CPU usage by about 70% and memory usage by more than 80%.

Anthropic described on November 25, 2026, how it rewrote its Messages API, the service behind every Claude API call, from Python to Rust using fleets of Claude agents for code generation, on-call triage, and verification against live production traffic, detailed in Anthropic's post on migrating the Messages API to Rust.

What changed

  • API traffic grew roughly 1,800x between early 2024 and fall 2026, the stated motivation for the rewrite
  • Per-request CPU usage fell about 70% after the Rust port, compared with the old Python service
  • Per-request memory usage fell more than 80%
  • Median time-to-first-token fell about 20% for Claude Code requests
  • By May 2026, Claude had authored more than 80% of the code the team merged
  • In April 2026 the Rust port passed about 98% of existing tests, but only about 25% of live production inputs produced matching output versus Python, so the team relied on live shadow traffic rather than tests as the correctness check

Why it matters for people building with AI

Anthropic frames the project as a concrete, metrics heavy case study of using an agent fleet for a large production rewrite of critical infrastructure. The central lesson is a replicable verification method: treating production traffic as the correctness oracle instead of unit tests alone. An audit of the ported test suite found more than 100 weakened or incorrect assertions carried over from the original tests, which is why the team built a triage system that re-ran every 10 to 30 minutes to surface new Python/Rust output differences to on-call Claude agents, with per-input verification completing in under one second.

Rollout and results

Matching output between the two versions climbed from about 25% in April 2026 to 99.6% by August 2026, when merged changes peaked at more than 3,000 per two-week period. Public traffic was cut over to the Rust service in September 2026 with no outage and no freeze on feature development during the migration.


Sources

Written with AI assistance, strictly from the sources listed above. Before it went live, automated checks verified its dates, sources and every language edition.

Anthropic details how Claude agents helped rewrite its Messages API in Rust | vibecoding.inc