the emoji example is a detail i might have dismissed too quickly. Python escaped some characters when writing JSON tool calls; Rust kept them as literal characters. the data could mean the same thing while the text sent to the model differed. that makes checking whether both versions produce equivalent JSON only part of the job. once that JSON becomes part of a prompt, the exact text matters too. a request can still succeed while the model receives slightly different input. for a migration like this, i’d preserve the existing formatting first and consider tidying it up separately. otherwise you’re changing the implementation and experimenting with the prompt at the same time, which makes any change in behavior harder to explain.
messages api rust migration
the decision notes were the detail that caught my attention. an engineer rejected the workaround that copied tool descriptions into files, and the team recorded why it was rejected and what the proper fix required. later agents used that note to recognise the same unresolved problem instead of building another workaround. Anthropic’s write-up that seems useful even on a small project. “we tried this, rejected it for this reason, and we’re waiting on this other change” is valuable information to hand over. the code alone won’t necessarily tell the next agent any of that. with several agents working at once, i’d want those decisions somewhere they all check. having to explain the same rejection in five separate conversations would eat into the time they’re supposed to save.
Have you used coding agents to port or rewrite a live system, and how did you decide the new version was correct? Did tests alone give you enough confidence, or did you compare against the old system's real behavior?
For people building on Claude, the takeaway is mostly about method. Anthropic argues that when Claude writes code easily, verifying it becomes the bottleneck, and that a running production system can act as a checker. Its advice is to keep loops simple, let agents choose how to reproduce and fix bugs, and keep humans for judgment calls such as whether a difference is a bug or a deliberate change. The figures come from Anthropic's own systems, and the CPU chart covers one region, so results elsewhere may differ.
The interesting part is the verification. Anthropic says tests were not enough: its ported Rust tests were coupled to Python, with more than 100 weakened assertions found in an audit. The Rust API passed about 98% of tests in April, yet only about a quarter of inputs matched on production traffic. So the live Python API served as the reference. The model ran once and its output was replayed to Rust. Differences were recorded as fingerprints without reading customer text, and agents fixed them in loops. Input matches reached 99.6%. According to Anthropic, a partial rewrite of only the output parser saved just 8% to 10% CPU. A human engineer also rejected one agent shortcut that matched outputs but was throwaway code.
Anthropic moved its Messages API, the main way customers and its own apps such as Claude Code and Cowork reach Claude, from Python to Rust. In its engineering post of Nov 25, 2026, the company says the Rust version uses about 70% less CPU per request and cuts median time to first token by about 20%. Memory per request fell by more than 80% in its chart. The service never went offline and feature development was not frozen. Claude wrote a first version of the core request path in about a week, and public traffic moved to Rust in September 2026. source: https://www.anthropic.com/research/migrating-api-to-rust
