Running coding agents in parallel works when the tasks don’t touch the same files and you can review what comes back. Give each agent its own git worktree and branch, split work by area, write down which shared files each one may touch and how, assign separate ports, and merge one branch at a time with the full test suite after each merge. Review stays the bottleneck.
This site was rebuilt that way in November 2026. I asked for parallel mode, and a controller agent ran it: five implementer agents in five worktrees at the peak, then four more in parallel for the final fixes. This post covers the setup, the rules that kept the merges boring, what still went wrong, and the tools that now package this workflow.
Is running coding agents in parallel worth it for a small team?
Yes, when the work splits into independent pieces and someone has time to review each piece. No, when the work is one tangled change, or when nobody reviews.
The speed-up comes from waiting less. One agent implementing a task can take a long time, and while it runs you can’t do much with that checkout. With five worktrees, five tasks move at once and you spend your time reviewing and merging. Paul Malaj, one of Hub’s makers, put it plainly in the Product Hunt launch comments: “for one quick fix it costs about the same as plain Claude Code; it pays off on parallel work and on you not babysitting.” He also said hardware is rarely the limit while agents only write code, since each session is a CLI process, until they all run heavy test suites or builds at once.
The cost is real too. Claude Code’s own docs warn that running several sessions at once multiplies token usage. In the final review of this site, three of the four parallel reviewer agents hit the weekly usage limit and the controller had to dispatch them again. Budget for that.
How did this site get built with parallel agents?
The rebuild started from a written plan of about 2,200 lines, split into 15 tasks, with the exact code, values and tests for each task. A controller session dispatched one implementer agent per task and then a separate reviewer agent, with up to five fix rounds per task. The first seven tasks ran one after another, because they laid down the foundations: scaffold, i18n helpers, JSON-LD, design tokens and layout, content collections, home page, inner pages.
On November 23 I asked the controller to switch to parallel mode for the next batch. It created five worktrees off one base commit, each on its own branch with its own preview port. Each task ran on a named model:
| Worktree | Task | Model | Port |
|---|---|---|---|
| A | Console and command palette | Opus | 4331 |
| B | Blog engine and feeds | Opus | 4332 |
| C | Fetch proxy and contact form (Pages Functions) | Sonnet | 4333 |
| D | Browser tools | Opus | 4334 |
| E | GEO files, OG images, headers | Sonnet | 4335 |
The fix round for Task 7 kept running in the main checkout at the same time, so six agents were editing code at once. Each branch was merged into the integration branch only after its review was clean. After the merges, the final review ran as four parallel reviewers, one per area (security, frontend, SEO, tooling and CI), and the fixes ran as four more parallel worktrees. The site went live on November 25.
How do you split work so parallel agents don’t collide?
Split by area of the codebase, not by layer, and write down who owns what. The parallel tasks above were picked because each one mostly lived in its own folders.
Then name the files every task will want to touch. For this site that list was the base layout, the i18n strings file, the JSON-LD builders, package.json, the Astro config and the global CSS. The instruction to every agent was:
- Keep edits to shared files minimal and additive.
- Append new i18n keys at the end of each locale block.
- Add imports and mounts in one small place.
- Don’t reformat or reorder existing code.
Also tell each agent what is changing elsewhere at the same time, and that it must not build those things itself. The main branch was adding a breadcrumb helper while the five worktrees ran, so the brief said, in effect: this is coming, don’t implement it, use the existing function.
Put all of that in one short addendum that every parallel agent reads on top of its task brief. This is the shape of the one used here, with the project details swapped for placeholders:
Parallel worktree rules (override the general instructions where they differ)
- Work ONLY inside your worktree: <path>. Never touch the main checkout or other worktrees.
- First step: run the install command (node_modules is not shared).
- Commit to your branch. Never push or merge; the controller merges.
- Ports: preview on <P> only. Local functions server on <P + 4460>. Kill your own servers when done.
- Shared files other tasks also edit: <list>. Keep edits minimal and additive:
append i18n keys at the END of each locale block, add imports in one place,
don't reformat or reorder existing code.
- Arriving on main while you work: <changes>. Don't implement these yourself.
- If anything is unclear, stop and report NEEDS_CONTEXT. Don't guess.
For the final fix wave, ownership got strict. Each dispatch listed the files that agent owned. If a fix needed a file it didn’t own, the agent had to stop and say so in its report instead of editing it. The one exception was the i18n file, append only.
What do git worktrees isolate, and what don’t they?
Git worktrees isolate files and the checked-out branch. Each worktree has its own HEAD and index; refs and objects are shared through the one .git directory. Git also refuses to check out a branch that’s already checked out in another worktree, which is a useful guard.
Everything else is shared, and this is where parallel agents step on each other:
| Shared resource | What goes wrong | Fix |
|---|---|---|
node_modules and other gitignored files |
A fresh worktree has none | npm ci as the first step in every worktree |
.env files |
Missing in new worktrees | Copy them in, or use Claude Code’s .worktreeinclude |
| Dev and preview server ports | Two agents bind the same port, tests hit the wrong server | One assigned port per worktree (4331 to 4335 here), and a fixed offset for any second server |
| Running processes | An agent kills “stale” node processes that belong to another agent | Rule: kill only your own processes, never other node processes |
| Local databases and caches | Tests in one tree corrupt fixtures in another | Separate test databases per worktree if your tests write |
| Model usage quota | Everything slows or stops at once | Expect it; stagger reviewers |
Setting up the trees by hand is three commands per task:
# one worktree per task, all from the same base commit
BASE=$(git rev-parse HEAD)
for t in console blog functions tools geo; do
git worktree add "../site-wt/$t" -b "task/$t" "$BASE"
done
git worktree list
# when a branch is merged
git worktree remove ../site-wt/blog
git branch -d task/blog
git worktree prune
If you use Claude Code, claude --worktree <name> creates the tree under .claude/worktrees/ on a branch named worktree-<name>, and a custom subagent with isolation: worktree in its frontmatter always gets its own tree (docs). Two details matter for parallel work. New worktrees branch from the repository’s default branch, not your current branch, unless you set worktree.baseRef to "head". And gitignored files such as .env don’t count as work when Claude decides whether to remove a worktree, so you can lose them on exit.
Who reviews all of it?
You do, plus reviewer agents that you set up to be skeptical. More agents means more diffs waiting for a human. I cover the human side of this in reviewing AI-written pull requests and when developers become reviewers.
What worked on this site was two layers of review, both run by agents:
- A task review after each task. A fresh agent got the task brief, the project rules, the implementer’s report and the diff. Its instructions were to treat the report as unverified claims, check them against the diff, stay read-only and not crawl the codebase. Findings were graded Critical, Important or Minor with a file and line for each. Minors could be deferred, and every deferred item went into a list.
- A whole-branch review by area after the merges. Four reviewers looked at integration bugs between tasks, security, accessibility and spec drift, and triaged the deferred list into “fix before launch” or “fine to defer”.
The second layer earned its cost. The contact form task had verified email sending under wrangler pages dev locally, decided no fallback was needed, and passed its task review. The whole-branch security review found that the email binding it relied on isn’t supported on Cloudflare Pages in production. The fix was a small separate mail Worker called through a service binding. Passing under a local emulator only shows that the emulator accepts it, and a reviewer who sees one task’s diff has no reason to doubt it.
Plan review is the other half. An unclear brief gets you confident wrong code, which is slow to review. Here the plan carried exact code and tests, and the implementer instructions said to stop and report “needs context” instead of guessing.
How do you merge parallel branches without chaos?
One branch at a time, with the full suite after each merge. Every conflict the controller hit was in a shared file listed up front: the i18n strings file in three of the five merges, plus the contact page, the base layout and the home page once each. Because the rules said “append at the end”, the i18n conflicts were two blocks of new keys, and the fix was to keep both.
The more interesting failure was not a text conflict. After the contact form branch merged, astro check failed in the OG image endpoint. That branch brought in the Cloudflare Workers types, and with them the endpoint’s Uint8Array response body no longer matched BodyInit. Neither branch was wrong alone. A short integration fix sorted it out, and that’s why the suite runs after every merge, not just at the end. The unit test count went from 137 to 152 to 214 across the merges, and the final integration pass ran 298 unit tests, a production build and the end-to-end suite before launch.
What else went wrong?
- One implementer (on the end-to-end tests and CI task, which ran after the parallel batch) stalled, hit the 600-second watchdog and left uncommitted work. The controller resumed it with two new rules: put timeouts on long-running commands and commit early.
- Usage limits stopped three of the four final reviewers mid-review, as mentioned above, so the review took two dispatches.
- In a later round of work on this site, one implementer reported end-to-end failures that turned out to be environment noise. The controller re-ran the full suite itself (132 passed) before accepting or rejecting the claim. Treat an agent’s test report as unverified until something you trust re-runs it.
Which tools help run parallel coding agents?
You can do all of this with git and a terminal per agent. As of November 29, 2026, these tools package parts of it:
| Tool | What it does | Worth knowing |
|---|---|---|
| Claude Code | --worktree, subagents with isolation: worktree, agent view for background sessions, /batch to split one change into 5 to 30 worktree subagents |
Agent teams are experimental and don’t isolate teammates in worktrees |
| T3 Code | Open-source control plane for Claude Code, Codex, Cursor, OpenCode and other agents, on desktop, web and phone | Each thread can work in its own worktree; MIT licensed; about 83.5k GitHub stars |
| Hub | A coordinator session hands tasks to short-lived executor sessions in separate worktrees; you get only the decisions | Runs sessions in bypassPermissions mode and has no sign-in unless you set a password; read its security notes first |
| Plannotator | Opens an agent’s plan in the browser for annotation and approve/deny, and a diff view for code review | Puts the human check at the plan, before code exists |
If you run Hub or anything else with permission prompts off, isolate the machine and keep your credentials away from it. I wrote about that in coding agents without your keys and showed one containment pattern in Smi.
What I’d do this week
- Pick two or three tasks that live in different folders. Don’t start with five.
- Write a short brief per task: goal, files it owns, shared files and the rule for each (append only, one import line), what’s changing elsewhere, and “stop and ask if unclear”.
- Create one worktree per task from the same base commit. Run your install step in each and copy env files.
- Give each worktree its own port and, if tests write data, its own database.
- Require a short report from each agent: status, commits, test summary, concerns.
- Review each task with a fresh, read-only reviewer that gets the brief and the diff, then review it yourself.
- Merge one branch at a time and run the full suite after each merge.
- Before release, do one review across the whole branch by area. That’s where cross-task bugs show up.
If you want help setting up this kind of workflow for your team, including the review gates, that’s the kind of work I do as a fractional CTO.