Prime Agent Rewritten in Rust by a Swarm of 2,000 AI Agents
Prime Agent's TypeScript codebase was rewritten in Rust by 2,000+ autonomous AI agents across 10,000 sandboxes, improving speed and architecture.
Since its August launch, Prime Agent has been downloaded over 300,000 times and processed more than 8 trillion tokens as a TypeScript-based coding agent. The team has now rewritten it entirely in Rust, with the migration itself carried out by a swarm of over 2,000 autonomous agents working across 10,000+ Prime Sandboxes and consuming more than 200 billion tokens from a GLM-5.3 inference endpoint over two weeks. The move to Rust addresses limits inherent to TypeScript: a garbage collector, optional types that vanish at runtime, and CPU-heavy work competing with input handling on a single event loop. Rust's ownership model, lifetimes, exhaustive enums, and Send/Sync traits give compile-time guarantees that matter when most of the code is machine-generated. A single root orchestrator agent split the rewrite into topologically ordered tasks, each passed through four specialized agents — Planner, Implementer, Reviewer, and Verifier — checked against four parity layers covering the terminal UI, harness behavior, daemon protocol, and feature completeness, enabling largely autonomous merging with minimal human review. The resulting codebase is split into nine crates with an enforced one-way dependency graph, shrinking the largest source file from roughly 15,000 lines to about 2,500, while adding session crash isolation, Windows support, and the ability to ship new models and plugins without a full release.
This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work