TECH

Anthropic moves its Claude Messages API from Python to Rust, cutting CPU use about 70%

AI-generated illustration of a glowing orange gear core inside a vast transparent glass machine, with a smaller blue gear sliding out to the side and streams of light flowing through.
This image is an AI-generated illustration created for this story; it is not official artwork, a screenshot, or a photo.

What happened

Anthropic says it 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 blog post published on Wednesday, November 25, the company explains that Claude wrote a first version of the new Rust request path in about a week. The hard part was proving the new version behaved exactly like the old one. Anthropic says the finished Rust API uses about 70% less CPU per request and cuts median time to first token by about 20%, and that it shipped without taking the service offline or freezing feature work. The Next Web also reports the new API uses more than 80% less memory.

Background

Anthropic built the Messages API in Python in 2023, when one engineer described it as "basically a request forwarder." Since then every request has to be validated, turned into a prompt, tokenized and screened by safety classifiers, and Anthropic says API traffic grew roughly 1,800 times from early 2024 to fall 2026. A first attempt that rewrote only the output parser in Rust saved just 8% to 10% of CPU and added complexity. About 700 existing integration tests were not enough on their own: when the team audited ported tests, it found more than 100 weakened checks. In April the Rust version passed about 98% of tests, yet only about a quarter of real production inputs matched. So Anthropic turned the live Python API into the judge, comparing both versions on production traffic and automatically sending Claude agents to find and fix each difference. Public traffic moved to Rust in September 2026.

Why it matters

Big rewrites of live systems are usually avoided because they are slow and risky. Anthropic's argument is that AI agents have made writing code cheap, so the real bottleneck is now verification: checking that new code is correct. The company says that by May 2026 Claude was writing more than 80% of the code it merged.

Our take

The speed numbers are impressive, but the honest part is the most useful: tests that looked great in April missed most real-world behavior. For any team tempted to let AI rewrite production code, the lesson is clear. Build a strong way to check the work first, then let the agents run.

Read our editorial policy. Corrections or tips? Tell us.

Follow @ShadowNewsHQ

Breaking news, official trailers and the daily 9 PM ET recap, straight in your feed on X.

Follow on X

Like this page? Follow us on X and share it with a friend.

Follow @ShadowNewsHQ