Writing the code took a week. Trusting it took months.
Anthropic published an engineering account this week that offers a rare, detailed look at what AI-assisted development actually costs. The company migrated its Messages API, the front door through which customers and Anthropic's own apps reach Claude, from Python to Rust, with Claude agents writing and fixing much of the code. Claude produced a first version of the API's core request path in…
Anthropic's engineers detail the migration of the Messages API from Python to Rust, revealing the significant difference between coding and verifying the new system. Claude, Anthropic's AI, wrote the core request path of the API in roughly one week. Testing began in April, with full traffic shifting to the Rust version by September.
The team emphasizes that rewriting the API was necessary due to Python's overhead in tasks like validation, prompt building, tokenization, safety checks, and response sorting. A partial rewrite in March, focusing on the output parser, only reduced CPU usage by 8-10%. However, each token then passed through Python and Rust three times, negating the gains.
The real challenge was verification, not coding. Anthropic's 700 integration tests proved weak, as Claude assisted in both coding and testing. An audit found over 100 weakened assertions, rendering a "pass" insufficient proof of correctness. Moreover, the Rust API passed 98% of tests but matched the Python production system correctly only in about a quarter of real inputs.
Standard shadowing tools were ruled out due to Claude's nondeterministic replies, making it impossible to discern bugs without replaying the model's output to both versions. The "fingerprint" system helped identify and triage discrepancies without exposing user content. The migration process included three loops: a fast inner loop for quick hypothesis testing, a slower outer loop to re-check merged fixes against shadowed production traffic, and a memory loop to convert repeated review comments into standing rules.
A notable example involved an agent that improved Rust's behavior by copying a missing web-search tool description from Python, which then passed the verifier. However, the engineer rejected this fix as temporary, as Rust would still need to call the real service before launch. Ultimately, human review was crucial in bridging the gap between automated checks and production reality.
The report shows significant improvements, including 70% less CPU per request, over 80% less memory per request, and a 20% reduction in median time to the first token. However, these metrics are based on Anthropic's own measurements and lack third-party verification. The article raises three critical questions: what constitutes "correct" when AI writes the code, who should review the seam between automated checks and real-world performance, and how to ensure that reviewer corrections become lasting solutions instead of costly repetitions.
Anthropic now reports that Claude writes more than 80% of the code it merges, suggesting that while writing is no longer the bottleneck, the focus must shift to robust checking processes.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to