GitHub landed 800,000 lines of Rust in the Copilot runtime across 128 pull requests
Stephen Toub of Microsoft writes that AI agents wrote most of the code and a single developer drove the port in a few months while the rest of the team kept expanding the runtime. The post puts the speedup at orders of magnitude.
The Engineer · Build desk
What happened
- GitHub has rewritten the Copilot agent runtime, originally TypeScript on Node.js and V8, into more than 800,000 lines of production Rust, using the Copilot app and the Copilot CLI to write it.
- AI agents wrote most of that code across 128 pull requests that landed in main and shipped incrementally instead of waiting for a single cutover at the end.
- The runtime sits under the Copilot CLI, app and SDK as well as the latest releases of VS Code, Visual Studio, Copilot Code Review, Copilot Cowork, Copilot Studio and the Office applications.
Why it matters
- What it limits constraint At roughly 6,250 lines per pull request, review capacity is the scarce resource in a port like this.
- Who's exposed exposure Every product that dropped its own agent loop for the Copilot SDK now inherits the Rust runtime's regressions as quickly as it inherits its fixes.
- Who has to decide decision A team weighing its own TypeScript-to-Rust port has to decide whether a porting team's counterfactual estimate is a defensible planning baseline.
- What it sets up precedent Toub's account treats finding and fixing regressions in main as an acceptable cost of rewriting shared infrastructure. That choice moves the risk off a cutover date and onto every week of the port.
Next story · Build · Sep 27
Vercel Labs' ScriptC trades sustained TypeScript throughput for millisecond startupsConfirmed2 publishers
The CLI was logically a terminal UI on top of an agent loop, and the whole stack was TypeScript: Node.js as the framework, V8 as the execution engine, Ink and React for the UI [5]. Toub called that "a respectable choice for a TUI application" [6]. For a console program, startup, responsiveness, throughput and memory consumption are reasonable, and he wrote that they are much less reasonable once the same implementation runs in other environments, with demands for fast startup and server density from low memory overhead [11].
Then there is the layering. The CLI was written and shipped quickly, and its TUI and its runtime ended up fairly intertwined instead of separated into discrete layers [12]. When an SDK was needed for programmatic access, it went on top of the CLI, a "pragmatic decision", Toub wrote, "even though logically you'd expect the inverse architecture" [13]. The CLI gained a headless mode that reads similar commands from stdin and writes responses to stdout [14]. A JSON-RPC protocol then marshals function calls from an external process to and from the CLI [15]. The SDK can be embedded in an arbitrary consuming program, and that program spawns a CLI process to host the agent loop out of process [16].
Divide the output by the increments and each change averages about 6,250 lines: more than 800,000 lines of Rust across 128 pull requests that landed in main [2][3][18]. Nobody reads a 6,250-line diff line by line. The post's answer to that is the shipping model, with the work going into main as it landed and the few regressions found and fixed along the way [3][19].
This port started from a working implementation that already backed shipping products [7][1]. The one-developer, few-months figure is set against Toub's own estimate of what the same work would have cost before agents, a whole team and a year or two [4]. The post reports the runtime's performance improving by orders of magnitude and does not include a benchmark [19]. Two numbers would make this usable as a planning input: the share of the 800,000 lines a human wrote or corrected, and the startup and memory figures the Rust runtime now hits.
What to watch
- Whether GitHub publishes startup and memory numbers for the Rust runtime against the Node.js one.
- Whether the Rust runtime removes the spawned CLI process and the JSON-RPC hop for SDK consumers.
- Whether other Microsoft or GitHub teams report agent-written rewrite figures with per-pull-request review data attached.
Clarity's read
What the record supports and how the coverage leans. The claims behind it follow.
Reality
- Evidence45
- Adoption60
- Hype gap+35
- Incentives80
- Confidence55
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [1]
The Copilot agent runtime was originally written in TypeScript on Node.js and the V8 JavaScript engine for what is now the GitHub Copilot cloud agent, and stayed on that stack as its capabilities grew.
- [2]
Using the GitHub Copilot app and the Copilot CLI, GitHub completely rewrote the runtime into more than 800,000 lines of production Rust.
- [3]
AI agents wrote most of the code, spanning 128 pull requests that landed in main and shipped incrementally rather than waiting for a single cutover at the end.
- [4]
A project that would have taken a whole team of developers a year or two before agents was completed primarily by a single developer in only a few months, while the rest of the team continued to greatly expand the runtime's capabilities and reach.
- [5]
The CLI is logically a terminal UI on top of an agent loop, and the whole stack was implemented in TypeScript, using Node.js as the framework, V8 for the execution engine, and Ink and React for the UI.
- [6]
"That's a respectable choice for a TUI application; TypeScript and Node.js are broadly accessible and enable very rapid application development."
- [7]
The GitHub Copilot CLI, GitHub Copilot app and GitHub Copilot SDK are all backed by the Copilot agent runtime, an agentic harness that can be embedded into applications and services.
- [8]
Stephen Toub is a Distinguished Engineer at Microsoft.
- [9]
The Copilot agent runtime backs the GitHub Copilot CLI and app plus the latest releases of VS Code, Visual Studio, the Copilot cloud agent, Copilot Code Review, Copilot Cowork, Copilot Studio, and Excel, Outlook, PowerPoint and Word.
- [10]
Most of those products initially implemented their own agent loop but have since replaced it with the GitHub Copilot SDK, which is the entry point to the Copilot agent runtime.
- [11]
For the needs of a console application the performance implications in terms of startup, responsiveness, throughput and memory consumption are reasonable, and they are much less reasonable when that implementation is used in other environments with demands for things like fast startup and excellent server density due to low memory overhead.
- [12]
The Copilot CLI was initially written and shipped quickly, and in doing so the TUI and the runtime were fairly intertwined rather than separated into discrete layers.
- [13]
"a pragmatic decision was made to layer the SDK on top of the CLI, even though logically you'd expect the inverse architecture"
- [14]
The CLI was updated with a mode where it could be run headless, reading similar commands from stdin and writing responses to stdout.
- [15]
A JSON-RPC protocol could then be used to marshal function calls from an external process to and from the CLI.
- [16]
The SDK could be embedded in arbitrary consuming programs, which would spawn a CLI process to host the agent loop out-of-process.
- [17]
The consuming products want the runtime's intelligence, security, reliability and performance shared, so that a fix in one place fixes it in all of them.
- [18]
More than 800,000 lines of Rust spread over 128 pull requests averages about 6,250 lines per pull request.
- [19]
The few inevitable regressions were discovered and fixed quickly along the way, while the performance of the runtime improved by orders of magnitude.
Sources
2 independent publishers whose own reporting we read for this story.
- github.blogMigrating the GitHub Copilot runtime to Rust, using Copilot
1 article · September 16, 2026
- thenewstack.ioGitHub and Anthropic used their own agents for major Rust rewrites — with very different playbooks
1 article · September 17, 2026
Topics and entities
Topics
Entities
- Node.js
- V8
- Microsoft
- Rust
- GitHub Copilot SDK
- TypeScript
- Bun
- Copilot agent runtime
- GitHub Copilot
- GitHub
- Anthropic