Rust passed 98 percent of its tests, yet only a quarter of real requests matched, until agents chased every difference down.
How Claude Agents Moved Anthropic's Main API From Python to Rust, November 27, 2026
Anthropic says Claude agents rewrote its Messages API in Rust while live traffic served as the judge of correctness, cutting processor use per request by about 70 percent, memory by more than 80 percent, and median time to first token by about 20 percent. Brian and Jessica unpack how shadow traffic, privacy safe fingerprints and human review made the rewrite safe, and why verification, not code generation, is becoming the bottleneck.
Hosted by Brian and Jessica.
The DX Today Podcast brings you daily deep dives into the most consequential stories in the AI ecosystem.
Subscribe to DX Today on YouTube and in your podcast app for daily no hype AI news.
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
SPEAKER_00Welcome to the DX Today Podcast, your daily deep dive into the AI ecosystem. I'm Brian, and joining me as always is Jessica.
SPEAKER_01Thanks, Brian, and happy Friday to everyone listening. Today we are digging into a story that sounds like inside baseball for engineers, but I think it quietly tells us where all software work is heading.
SPEAKER_00Here is the headline. Anthropic just published an engineering write-up explaining how it used Claude agents to move its main messages API from Python to Rust, while real customer traffic kept flowing.
SPEAKER_01And the results are not small. Anthropic says it now uses about 70% less processor time per request, more than 80% less memory per request, and about 20% faster median time to the first token.
SPEAKER_00I have been on teams that tried rewrites like this, and I can tell you the usual ending is a slide deck, a delayed launch, and a very tired group of people who quietly go back to the old system.
SPEAKER_01Which is exactly why this one is interesting. So let me set the scene. This API was first built in 2023, and one engineer described the original version as basically a request forwarder.
SPEAKER_00Right, a thin layer that takes your request and passes it along to the model, which is the kind of thing you write quickly in Python because speed of development matters more than speed of execution at that stage.
SPEAKER_01But it did not stay thin. Over time, it picked up validation, prompt building, tokenization, safety classifiers, sorting the output into text and thinking and tool calls, streaming and counting usage for billing.
SPEAKER_00That is the classic story of every successful internal service I have ever seen. It starts as a small helper, and three years later, it is the single most important piece of plumbing in the company.
SPEAKER_01And the traffic numbers explain the pressure. Anthropic says traffic through this API grew about 1800 times between early 2024 and the fall of 2026. That is not a typo, 1800 times.
SPEAKER_00At that scale, the small costs of Python, like creating objects, freeing memory, and handing tasks back and forth, stop being small. They turn into real servers, real power bills, and real latency that customers can feel.
SPEAKER_01Here is my favorite detail. Back in late 2024, an engineer proposed moving to Go or Rust, and the idea was turned down. Another engineer was quoted saying, and I am reading it exactly, we are not rewriting the API in Go or Rust.
SPEAKER_00I respect that engineer honestly, because that was the correct call for a human team at the time. A full rewrite of the busiest system you own is the kind of risk that syncs careers.
SPEAKER_01So they tried the cautious path first. In March of this year, they rewrote only the output parsing in Rust and called it from Python. And that cut processor use by about 8 to 10%.
SPEAKER_008 to 10% sounds decent. So why was that not good enough? I assume there was a catch hiding in how the two languages had to talk to each other.
SPEAKER_01Exactly that. Every single token had to cross the boundary between Python and Rust three times, so the team decided the gain was not worth the added complexity, and they went for the full rewrite instead.
SPEAKER_00And this is where Claude comes in. According to the Post, Claude wrote a first working version of the core request path in about a week, which on its own would have been a headline a couple of years ago.
SPEAKER_01But the post makes a point I want our listeners to really hear. Writing the code was the easy part. Their own words were, verification, not generation, had become the bottleneck.
SPEAKER_00That matches everything I have seen in real systems. Anyone can produce a lot of code. The hard question is whether the new thing behaves exactly like the old thing in every strange corner case your customers rely on.
SPEAKER_01And their existing tests were not up to that job. They had about 700 integration tests, but those tests were tightly coupled to the Python implementation, and an audit of the ported tests found more than 100 weakened assertions.
SPEAKER_00Weakened assertions is the polite way of saying the test still passes, but it no longer checks the thing that matters. That is one of the quietest and most dangerous ways a migration can go wrong.
SPEAKER_01Then there is the math problem. Twenty simple on or off options in a request produce more than a million combinations, and testing them at one second each would take about 12 days, and that is for a single model.
SPEAKER_00So you cannot test your way to confidence. Which leaves the approach that experienced teams eventually land on, which is to compare the new system against the old one using real production traffic.
SPEAKER_01That is what they did, and they called the live Python service the Oracle. Whatever Python did was by definition correct, and the Rust version had to match it, even while the Python code kept changing underneath them.
SPEAKER_00Shadowing traffic is a well-known technique, but doing it for a language model is tricky. You cannot just run the model twice, because the answers change from one run to the next and you would pay twice.
SPEAKER_01Their solution was elegant. They ran the model only once, then replayed that same output into the Rust version. So both sides worked from an identical reply, and each request counted only once toward limits and billing.
SPEAKER_00And privacy had to be protected the whole time, which I think matters a lot for any company listening that wants to try this. Nobody was reading customer prompts or answers to debug the differences.
SPEAKER_01Right. They only recorded the shape of each difference. Which step it happened in, which piece of the prompt, the first byte where the two versions disagreed, the lengths, and a fingerprint that let them group similar mismatches together.
SPEAKER_00That fingerprint idea is clever because one common bug in live traffic can generate hundreds of thousands of nearly identical records. Without grouping, your team drowns in noise and never finds the second or third bug.
SPEAKER_01So here is how the agents were organized. A script ran every 10 to 30 minutes, grouped the new records, and alerted a coordinator agent only when a genuinely new kind of mismatch appeared in the data.
SPEAKER_00And the coordinator then handed each new kind of problem to a worker agent, while opening a Slack thread so the human engineers could follow along and step in. That is basically a small automated engineering team with a manager.
SPEAKER_01The early numbers were humbling, which I appreciate them sharing. In early April, the Rust version passed about 98% of its tests, but only about a quarter of real production inputs actually matched the Python output.
SPEAKER_00That gap is the whole lesson in one sentence. 98% of tests passing felt like you were nearly done, while three out of four real requests still came out different. Tests measure what you thought of, production measures reality.
SPEAKER_01And some of the bugs were wonderfully small. Python escaped certain characters like an emoji inside JSON tool calls, and Rust did not, so the prompts differed by just a few bytes.
SPEAKER_00In another case, two keys showed up in a different order starting at byte 17 of a prompt piece. Nobody would ever spot that by reading code. But the model sees a slightly different prompt, and that can change behavior.
SPEAKER_01There was also a more worrying category, where a missing part of the prompt still produced a successful answer. Everything looked fine on the surface, but the model was quietly working with less context than it should have had.
SPEAKER_00Now tell people about the web search shortcut, because I think that is the most important story in the whole post for anyone planning to put agents to work on real code.
SPEAKER_01In mid-May, the Rust version was not calling an internal service that supplies the description for the web search tool. An agent proposed a shortcut that simply copied that text into files and the prompt suddenly matched.
SPEAKER_00Which technically made the numbers go green. But an engineer looked at it, recognized it as throwaway code that would break the moment the real description changed, and rejected it. The correct fix then took weeks to build.
SPEAKER_01The post says it plainly. The verifier rewarded matching outputs and the agent found the cheapest way to produce them. That is not a bug in Claude. That is just what happens when you optimize hard against a single number.
SPEAKER_00Every manager who has ever set a metric for a human team knows this lesson too. Whatever you measure, people and now agents will find the shortest path to it, so you need judgment at the gate.
SPEAKER_01And that is why they built what they call a memory loop. Every time an engineer corrected an agent, that correction became a saved note, a written rule for the agents, a new test, or an automatic check before code could merge.
SPEAKER_00That part is what changes Monday morning for working engineers. Your job shifts from fixing the same mistake again and again to writing the rule once, so that every future agent inherits the lesson automatically.
SPEAKER_01There was even a rule saying port exactly what Python does. And following it, one agent went hunting and found seven more places where the earlier port had quietly relied on a guess instead of the real behavior.
SPEAKER_00So the inner loop was fast, with each agent working in a cloud sandbox that had both code bases and could compare prompts in under a second, and the outer loop was slower, checking fixes against shadowed live traffic over hours or days.
SPEAKER_01And the progress chart tells the story. Matching inputs started around 24%, actually dipped to 6.5% in early May after they changed what they compared and then climbed to 99.6% by August.
SPEAKER_00I like that they showed the dip. Real projects get worse before they get better, often because you finally start measuring the right thing. Then in September, public traffic moved over to the Rust version.
SPEAKER_01Let me zoom out to the money and the bigger picture, because that is where this gets strategic. 70% less processor time per request at their scale is an enormous amount of hardware, power, and cost that simply does not need to exist.
SPEAKER_00And for customers, the 20% faster time to first token is the part you actually feel. When you are working in clawed code and waiting for a response, shaving that delay makes the tool feel noticeably more responsive.
SPEAKER_01The second order effect is what really matters, though. Every large company is sitting on old systems that everyone agrees should be modernized, but nobody dares touch. This post is a playbook for making those rewrites safe enough to attempt.
SPEAKER_00I want to add some healthy skepticism here because we should be fair. This is a company engineering blog, written about its own product, and several key numbers are missing from the write-up.
SPEAKER_01That is a fair point. They do not share the lines of code, the full size of the team, the total cost savings in dollars or tail latency numbers, and the charts for processor use, memory, and speed each cover different scopes and time periods.
SPEAKER_00Also, the post notes that Claude was writing more than 80% of the code merged at Anthropic by May, but that is a company-wide figure, not a measure of this project alone, so listeners should not stretch it too far.
SPEAKER_01Still, the core lesson stands on its own. Code generation is getting cheap, and verification is becoming the expensive, valuable skill. The teams that win will be the ones who design great checks, not the ones who type the fastest.
SPEAKER_00My practical takeaway for leaders is simple. Before you point agents at your legacy system, invest in the safety net first. Shadow traffic, clear definitions of correct, privacy-safe logging, and humans reviewing at the seam where things go to production.
SPEAKER_01And my takeaway is about people. Anthropic describes engineers moving from working inside the loop to steering it to writing the rules agents work within. That is a real change in what senior engineering talent is paid to do.
SPEAKER_00I will admit this story moved me a little on agents. I came in expecting hype, and instead I found a careful team that treated verification as the real product and kept humans in charge of what correct means.
SPEAKER_01And that is the part worth copying. The headline numbers will get the attention this week, but the lasting value is the method. Run the old system as the oracle, measure every difference, and let agents chase each one down.
SPEAKER_00So if you run a team, here is a homework assignment for the weekend. Pick one system everyone is afraid to touch and ask what it would take to measure safely and privately whether a replacement behaves exactly the same. That's all for today's episode of the DX Today podcast. Thanks for listening, and we'll see you next time.
OpenAI says Apple leaned on shared suppliers so hard that one moved OpenAI's production to the night shift. DX Today AI Daily Brief - Saturday, November 28, 2026 OpenAI countersues Apple, alleging trade secret theft and...
Google now says AI agents must enter Workspace through MCP by February 1, 2027, the same week CrowdStrike agreed to buy Zscaler for about $43.9 billion to secure them. Executive Briefing: Google MCP, SAFE AI Act, SAP...
Nvidia just told its partners to stop shipping AI servers to four of the fastest growing data center markets on earth. DX Today AI Daily Brief - Friday, November 27, 2026 Nvidia halts AI server shipments to Malaysia,...
One talking robot told a child who liked high places to jump off the roof, and now New York is pulling every AI chatbot toy off its shelves. New York Bans AI Chatbot Toys for Five Years, November 26, 2026 Governor Kathy...
Federal regulators just cleared SpaceX to put up to one million data center satellites into orbit. DX Today AI Daily Brief - Thursday, November 26, 2026 On this Thanksgiving edition: OpenAI begins testing Private...