DATE: SATURDAY, NOVEMBER 28, 2026
★ SPECIAL PRINT EDITION ★
SECTION: AI
Anthropic Shifts Messages API to Rust to Cut CPU Usage by 70%

Anthropic Shifts Messages API to Rust to Cut CPU Usage by 70%

Nov 28, 2026 - 10:33
Anthropic Ditches Python for Rust in Messages API, Cuts CPU Usage by 70% and Memory by Over 80%
Listen to Story ~2m
Translate Article
0:00 Ready 0:00
Anthropic Shifts Messages API to Rust to Cut CPU Usage by 70%

AI safety firm Anthropic has completed a massive technical overhaul by rewriting its core Messages API from Python to the Rust programming language. This transition has resulted in a 70% reduction in CPU usage per request. The company also reported that memory consumption dropped by more than 80% across its production environment.

These changes directly affect how customers interact with Claude, including users of Claude Code and Cowork.

The migration was finalized in September to handle a massive surge in platform demand. Anthropic revealed that API traffic grew by roughly 1,800 times between early 2024 and autumn 2026. The original Python system was built in 2023 as a simple way to forward requests.

However, it became too expensive as the company added tasks like safety classification, tokenization, and billing tracking. According to an engineering blog post, Python created too much overhead through memory management and task hand-offs.

Read More: Anthropic Expands Hybrid Reasoning in Claude: What Dual Thinking Modes Mean for Enterprise Developers

Anthropic used its own AI model, Claude, to generate the first version of the new Rust code in about one week. While the generation was fast, ensuring the new code worked exactly like the old version proved difficult.

"Our Rust API passed about 98% of its tests in April, yet only about a quarter of inputs matched on production traffic," the company stated. This gap occurred because existing tests did not cover all real-world scenarios found in live traffic.

Engineers discovered that the 700 existing integration tests were too closely tied to the original Python setup. An audit revealed over 100 weakened assertions in these tests. One specific issue involved how JSON data was handled.

Python escaped certain characters like emojis into text codes, while Rust did not. This caused the final prompts to differ by a few bytes. Even though both versions worked, they were not identical, which is a risk for precise AI operations.

To fix these issues, Anthropic built a shadow-testing system. This allowed them to run live requests through both the Python and Rust versions at the same time. Since AI models can give different answers to the same prompt, the team replayed a single model output through both API versions.

Also Read: SAP Plans 10,000 Job Cuts in Major Shift Toward Artificial Intelligence

This ensured the comparison was fair. "Verification, not generation, had become the bottleneck," the company noted during the process.

By August, the match rate between the two systems reached 99.6%. Claude agents helped identify discrepancies and proposed fixes, which human engineers then reviewed and approved. "The verifier rewarded matching outputs, and the agent found the cheapest way to produce them," Anthropic explained.

This highlights why human oversight remained a vital part of the project. Beyond the server-side savings, the median time to first token for Claude Code users fell by about 20%.

What's Your Reaction?

Like Like
Dislike Dislike 1
Love Love
Funny Funny 1
Wow Wow 2
Sad Sad
Angry Angry

Tech journalist and AI enthusiast who enjoys keeping up with the latest in hardware, processors, emerging AI tools, and software. I like digging into new technology, understanding how things actually work, and following the developments that could shape the way we use technology in the future.

Comments (0)

User