How to run a fleet of AI coding agents unattended: roles, protocol, gates, and the exit rule
A 161-agent overnight Flutter build merged 15 streams with no conflicts, and its review loop burned 10 million tokens without converging.
On the night of October 23 I pointed an orchestrated, self-improving Flutter workflow at an empty repository and gave it as thorough an idea of what I wanted as I could think of. There were two more short prompts about an hour in, and then I went to bed. It had an approved plan and a protocol, and I told it to be token efficient, but I never said how many agents to use, so the 161 were its own decision. By morning it had built The Very Good Realm, a 3D open-world version of our website written in Flutter using flutter_scene. When I returned to my computer a tagged release that passed all 20 gates in its pipeline was waiting for me. That was 8 hours and 10 minutes after it started, and after the two steers nobody touched it. I was asleep.
The agents wrote 28,000 lines of Dart and 19,000 lines of tests across 231 commits. Fifteen parallel build streams merged with zero conflicts. However, about 10 million of the night’s 17.2 million subagent tokens went into a review loop that never converged (more on that later).

This post covers the system behind the game. A fleet, as I’m using the word, is many agents that each own one role and one slice of the codebase, plus a few that carry the context between the slices.
Why I ran it
We all know agents can write code. What I wanted to improve was a workflow in which many of them work at once, unattended, without stepping on each other or on the codebase, a question that sits under most of the agentic engineering work we do for clients. The only way to learn is to try.
The fleet: nine agent roles

The conductor ran each phase as a workflow script and read the result before starting the next. Only the integrator wrote to main. Everyone else worked in a branch, a worktree, or a report.
| Role | Model | Count | Owns |
|---|---|---|---|
| Conductor | Opus | 1 | Phase sequencing, run log, scope calls, final report |
| Contract author | Opus | 1, plus 1 amendment | Scaffold, package interfaces, gate scripts, ownership map, traps |
| Design agent | Opus | 2 | Design canvas, generated from a script |
| Stream builders | Opus for the core packages; Sonnet for the UI streams | 9 in wave 1, 6 in wave 2 | Only their own directories, each in a git worktree |
| Integrator | Opus | 1 per merge step | The only writer to main, shared files, whole-build measurement |
| Reviewers | Sonnet | 7 per round | Our standard review agents, plus security and license. A completeness critic ran alongside each round |
| Visual judge | Opus | 1 per round | A pass/fail checklist per screenshot, blind A/B against the last round |
| Fixers | Sonnet, then Opus after 2 failures | 10 to 16 per round | Findings grouped by owned directory |
| Mechanics | Haiku | As needed | Running gates, summarizing failures, captures |
Opus went to the conductor, which held the whole night’s context, and to the contract author, whose calls every other agent builds on. Opus also went to the integrator and the visual judge and the builders of the core packages, where a mistake would show up late and in many places at once. Sonnet took the UI streams and the reviewers and made the first attempt at any fix, and Haiku ran the gates and captures and summarized failures, which is work where a script checks the output. No stream failed outright under that split. No more than 6 agents ever ran at once, because the build gates are CPU-heavy and had to be serialized on the 8-core Mac. I had planned for 16, but the agent corrected its plan after noticing the underpowered machine.

The protocol: how parallel agents avoid merge conflicts
The contract author commits the scaffold, the package interfaces, the gate scripts, and an ownership map that gives every path one owner (shared files go to the integrator). It tags that commit on main, and from then on the contracts are frozen with amendments going through the conductor and nobody else touching them.

Each stream branches from the latest tag into its own worktree and may touch only the paths in its ownership row. So, a stream that needs a shared file changed writes a request into an INTEGRATION_REQUESTS.md inside its own directory and the integrator applies it. A stream is done when its own gate passes and it has committed.
The integrator merges in dependency order with a fast verify after each merge and the full gate after all of them. It fixes any breaks itself or dispatches a fixer. The follow-up work on October 25 and 26 ran on a smaller version of the same arrangement. One Claude Code builder worked per worktree, and a separate reviewer agent read what it produced before anything merged.
Wave 1, wave 2, each review round, and the final release were tagged only after the full gate passed, which left the last green tag as the fallback.
A Sonnet agent that failed its gate retried with the failing output, twice at most. After that an Opus agent got the full context and the failed diffs. Toolchain and network failures, and anything blocked on permissions, went to the conductor, which recorded them and either descoped or stopped, and which never silently changed the stack or dropped a success criterion.
Every gate is a script that prints one JSON line, and the script stops at the first failure. Ours ran from format and analyze through coverage and brand rules to a function smoke, a performance smoke, and a reduced-motion smoke, with a review gate last. They are specific to this project. The same contract-first approach sits under our AI-ready monorepos, applied here with agents on both sides of the contract.
Each agent prompt named its role and stream id along with the paths it owned, then pointed to the one spec file and whichever skills applied, then the gate command that defined done, and last the fixed format agents reported back in: status, commits, gate output, open issues, and surprises.
The VGV toolchain underneath
The fleet started from the tools we use for client work, and three of them did most of the work. Two of the three are ours.

