AI RadarWe read first, then explain what changed
Editorial Briefs

Anthropic Let Claude Rewrite Its Core Messages API From Python to Rust With Zero Downtime, Cutting CPU 70% and Memory 80%

Published Last updated AI Radar editorsSources for facts; limits on conclusions
About 6 min read

In this article4
AI editorial gouache illustration: Inside a soaring engineering hall, a roaring blue live traffic pipeline flows nonstop while warm amber clockwork robots swap tangled emerald-green pipes underneath for sleek burnished copper-orange conduits monitored by a brass split-screen oscilloscope displaying two matching golden waveforms
AI Radar editorial visual (AI-generated): Anthropic detailed how Claude helped migrate its live Messages API from Python to Rust with zero downtime, cutting CPU per request by ~70%, memory by >80%, and median time to first token by ~20%.
Bottom line

Anthropic's migration postmortem crystallizes the new software engineering bottleneck: writing code is cheap, while building an independent production oracle (traffic shadowing plus behavioral fingerprints) is the real moat. Teams planning AI-assisted backend rewrites should build their verifier before letting agents rewrite code and tests together.

Back in 2024, when an Anthropic engineer suggested migrating the company's core API out of Python into Go or Rust, a colleague shut the idea down flat: "We are not rewriting the API in go or rust!"

Two years later, Anthropic has not only moved its high-volume Messages API completely over to Rust, it let Claude write the first version of the core request path itself.

On November 25, 2026, Anthropic's engineering team published a detailed postmortem titled Migrating our Messages API to Rust (also covered by InfoWorld). The entire migration shipped with zero downtime and zero feature freeze, delivering production gains every backend team dreams about: roughly 70% less CPU per request, more than 80% less memory, and about a 20% drop in median time to first token (TTFT).

Yet the real lesson in Anthropic's writeup is not how fast AI writes Rust. It is a blunt shift in software engineering economics: when Claude can rewrite a core service in about a week, writing code stops being the bottleneck, and proving the new system matches live production behavior becomes the entire game.

Traffic Grew 1,800x, and Why a Partial Rust Rewrite Backfired

Launched in 2023 in Python, the Messages API is the front door through which external customers and Anthropic's own apps (including Claude Code and Cowork) talk to Claude. Early on, one engineer joked it was "basically a request forwarder."

Between early 2024 and fall 2026, however, daily API traffic exploded roughly 1,800 times. By late 2025, every single request had to be validated, assembled into prompts, tokenized, and screened by safety classifiers, while incoming token streams were split into plain text, thinking blocks, and tool calls. Python's object allocations, garbage collection, and scheduling overhead taxed every single step.

Following conventional engineering wisdom, Anthropic tried an incremental rewrite first. In March 2026, engineers ported just the model output parser to Rust and called it from Python. CPU usage dropped only 8% to 10%, while complexity spiked because every single token now crossed the boundary between Python and Rust three times, introducing fresh serialization overhead.

What overturned the 2024 ban on a full rewrite was Claude's own coding leap. Anthropic revealed that by May 2026, Claude was writing more than 80% of all code Anthropic merged. Once the team greenlit a full port, Claude wrote a working first version of the Rust core request path in roughly one week.

The Real Five-Month Sprint: Turning Live Python Production Into an Oracle

If Claude drafted the core path in a week, why did public traffic not finish cutting over until September 2026? Because live production migrations invert the classic generator-verifier gap:

  • Existing tests could not be trusted: Legacy integration tests ran the Python API in-process with Python-mocked billing and rate limits. Moving to Rust forced engineers and Claude to rewrite both the service and the tests simultaneously, making a green test suite impossible to trust on its own.
  • LLM outputs are nondeterministic and customer payloads are private: Running the same prompt twice naturally yields different completions, and privacy rules meant engineers could not read raw customer prompts to inspect discrepancies manually.

Anthropic's solution was to turn the live Python Messages API itself into a runtime verifier (oracle) powering a three-layer autonomous feedback loop:

  1. Production traffic shadowing: Without double-charging customers or double-counting rate limits, Anthropic shadowed live traffic into the Rust build and compared structured checkpoints and error fingerprints rather than raw prompt text. Input parity started at 24% in late April, dipped to 6.5% in early May, and climbed steadily to 99.6% by August as fixes landed.
  2. Inner and outer agent repair loops: In the fast inner loop, Claude agents tested hypotheses inside local sandboxes within seconds and posted proposed fixes with evidence directly into Slack threads for human review. In the slower outer loop, agents monitored shadowed production traffic to verify whether a bug's fingerprint vanished on builds carrying the fix.
  3. Plain-prose memory as the outermost loop: Whenever human engineers caught subtle edge cases during code reviews, those corrections were written down as plain-prose rules stored in shared memory so every subsequent repair agent could read them before touching related code. Powered by these three nested verification loops, biweekly merged code changes on the Rust API branch climbed from under 100 in spring to roughly 1,000 by late June, then surged past 3,000 changes per two-week period in mid-August before public production traffic cut over cleanly to Rust in September without a single minute of downtime.

What Is Confirmed, and What Deserves Caution

As soon as Anthropic published its engineering postmortem, social media commentators jumped straight to declaring the end of human systems engineers, yet the actual writeup draws far more disciplined technical boundaries:

  • Confirmed facts: Anthropic published official metrics on November 25 showing Messages API traffic grew roughly 1,800x from early 2024 to fall 2026; Claude wrote over 80% of Anthropic's merged code by May 2026; the Python-to-Rust migration cut CPU per request by ~70%, memory by >80%, and median TTFT on Claude Code requests by ~20% with zero downtime.
  • Editorial judgment: This is the clearest public blueprint yet for AI-driven migrations of mission-critical backend infrastructure. It challenges two decades of conventional wisdom against full language rewrites, while highlighting the new premium engineering skill: architects who can build rock-solid automated verifiers, shadow harnesses, and behavioral fingerprints now multiply an AI coding fleet far more than engineers writing boilerplate by hand.
  • Still unknown: Anthropic did not disclose the internal compute bill burned across five months of traffic shadowing and thousands of agent fix cycles, nor how economically smaller engineering organizations without hyperscale observability tooling can replicate this three-loop verification harness.

Three Concrete Lessons for Engineering Teams and CTOs

If your team maintains a sluggish legacy Python, Ruby, or Node service you have been afraid to touch, Anthropic's playbook offers three immediately usable ideas:

  1. Beware half-measures across language boundaries: Porting one hot helper into Rust behind a Python wrapper can erase most of the gain through repeated FFI crossings. When overhead spans validation, streaming, and serialization, evaluate a clean stateless gateway rewrite instead.
  2. Build the independent oracle before unleashing coding agents: Never let an AI rewrite both production code and its own test suite without an external source of truth. Even small teams can replay scrubbed production request logs or contract fixtures against both builds before shifting traffic.
  3. Turn every code-review correction into persistent agent rules: Anthropic's outermost loop is essentially living engineering guidelines (much like maintaining a crisp AGENTS.md). Recording every subtle edge case in plain prose prevents subsequent agent loops from burning tokens on identical regressions.