deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (hnrss.org)

Prime Intellect rewrote Prime Agent in Rust using a swarm of 2,000-plus agents

Prime Intellect rewrote its Prime Agent coding harness from TypeScript to Rust, with more than 2,000 autonomous agents performing the port over two weeks. The result: better performance, crash isolation and Windows support.

Prime Intellect rewrote Prime Agent in Rust using a swarm of 2,000-plus agents

Prime Agent rebuilt itself in Rust

Prime Intellect has shipped a from-scratch Rust rewrite of Prime Agent, the company's agent harness for coding and multi-agent orchestration. According to Prime Intellect's blog post, which reached the Hacker News front page, the original TypeScript version has been downloaded more than 300,000 times since launching in August and has processed over 8 trillion tokens. The rewrite is billed as faster, lighter on resources and more reliable, with new capabilities including Windows support and per-session crash isolation.

The most notable detail is who performed the port: Prime Agent itself.

An agent swarm did the port

Prime Intellect says that over two weeks a single root agent coordinated a swarm of more than 2,000 agents across 10,000-plus Prime Sandboxes, drawing over 200 billion tokens from Prime Inference's GLM-5.3 endpoint. The root agent wrote none of the product code. Instead, it split the rewrite into a topologically ordered task graph, tracked each task, merged finished work and worked with the human team on priorities.

Every task passed through four distinct agents:

  • A planner produced the specification, the feature design and the ground-truth behaviour taken from the TypeScript implementation.
  • An implementer wrote the Rust code in an isolated worktree so features could progress in parallel.
  • A reviewer examined the pull request adversarially, using a different model in a separate context to find reasons the change might be wrong.
  • A verifier compiled the code and ran parity checks and tests inside a fresh sandbox.

A failed review or verification sent the task back to the implementer with the findings, and a pull request merged only after both passed. Prime Intellect deliberately separated code generation from evaluation, arguing that an agent judging its own output is biased in its favour. The operation ran on two 8-core CPU nodes, each sustaining more than 100 concurrent subagents, with compilation, type-checking and diffing offloaded to sandboxes to avoid saturating a single machine.

Proving parity with the TypeScript version

Because scripted tests cannot cover everything, Prime Intellect built four categories of objective parity checks. A differential test suite ran the TypeScript and Rust binaries side by side against the same scripted model and compared the terminal frames each rendered, covering launch, menus, tool calls, session resume, subagents and crash recovery. Harness parity compared session transcripts and the requests each binary sent to model providers. Protocol parity validated every daemon message type against the original implementation. Finally, agents audited the TypeScript product component by component and classified each as matching, partial or missing.

These objective measures let the agents track their own progress and catch regressions before merging, which Prime Intellect says cut the need for human review. Once the core loop reached parity, the team moved the rewrite agents onto the Rust build, letting the new version improve itself, and later moved internal users onto it for daily use, where bugs outside the differential tests' coverage surfaced.

What Rust changed

Prime Intellect's stated frustrations with TypeScript include types that vanish at runtime, errors that travel as unchecked exceptions, CPU-heavy rendering competing with keyboard input on a single event loop, and the per-process cost of a JavaScript runtime and garbage collector. For a long-running daemon with a worker process per session, Rust brings no garbage collector, compiler-checked thread safety through the Send and Sync traits, and compile-time guarantees from exhaustive enums, ownership, lifetimes and strict Clippy lints. That last part matters more, the company notes, when agents author most of the code.

The port also restructured the codebase into nine crates with a one-way dependency graph enforced by Cargo. The largest source file shrank to roughly 2,500 lines from about 15,000 in TypeScript, and no file now exceeds 5,000 lines, versus four before. Sessions run in isolated worker processes under a small supervisor and persist to disk so clients can reattach after a restart. Platform-specific work such as transport, process control and file locking now sits behind traits, which is why Windows support became a matter of implementing interfaces rather than rewiring the daemon. Model and plugin catalogs are fetched at runtime, so new models can ship without a Prime Agent release. Prime Intellect claims the result runs faster and uses fewer resources than most coding agent harnesses, though these are the vendor's own benchmarks rather than independent tests.

Why it matters

This is one of the larger reported examples of an AI system autonomously rewriting a production tool that hundreds of thousands of developers already rely on, with humans confined largely to designing the verification apparatus. The workflow on display — objective parity checks, adversarial review by a separate model, and generation kept apart from evaluation — is a reusable template for anyone handing high-stakes code changes to agents. For existing users, the practical gains are performance, crash isolation and Windows support. The caveat is the one Prime Intellect itself acknowledges: parity checks only verify the behaviour they exercise, and the remaining gaps showed up only when people actually used the tool day to day.

  • #rust
  • #ai-agents
  • #developer-tools
  • #prime-intellect
  • #code-generation

Related posts