Every developer I know has a story about a "quick rewrite" that ate two years of a company's life. Which is why Microsoft's latest engineering blog post stopped me mid-scroll: GitHub has ported the Copilot agent runtime — the engine that powers the Copilot CLI, the Copilot app, the SDK, and integrations across VS Code, Visual Studio, Excel, Outlook and PowerPoint — from TypeScript into more than 800,000 lines of production Rust. And the people who wrote most of that code were not people. They were AI agents.
01.The numbers are the story
Stephen Toub, a Distinguished Engineer at Microsoft, detailed the whole project in a post that engineering Twitter has been dissecting all weekend. The runtime started as roughly 430,000 lines of TypeScript on Node.js and V8. It ended as 832,378 lines of production Rust, plus another 468,689 lines of Rust unit tests. The port ran from May 12 to August 21 — about 14.5 weeks — landing in 128 pull requests, with 135 releases shipped along the way, roughly 1.3 port PRs per day.
The economics are what make this a genuinely new thing. By Toub's estimate, the same rewrite would have taken a whole team of developers a year or two before agents. Instead it was driven primarily by a single developer in a few months, for roughly $120,000 in AI token costs plus about three weeks of that developer's time. For anyone doing the conversion to rupees — under ₹1 crore to rewrite the beating heart of Copilot. That's less than what many Indian enterprises spend on a single consulting project.
02.Copilot rewrote Copilot — using rivals' models too
Here's a detail that says a lot about where the industry actually is: the team used Copilot to rewrite Copilot, drawing on both GPT-5.6 Sol and Claude Opus 4.8 for different parts of the job, picking whichever model suited the task. Microsoft happily namechecked an Anthropic model for rewrites of its own flagship coding product. Whatever rivalry narrative you've built in your head, engineering teams are mixing models freely — something Claude Code's new multi-agent support is only accelerating.
The agents also behaved in ways nobody scripted. Toub notes they spent far more time reading code and gathering context than actually writing it — "the popular image of AI spewing code is almost backwards," he wrote. The gnarliest file, a 30,000-line session.ts, took one 25-hour porting session that began with 56 minutes of documentation reading and 122 clarification tool calls, then spawned 15 child sessions — which then started messaging each other to coordinate overlapping work. That's not autocomplete. That's a team.
03.Why Rust, and what it bought them
The motivation was performance at scale. TypeScript and Node were great for speed of development, but Microsoft needed low startup overhead, predictable memory use and a C ABI so the runtime could be embedded in-process by every language front-end. On one benchmark — 1,000 one-turn session lifecycles with 100 concurrent pipelines — TypeScript managed 7.55 cycles per second while the Rust version hit 120 per second, a 15.9x improvement. Memory across a 10-client batch dropped from 1,383 MB to 126 MB.
Toub is careful to say this doesn't mean every TypeScript app should become Rust — their requirements were specific. But the porting playbook itself, agents doing mechanical translation module by module while shipping incrementally, is the transferable part.
04.The catch: the compiler can't save you
Now the honest part. The project hit dozens of regressions — code that compiled cleanly but no longer behaved correctly. Ambiguous semantics, missing features that never got ported, subtle behavioural drift. Toub's one-liner deserves to be framed in every engineering team's office: "'if it compiles, it's correct' is useful only as a joke."
This mirrors what Anthropic saw when Bun's creator ported that runtime from Zig to Rust almost entirely with Claude agents — $165,000 in tokens, 99.8% of tests passing, but still needing human eyes everywhere. The emerging playbook is consistent: agents do the translation, humans do the judgement. The review loop itself is shrinking too — Zed Delta's public beta, where AI agents replace pull requests entirely, is the logical next step of this exact trend. If you're running AI coding agents at work without a tight review loop and a cost ceiling, this story is your warning — and a good moment to mention that the cost-optimisation chapter of the GPT-6 Astra — Zero to Hero Guide exists precisely because runaway token bills are the fastest way to kill an otherwise brilliant automation project. And if your team is only now adopting coding agents, our AI Coding Playbook covers the spec-first workflow and context files that keep agent-written code reviewable — with every price in rupees.
Key Takeaways
- GitHub ported the Copilot agent runtime from 430K lines of TypeScript to 800K+ lines of production Rust
- AI agents wrote most of the code; one developer drove it over ~14.5 weeks at roughly $120,000 in token costs
- Estimated cost without agents: a full team, one to two years, millions of dollars
- Performance gains: 15.9x throughput and memory down from 1,383 MB to 126 MB on Microsoft's benchmark
- Dozens of compiler-approved regressions prove human review remains essential
Frequently Asked Questions
How many lines of code were in GitHub's Copilot Rust rewrite?
The port produced 832,378 lines of production Rust plus roughly 468,689 lines of Rust unit tests, replacing about 430,000 lines of TypeScript. The rewrite ran from May 12 to August 21 — about 14.5 weeks — landing in 128 pull requests, roughly 1.3 port PRs per day.
How much did the Copilot runtime rewrite cost?
Microsoft's Stephen Toub put the cost at roughly $120,000 in AI token spend plus about three weeks of a single developer's time. He estimated the same rewrite would have taken a whole team of developers one to two years before AI agents existed.
How much faster is the Copilot runtime in Rust?
On a benchmark of 1,000 one-turn session lifecycles with 100 concurrent pipelines, throughput rose from 7.55 cycles per second in TypeScript to 120 per second in Rust — a 15.9x improvement. Memory across a 10-client batch dropped from 1,383 MB to 126 MB. Even so, the project still hit dozens of regressions that only human review caught — the Rust compiler can't verify behavior.
What This Means for You
If you're a developer in India, this is one of the clearest signals yet that the premium is shifting from writing code to directing and reviewing it. Toub himself spent most of his time reviewing changes, testing behaviour and challenging design decisions — not typing. For India's massive IT services sector, the "rewrite" and "migration" businesses just changed shape overnight: the same Java-to-cloud modernisation projects that employed thousands can now be driven by far smaller teams who know how to orchestrate agents well. That skill — directing agents, controlling costs, reviewing their output — is learnable, and the GPT-6 Astra — Zero to Hero Guide covers it end to end, from prompting to building your first coding agent, at a price that's less than a month of canteen chai.
Confused by all the GPT-6 Astra buzz lately? We wrote a plain-English beginner's guide to GPT-6 Astra that is worth a read before you spend a single rupee on AI tools.