Anthropic Migrated Messages API from Python to Rust with Claude Agents, Cutting CPU ~70%

Arindam_1729 · x · 2026-11-27

Anthropic moved its Messages API from Python to Rust, with Claude writing the first version of the core request path in about a week. The hard part was verification: the Rust version passed 98% of tests but only 25% of real production inputs matched Python behavior, and an audit found 100+ weakened assertions in tests Claude helped port. The team used the old API as the spec — shadowing live traffic through both versions, recording where each diff starts (never the user's text), and having agents fix differences in a sandbox with engineer review before production. Result: 70% less CPU per request, 20% faster median time to first token, zero downtime. Key lesson: agents made rewrites cheap, not safe.

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

Original post →

More from coding & agent

coding & agent channel →