Wingspan is our workflow plugin for Claude Code. Its plan-then-build flow produced the approved plan the conductor worked from. Its five review agents ran every round and wrote their findings in Wingspan’s standard format, which is how fixers could be dispatched by owned directory. Wingspan also ships the context7 MCP server, so every agent had current package documentation to read when its training data had gone stale, and the Wingspan walkthrough shows the attended version of the same flow.
The build flow has four interactive gates, from “start building?” to the commit-autonomy question, and the prompts bypassed all four for this run. Wingspan was written for a person sitting at the terminal, and each of those questions is a spot where an unattended run would have waited for me until morning. We’re pursuing an unattended mode, with auto commit, a fresh agent per phase, and auto-fixed important findings in a future version.
The Very Good Flutter AI plugin is our Flutter rulebook, with skills for layered architecture, testing, BLoC, theming, security, and license compliance. It ships two MCP servers. One wraps the Dart tooling and the other wraps very_good_cli. The very_good_cli server mattered most to me, since agents scaffolded packages and ran the test suite through the same tool our engineers use. This helped fifteen streams written by different agents merge as one codebase. The plugin’s static-security and license-compliance reviewers ran next to Wingspan’s in every round. That made seven reviewers.
Claude Design, which is Anthropic’s, did all of the design work. Two Opus design agents generated the design canvas from a script, 11 artboards first and then the 3D boards. They scanned their own output for banned effects before publishing. The visual judge compared every screenshot against those artboards. The best catch of the night was one of the design agents finding a fog value that would have hidden the whole world. The images in this post came out of the same system, and the brand rules it worked from were compiled into the gate as machine checks.
The night, phase by phase
Times are EDT stamped from the system clock. The run started at 20:10 on October 23 and tagged the release at 04:14.

Waves 1 and 2 took about two hours and 5 million tokens between them. The review loop took three and a half hours and 10 million tokens by itself.
What worked
The integrator toggled subsystems on and off and timed the whole build, and that turned up a web load hang and a bug that accounted for 75% of the frame cost, neither of which a single stream could have seen from its own code.
Fifteen streams across two waves merged with zero conflicts. Some of that is built in, since disjoint paths can’t conflict and the integrator applied the shared-file requests itself. Fifteen builders still had to follow the map all night, and they did. Amazing! The contracts and the first design canvas cost 32 minutes and 0.42 million tokens up front, plus an amendment. That is less than an integrator would have spent untangling merges.
Every prompt pointed to the one spec file and avoided restating it. The conductor set that rule early. Duplicated context creates drift, and 161 agents were reading it.
The first design had the visual judge rate screenshots from 0 to 10. The conductor changed that before the fan-out, after reading a vendor skill’s warning that self-scores drift upward. The judge moved to a pass/fail checklist for each shot and a blind A/B comparison against the previous round, so it never scored its own work, and later in the night to a deterministic shot list. That last change came after the judge reported an absent face as “not mirrored”. On the shot list a missing shot fails outright.
The conductor split the smoke tests into two tiers, a headless run for function and a run on real hardware for performance. On the same build they disagreed by a factor of four. The headless run uses a software renderer, so it measured a quarter of the frame rate, and the two stayed separate for that reason.
Of the 13 changes to the system that the run log records for the night, the conductor made 11 and I made two. Each traced to evidence, usually something the agents hit, whether the 8-core machine, a vendor skill that contradicted three plan assumptions, a performance measurement, or a false report from the judge.
What didn’t work: the review loop that never would have ended
After wave 2 the workflow entered a review loop in which each round ran seven reviewers and a visual judge, with a completeness critic alongside, and then 10 to 16 fixers grouped by owned directory worked through what they had found. The exit rule was two consecutive rounds with no new blocking findings, and I assumed that agents reviewing code will eventually stop finding issues. I was wrong.
Fresh blocking findings per round ran 37, 19, 16, 18, 16, and 20.

