LegionEdge
All blog posts
EngineeringJun 5, 20261 min read

Scaling W0rktree to thousand-agent fleets

Source control built for humans breaks at agent scale. Snapshots and scoped context are how we fixed it.

CategoryEngineering
PublishedJun 5, 2026
Reading time1 min
Sections01
SourceEngineering blog
00

Overview

Git assumes a small number of careful writers. An agent fleet is the opposite: thousands of concurrent workers, each making many small, disposable changes. Run that workload through conventional source control and you spend more time on lock contention and clone traffic than on useful work.

W0rktree's answer is snapshots as the primitive. An agent doesn't clone a repository; it gets a copy-on-write view that costs kilobytes to create and nothing to throw away. In our internal fleets, spinning up a working tree went from seconds to under a millisecond — which changes what you're willing to parallelize.

The second half is scoped context. Most agents touch a handful of files, so W0rktree serves views scoped to what the task actually needs. Context assembly for a typical task reads under 2% of the repository, and the W0rkTree Protocol exposes that scoping to the model layer so prompts stay small too.

Contention is handled with optimistic merge queues rather than locks. Conflicting writes are rare in practice — agents work on disjoint scopes most of the time — so we let them proceed and reconcile at merge time, the same bet that makes multi-version databases fast.

The Rust core is open source under GPL 3.0, and the protocol spec is published. If you're building agent infrastructure and fighting your version control, the whole design is there to build on.

Want the build notes as they happen?

The blog is written by the engineers shipping Nokuva, Tavoc, and Foltrac — deep dives land here as the work does, and the authors answer questions.