September 21, 2026
One engineer with agents ported the Copilot runtime to Rust: 832,000 lines of production code
832 thousand lines of Rust in 14,5 weeks and about $120 000 tokens: that is what porting the runtime by agents cost.

GitHub
@github
One engineer and a team of agents migrated the GitHub Copilot agent runtime to Rust: 800 000 lines of production code without sacrificing quality. 🚀 How it worked 👇 https://github.blog/ai-and-ml/generative-ai/migrating-the-github-copilot-runtime-to-rust-using-copilot/?utm_source=x-copilot-rust&utm_medium=social&utm_campaign=github-app-cli-Q1-push
· 3.5M views
Steven Toub gave an agent a single session.ts file and got it back in Rust 25 hours later.
The parent session made 222 shell calls, viewed 205 files, and ran 197 code searches before spawning 15 child sessions across seven waves. Toub calls it iterative investigation, not a machine that spits out code.
From 12 May to 21 August 2026, agents migrated the entire GitHub Copilot runtime from TypeScript to Rust. 430,000 lines of source became 832 378 lines of production code plus another 468 689 lines of unit tests, with all work fitting into 128 PRs.
Before and after. Each SDK client launched its own separate Node.js subprocess. Now the runtime runs as a native library inside the process. The session lifecycle is 15.9 times faster, while memory use across ten clients fell from 1383 MB to 126 MB, or 11 times.
The cost. The entire port cost around $120 000 in tokens and roughly three weeks of the developer's own time. A similar Rust migration at Bun cost $165 000 (The Register, 18.09.2026).
How they maintained quality. Toub wrote the agent a `rust-rebase-review` skill: it compared the old TypeScript with the new Rust line by line and confirmed that behavior matched. They moved from the leaves inward: first pure helpers and shell utilities, then stateful subsystems, one component at a time instead of one big bang. GitHub published the skill's full prompt in a post on 16.09.2026.
The code ended up with 158 unsafe blocks across 36 files, all at external boundaries, and around 60 npm dependencies left the runtime. Dozens of regressions were found and fixed along the way before the final release.
How to get it. Install the runtime in your code through the Copilot SDK. For Rust, use `cargo add github-copilot-sdk`; you need Rust 1.94+ and the Copilot CLI installed under your own login. Enable the native runtime with the crate feature `bundled-in-process`.
By default, the SDK still embeds a compatible CLI in the binary; the native runtime must be enabled manually.
Source
