430,000 lines of TypeScript ported in Rust by agents: $120,000 in tokens and 14.5 weeks at Microsoft

The GitHub Copilot runtime has been rewritten module by module by agents piloting GPT-5.6 Sol and Claude Opus 4.8, for a result 15.9 times faster and eleven times more efficient in memory.

Microsoft entrusted agents with the migration of the GitHub Copilot runtime, from TypeScript to Rust. The yard produced 800,000 lines of production Rust from 430,000 lines of TypeScript, spread over 135 deliveries in fourteen and a half weeks, at a rate of about 1.3 pull requests per day. The bill can be summed up in two lines: about $120,000 in token consumption, and three weeks of human developer time.

Several models were used depending on the portions of the project, including GPT-5.6 Sol and Claude Opus 4.8. The gains measured are clear: the throughput goes from 7.55 to 120 life cycles per second on the test bench, i.e. a factor of 15.9, while the memory footprint of a batch of ten clients drops from 1,383 MB to 126 MB. However, the journey was not linear: dozens of regressions arose despite a code accepted by the compiler.

Stephen Toub, a distinguished engineer at Microsoft, describes work that is much closer to iterative investigation than the popular image of an AI dumping code: most of the agents' time has been spent gathering context before writing. The process is starting to catch on — rewriting the JavaScript runtime from Bun to Rust cost around $165,000 in tokens.