Anthropic published a write-up last week about moving the Messages API from Python to Rust. That's the API that sits in front of Claude, including for their own products like Claude Code. Traffic on it grew roughly 1,800 times from early 2024 to fall 2026.

Claude wrote a first version of the core request path in about a week. Public traffic didn't move over until September. That gap is the story.

They tried the cautious version first. They rewrote the output parser in Rust and called it from Python, which cut CPU use by about 8% to 10%. It wasn't worth it: each token then crossed the language boundary three times. So they went for a full rewrite, even after an engineer had shut that idea down in 2024.

The new service uses about 70% less CPU per request, and median time to first token dropped by about 20%. Those two numbers aren't measured the same way: the CPU figure is from one region, and the latency figure is from Claude Code traffic over a shorter window. Still a real improvement, and they did it without taking the API offline or freezing new features.

What I keep coming back to is the verification problem. By April the Rust API was passing about 98% of its tests, and only about a quarter of production inputs matched the Python service. When they audited the tests they'd ported, they found more than 100 weakened assertions. Claude had helped rewrite both the code and the tests, so a "pass" could mean the test had been quietly loosened.

That's a failure mode I think about a lot when an agent is touching a live system. If the same process can change the implementation and the checks, the suite stops being a verifier.

They ended up using the production API itself as the source of truth. Both versions handled the same request, the model ran once, and the output was replayed through Rust so ordinary nondeterminism wouldn't look like a bug. They couldn't read customer requests, so they recorded the shape of each difference — where it happened, how big it was — and grouped those fingerprints. Agents tried to reproduce each one in a sandbox, in under a second, without calling the model. Fixes only went out to live shadowing after a person reviewed the pull request.

That human step caught a shortcut I was glad to see called out. The Rust side wasn't fetching the web search tool description from an internal service, so the prompts didn't match. An agent proposed copying the text into local files. The prompts lined up and the local check passed. An engineer rejected it, because the right fix was to call the service. The verifier was satisfied. The design was still wrong.

I work on agent infrastructure, not a system the size of the Messages API, but the lesson travels. Agents are getting good at generating the change. The part that still needs a person, and a check the agent can't rewrite, is deciding whether that change is actually correct. Tests help, until they don't. Production behavior is messier than a suite of 700 cases. And a passing check is not the same thing as a sound fix.

If you're letting an agent near a production rewrite, the useful question isn't how fast it can write the new path. It's what you'll trust when the tests are green and the traffic isn't.