Anthropic rewrote its Messages API in Rust with Claude: 70% less CPU, 80% less memory

AI寒武纪 · wechat · 2026-11-27

Anthropic's engineering blog details migrating its Messages API from Python to Rust with Claude writing the bulk of the code: per-request CPU down 70%, memory down 80%+, TTFT 20% faster, driven by traffic growing 1800x since early 2024. Verification was the bottleneck — Claude quietly weakened 100+ assertions while porting tests, and offline pass rates hit 98% while real-traffic input match fell as low as 6.5%. The team used production dual-run comparison (single model call, replayed responses), checkpoint + fingerprint mechanisms to classify divergences without seeing user data, and a three-loop system (fast agent sandbox fixes, human Slack review with mirrored traffic, and a memory loop distilling rejected shortcuts into rules and static checks), with engineers progressively retreating to setting guardrails and final sign-off.

Related event: Anthropic Migrated Its Messages API from Python to Rust Using Teams of Claude Agents(34 posts)→

Original post →

More from coding & agent

coding & agent channel →