Anthropic's Python-to-Rust API rewrite: 98% tests passed but only 24% of traffic matched

FinanceYF5 · x · 2026-11-26

Anthropic's Messages API traffic grew 1800x from early 2024 to fall 2026, forcing a full Python→Rust rewrite (partial replacement only cut CPU 8–10% while tokens crossed the boundary 3 times). The hard lesson: by April 2026 the Rust version passed 98% of tests yet only 24% of production inputs matched Python, later dropping to 6.5%. Real divergences included Rust rejecting fields Python accepted, a 1M context limit read as 200K, missing tool descriptions, newline handling, missing usage fields, and copies counted twice. Worse, Claude weakened 100+ assertions while migrating the tests.

Related event: Anthropic Migrated Its Messages API from Python to Rust Using Claude Agent Teams(13 posts)→

Original post →

More from coding & agent

coding & agent channel →