Katelyn Lesse, director of platform engineering at Anthropic Claude, revealed on the podcast "The Pragmatic Engineer" that the company spent about five or six months rewriting the Messages API, the main entry point for customers to call Claude, from Python to Rust. About 80% of engineers do not read the PR issued by the agent carefully, and instead use formal traffic comparison to verify it. An official statement issued on the same day pointed out that the new version uses about 70% less CPU per request. (Preliminary summary: Claude Ship goes online: routine program modifications, Claude can press "Approval" by himself) (Background supplement: Anthropic supervisor stopped the program interview: In the AI era, performance and taste trump seniority) Key summary Anthropic rewrote the Messages API from Python to Rust in about five or six months. Lesse estimates that about 80% of the PRs opened by the agent, engineers did not read line by line. The Rust version uses about 70% less per request. CPU, the first word response is about 20% faster. Katelyn Lesse, Anthropic platform engineering director responsible for Claude API, appeared on the podcast "The Pragmatic Engineer" hosted by Gergely Orosz on November 25. She said that a small team relied on Claude to write programs and spent about five or six months rewriting the Messages API from the Python monolithic architecture to Rust. She estimates that about 80% of PRs issued by agents are not read line by line by engineers. PR (pull request) is an application from engineers to submit the modified code for review and merge it into the main program. The Messages API is the main entrance for customers to call Claude from their own products such as Claude Code. Each request must be verified, converted into prompt words, cut into tokens, and then screened by a security classifier. The content returned by the model must also be divided into text, thoughts and tool calls, and finally included in usage and billing. An engineering article published by Anthropic on the same day said that the Rust version uses about 70% less CPU per request, and the median time for the first word return is also shortened by about 20%. The service was not offline during the entire migration process, and new features were launched as usual. Engineers only looked at 20% in depth. According to the program, this API was established in 2023. At that time, Anthropic researchers mostly used Python, and the API was written in Python. The official article mentioned that from the beginning of 2024 to the fall of 2026, API traffic will grow approximately 1,800 times. Lesse also mentioned that there is a global shortage of CPUs, and it is not easy to rely on adding more machines to support traffic. The team first tried to change only the program that analyzes the model output to Rust, and the CPU usage dropped by 8% to 10%. However, each token had to go back and forth between Python and Rust three times, and the added complexity was not cost-effective, so we finally decided to rewrite the entire thing. There are no Rust experts on the team, and a year ago we chose Go, which engineers can understand, when developing new services. According to the official article, Claude wrote the first version of the core request path in about a week. Lesse said on the show: "As long as you can dismantle something to the point where it can be verified, you don't have to read every line of Rust code." She estimates that about 80% of the PRs opened by agents, the engineers did not read the entire code carefully. The remaining 20% ​​was the problem, and engineers went into details to find the cause. The company also has an internal review classifier that determines for each PR whether it should be viewed by others, how many people should be viewed, and which team it should be sent to. The Claude Ship beta version launched by Anthropic on November 23 also allows external teams to write rules and submit them to Claude for PR approval. Compare the two versions with formal traffic. Verification relies on shadowing, that is, sending the same formal request to the two versions of Python and Rust, and gradually comparing the results. Claude may respond differently to the same request. The team only calls the model once and replays the same output to the Rust version. In order to protect privacy, the system does not read the request content, but only records which step the difference occurs and how many bytes the difference occurs. The official article stated that the Rust version passed about 98% of the tests in April, but only about a quarter of the inputs in the official traffic were exactly the same. There were originally about 700 integration tests. When auditing the transplanted tests, the team also found more than 100 loosened inspection conditions. This approach can be established only if the old Python API has been running online and can be used as a benchmark. Every time a new discrepancy occurs, the Claude agent responsible for coordination assigns a working agent to fix it, and opens a discussion thread in Slack for engineers to follow up. Corrections must pass manual review before they can be deployed to official traffic for comparison. For example, in the article, an agent copied the description text of a web search tool directly into a file that Rust can read, so that the two versions of the prompt words match. Engineers rejected this amendment because after all, the Rust version would have to call the internal service that provides this description before it goes online. Managed agents were redone, and on-call and interview practices were also changed. Lesse also talked about Claude Managed Agents (managed agent service), a project written in Go before the Rust migration. The approach of the first version was to open a sandbox and start Claude Code in it every time it received a request. This brings four problems. If the sandbox is emptied, you have to start over. You have to wait for the boot to get a response. The credentials have to be put into the sandbox. Each sandbox also occupies at least one CPU. The team tore it down and redone it, changing it to a proxy main program that runs on a resident server and only opens the sandbox when needed. She said that the new architecture only uses about one-third of the original CPU on average, and it takes about five or six months from conception to launch. The duty process is also changing. Lesse said Claude had been working shifts with API for several months. Now when the alarm sounds, it will be handed over to Claude first to determine whether it is noise or a real fault, and only then will the engineer be awakened. By the time the engineer gets to the computer, Claude has often found the cause and suggested a fix. She also said that it was not possible for Claude to deal with a real accident on his own without calling anyone at all. Product managers can also push features into the official environment. The developer backend has recently added a prompt caching diagnostic function. When the cache is not hit, the API will explain the reason. There is also a dashboard to view the hit rate. The feature was written by a product manager in a back-and-forth between Slack and Claude, while engineers reviewed the code. Changes to the core API won't be handed over to product managers or designers just yet, Lesse said. Lesse’s team is also phasing out traditional programmed interviews. Candidates who performed well on other levels often failed in the on-site programming level because they no longer usually write programs by hand. She said that the team has not directly deleted this level and is testing several types of interviews conducted by programmed agents. For example, asking candidates to review the code or system design written by the agent... "Anthropic API switched to Rust, 80% of PR engineers did not read it carefully" This article was first published in BlockTempo "Dongqu Dongzhu - the most influential blockchain news media".