prcodereview Guides · by the Mergestorm team Try it free on a PR

Guides · Practice

Code review agent orchestration

12 Sep 2026 · Updated 28 Nov 2026 · ~10 min

Written by the Mergestorm team.

Updated 28 Nov 2026: an earlier version of this guide described Mergestorm’s Vortex as one router dispatching a Core generalist and seven same-model specialist lanes. Mergestorm has since replaced that design with independent reviews by different models, and the review sections below describe what replaced it. The reasoning is in Swarm vs fleet: why we stopped hiring specialist code review agents.

Code review agent orchestration starts after you choose a review loop. The loop decides when to run one reviewer or several; AI agent orchestration decides how those reviewers are combined, how findings reach a coding agent, and how independent fixes land without ten agents editing one checkout.

This is the sequel to How to structure an AI PR review loop. The useful shape is smaller than it sounds: a few independent reviewers, one merge step, one findings channel, and temporary worktrees for patches that can proceed independently.

Code review agent orchestration: independent reviewers and a merge step

Orchestrating reviewers does not mean many copies of one model rereading the same diff. It means a small number of different models reviewing the same diff on their own, then one step that turns their output into a single review.

With two reviewers, the merge step folds near-duplicates together and posts everything else. It may merge two findings into one; it never drops one. With three, you can add a vote: post only what at least two reviewers agree on, and drop the rest as likely noise. Keep two things out of the vote. Notes that need a human decision should be posted whatever the count, and a file only some reviewers read cannot be outvoted by the ones that did not.

It used to be routing. Now it is a vote.

The earlier version of this guide said the opposite. Mergestorm’s Vortex used to run a router that hired up to three (standard) or five (max) of seven topic specialists — security, performance, architecture, tests, data, API and frontend — next to a Core generalist, all on the same model with different role prompts, at one credit per lane.

Then Mergestorm measured it. On its 50-PR offline bench (173 known bugs in the answer key), the specialists added 5–11 known bugs on top of one Core review. A second Core review by a different model added 20–28. In a separate check on five real PRs, about 45% of specialist findings fell outside the specialist’s own lane, and the lanes overlapped on the PR’s biggest bug. Routing by topic bought little, because the same model behind a different prompt mostly saw the same things.

Orchestration is not “more agents.” It is less duplicated work, clear ownership, and a controlled route from finding to patch.

Tune the number of models, not the roster

Since 21 Nov 2026 Vortex reviews with one model by default, for one credit. On paid plans, swarm is an account setting with two levels: normal runs two different models in parallel and posts every finding, near-duplicates merged (2 credits); max runs three and posts only findings at least two agree on — the same finding after the merge, or the same file within 5 lines (3 credits). If a model does not finish within its time budget the review goes on without it, its credit is not charged, and the summary says how many models reviewed. Swarm runs only on a PR’s first review; later pushes get one follow-up model.

From the CLI:

Close the loop: MCP findings become patches

A set of reviewers is only half a system. The next step is a machine-readable handoff: submit a review, wait for completion, retrieve structured findings, let the coding agent verify each one against the checkout, and apply the smallest correct patches.

An MCP server is a practical boundary here, and Mergestorm has two ways in. The hosted MCP server — sign in with OAuth, no API key; it works from Claude and ChatGPT and is listed in the official MCP registry — covers PR reviews, stacks, the merge queue and settings.

Reviewing a local branch needs the checkout, so that still runs through the mg CLI or the local mergestorm-mcp server, which authenticates with mg login or MERGESTORM_API_KEY. Its review_submit takes a swarm option. For Claude Code, installation can be as short as claude mcp add mergestorm -- npx -y mergestorm-mcp. Cursor can run the same npx -y mergestorm-mcp command from its MCP configuration. The point is not the client: it is that the coding agent can pull findings without copying comments between tools.

