Framework

Running multiple AI coding agents on one repo

The moment one agent works, you want three: one building the feature, one reviewing yesterday's branch, one auditing security. The moment you run three, they start overwriting each other's files, and the speedup turns into a cleanup.

Why parallel agents collide

Agents do not coordinate by default. Each one sees the repo as exclusively its own, the way a single-player game sees a save file. Two agents building in the same working tree will race on the same files. Worse is the subtle version: an agent reviewing code while another agent rewrites it mid-review produces a review of something that no longer exists.

Phases are the natural unit of parallelism

The useful observation: most phases of a sprint do not write code. Review reads. Security reads. QA reads and runs. Only build mutates. Which means a sprint has natural lanes, if something enforces two rules: writers get exclusive turns, and readers are actually prevented from writing.

That something in Nanostack is the conductor. It schedules phases across agents from the dependency graph, hands out work with atomic file locks (plain mkdiratomicity, no daemon, no server), and during read-only phases the write hooks block mutations, so a "reviewing" agent cannot helpfully fix what it is supposed to be judging. Review, security, and QA run in parallel safely because they are physically read-only, not politely read-only.

Artifacts are how agents talk

The second coordination problem is communication. Agent A planned; agent B builds. B was not in A's conversation and never will be. They share state the same way the phases do: through the artifacts. B reads plan.json, not A's chat log. The handoff is clean because the medium is a file with an integrity hash, not a summary of a summary.

This also means the agents do not have to be the same product. A Claude Code session can plan, a Cursor session can build, and the artifacts do not care. The workflow is the shared language; the agents are interchangeable workers inside it.

Start with two

The practical on-ramp: one agent building in a sprint, a second running review and security on the previous branch. That alone roughly doubles throughput with zero collision risk, because the lanes never cross. The conductor's next command tells each agent what it should pick up; unstuck recovers a lane that stalled.

How the conductor schedules → · Multi-agent setup →

← All content · Install nanostack →