Every finding was fixed or explicitly declined, and the loop ran out its deadline after six rounds while I was asleep, and the conductor replaced it. I read the log in the morning and I was annoyed by the wasted tokens. Ten million tokens is more than half of everything the subagents spent, and the last round had a higher count than the two before it, which I still can’t explain. The reviewers returned about 50 findings a round against the 25,000 lines that existed at the time, with roughly a third labeled important, and in six rounds none of them ever came back empty-handed. Since every round reviewed everything, fixes included, architecture findings drove real refactors overnight, and each refactor became new code for the next round to read. Deduplicating findings by file and title didn’t work either, since the reviewers rephrase an issue and it comes back under a new name.
The replacement was a targeted polish pass in which four fixers worked from the visual judge’s FAIL list with no fresh review. Then, an integrator re-captured all 18 screenshots, compared each one blind against round 6, reverted the one that got worse, and tagged the release. It took 32 minutes and 0.67 million tokens. After the revert 16 of the 18 pairs beat round 6 and the other two tied.
I haven’t run a loop on this rule yet, but the one I’d write after learning from this is — green gates, nothing critical open, no rule-cited important findings in the delta since the last round, and a passing visual checklist. The run report’s estimate is that it would have stopped this loop after round two or three at about a third of the cost.

Lessons from the days after
Four follow-up rounds shipped on October 25 and 26, each with a Claude Code builder agent in its own git worktree and a separate reviewer agent before merge.

Three times the reviewer returned NO-SHIP on code whose tests were green. Two of those were performance regressions, one of them invisible to the benchmark because a median can’t see the misses in the tail. The third hid a UI element after a restored GPU context on iPad. GPU benchmarks run side by side distorted each other. Absolute numbers shifted with whatever else was running on the machine. New instructions reached one long-running agent only after it had finished a two-hour job, so redirecting a long job takes a stop and a restart with the new brief.
One big issue happened when an agent cleaning up a worktree deleted its gitignored outputs and cost two hours of regeneration, which is why build outputs and generated assets belong outside the worktree. A reviewer also died mid-review when the login switched. Auth is worth checking before a long run, and agents should write progress to disk so a restart loses little. We covered the single-agent version of several of these rules in Giving an AI agent the keys.
What I’ll change next time
These are the top ten changes I’d add to my next fleet run. The first would have saved about two-thirds of the loop’s cost. The second would have saved most of the 34-minute, 0.69 million token amendment phase that my two mid-run steers forced (the 3D design boards came out of the same phase).
-
Exit loops on a terminating rule
The loop ends when the gates are green, nothing critical remains, the delta has no rule-cited important findings, and the visual checklist passes. Between rounds it reviews only the delta, with a full review at the start and again at the end.
-
Hold a human steering window before the fan-out
Version the spec, and restart in-flight agents when it changes. Both of my steers were cheap only because no builders had started when they landed (the amendment and the 3D boards they caused still took 34 minutes), and fifteen minutes on design and contracts with a person present would have bought the same thing on purpose.
-
Make the visual checklist a gate from the contracts phase
Screenshots found rendering defects and two unbuilt features that unit tests had missed, and fixers should attach before-and-after captures from a build newer than HEAD.
-
Give every spec noun an owner
Path ownership kept the merges clean, and two features still fell between streams because no ownership row claimed them.
-
Budget the integrator for measurement
Per-subsystem debug switches in the build make A/B toggling cheap.
-
Size waves by CPU
Eight cores capped the run at six concurrent agents. I had planned for 16 on a Mac, and the next run goes on 16 to 32 cores or on cloud agents.
-
Promote surprises to traps before every fan-out
Every agent reports what surprised it, and the conductor folds those reports into the spec before the next wave. That worked once by hand and should become a step.
-
Stamp time from the clock and log tokens per phase
The conductor's estimates drifted by 15 to 25 minutes, so deadlines should be epochs and every phase should be metered.
-
Treat prompts as code
A single quote character in a prompt broke a workflow script's parse, which is how one apostrophe stopped a phase of a 161-agent run, and template literals or prompt files avoid it, with deadlines passed in as arguments.
-
Pre-approve the toolchain and warm new worktrees
Fresh worktrees resolved packages to the main checkout. An offline package fetch as a worktree post-create hook should fix it.
How to apply this to your own codebase
This was one run of one project based on learnings from prior projects, so the numbers are mine but I expect the learnings and new rules will help others. I’m certainly going to add them to mine. If you’re planning agent-driven delivery, talk to our team about how to improve yours.
Get our insights
Get the next post in your inbox, written by the team that shipped the work.
From the VGV unicorns