Context Who reviews Who writes the patch
GitHub PR Vortex posts inline findings Cyclone can push mechanical patches to the PR branch
Local branch mg review or MCP uses the same review engine The IDE coding agent applies verified MCP findings
High-risk change Swarm adds a second and third model on the first review Human-directed patching follows the agreed findings

Keep those roles precise. Vortex reviews every pull request, and can review a GitHub issue before code is written. Cyclone fixes what review finds, and can fix merge conflicts and red CI. Swarm’s extra models are part of Vortex, not separate agents. Maelstrom is a plan name, not an agent. For the broader division of labor, read What is AI PR review?

Parallel worktrees on one machine

Once findings are independent, temporary git worktrees let several coding agents patch in parallel without sharing an index, working tree, or uncommitted files. Create one short-lived branch and worktree per patch group: security fixes in one, tests in another, frontend in a third.

Coding agents applying separate review fixes in temporary git worktrees
Parallel patches: one repo, three temporary worktrees — security, tests, and API isolated so agents do not share a working tree.

Group by files and dependency boundaries, not simply one finding per agent. Two findings that modify the same function belong together. After each agent tests its branch, integrate in dependency order, resolve the few remaining conflicts centrally, and run the complete suite once on the assembled result.

Worktrees are a general git pattern, not a Mergestorm feature. One useful interaction is that linked worktrees share Mergestorm CLI stack state; independent clones do not. If the changes naturally form a stack, mg stack create, submit, and land can manage that sequence. Do not confuse parallel editing with parallel merging.

Design for failure, not just fan-out

Parallel patching needs an exit rule. Give each agent a narrow finding set, the relevant tests, and permission to return “no safe patch.” A failed test or ambiguous requirement should produce a report, not a speculative rewrite. Time-box branches that stop making progress and remove their worktrees after preserving any useful commit.

Also record which review finding produced each patch. That small trace makes integration review much easier: a human can compare the evidence, proposed correction, and resulting behavior without reconstructing the conversation. If two branches solve the same root cause differently, stop and choose one before merging either. Git can combine text; it cannot decide which invariant the product intended.

Finally, cap concurrency. Ten reviewers can inspect in parallel because they mostly read. Ten patchers may compete for CPU, package caches, test databases, ports, and memory. Start with two or three independent patch worktrees, measure the machine’s bottleneck, and increase only when test reliability stays stable.

CLI and skills are glue, not governance

A small agent skill can encode the safe loop: review the local branch over MCP, verify findings, patch, test, then resubmit on the same branch so the review thread chains. Mergestorm’s mergestorm-review skill follows that shape. Its defaults are to omit swarm so the account setting applies, use off for tiny diffs, and run max only on an explicit request.

The skill should not push, merge, or land. Nor should local review request Governance: that feature belongs to long GitHub follow-up sequences, not local review. mg review reviews a local git diff without opening a PR, uses the same engine as PR review, and costs one credit per model.

What still needs a human

Agents can divide inspection and mechanical repair. They do not own product intent, acceptable risk, rollout timing, or whether the PR is the right change. A reviewer still has to decide whether a finding is true, whether a “fix” changes behavior, and whether independently clean patches compose safely.

Use the PR review checklist at the final integration boundary. That is where orchestration stops being a set of successful subtasks and becomes one shippable change.

A setup you can steal

  1. Review the first head with one model, or two or three different models when the diff is risky; let the merge step and, at three, the vote decide what is posted.
  2. Retrieve findings through MCP and have the coding agent reproduce or verify each one before editing.
  3. Cluster accepted fixes by overlapping files and dependencies.
  4. Create a temporary branch and worktree for each independent cluster; assign one coding agent to each.
  5. Test each patch locally, integrate in dependency order, then run the repository-wide checks.
  6. Resubmit review on the assembled branch. Keep the human approval gate.

Preflight checklist

That is the practical promise of orchestration: not autonomous approval, but a review-and-patch system with explicit steps, isolated edits, and a final accountable owner. For a simpler starting point before building the system, see what AI code review should flag on a pull request.