Part 3 · Review Patterns

Agent-Assisted Code Review · ~7 min

The Committee Pattern

One big "find the bugs" prompt has one blind spot. Several narrow reviewers, run in parallel, have different ones — and that difference is the whole point.

Why this, for you: you already know one fat review prompt misses things. The fix is not a longer prompt — it is several scoped reviewers, each looking at one dimension, plus an orchestrator that aggregates their structured verdicts. Get the split and the aggregation right and the committee catches defects no single reviewer would.

A committee review routes a diff through multiple specialized reviewer agents in parallel — each evaluating a single dimension (correctness, security, test coverage) — then an orchestrator aggregates the verdicts and either accepts the output or routes feedback back to the implementer to revise.

1 Three roles, not one prompt

The pattern has exactly three roles, and the separation between the first two is what removes bias:

A single agent reviewing its own output shows confirmation bias — it agrees with decisions it already made. Separating the implementer and reviewer prompts removes that bias; domain-splitting the reviewers narrows each one's attention to a single concern.

Each reviewer returns structured output — JSON with a verdict and an issue list — so the orchestrator can triage programmatically instead of parsing prose. The mechanism behind the gain is attentional narrowing plus role-induced perspective: research on LLM peer-review simulation (EMNLP 2024) shows distinct reviewer personas reliably shift which defects they surface, so a security-scoped reviewer activates different reasoning than a correctness one on the same diff.

2 Why diversity beats one big prompt

Run the scoped reviewers in parallel and their error populations are largely non-overlapping. That is the load-bearing claim: the committee catches defects any single reviewer would miss precisely because the reviewers fail in different places.

A committee where every reviewer runs on the same model shares the same blind spots. Cross-model review assigns each reviewer to a different provider (GPT, Gemini, Claude) so the failure modes are independent — diversity in the panel, not just in the prompts.

Each reviewer should carry a single-focus system prompt, a structured output schema, and explicit pass criteria — what counts as PASS must be unambiguous. Crucially, give each reviewer only the diff, not the other reviewers' verdicts, so opinions stay independent. Focus the prompts on bugs, security, and logic; the Anvil agent deliberately excludes style from its review prompts to reduce noise.

# Two scoped reviewers — same diff, independent JSON verdicts CORRECTNESS: "Review for logic errors, off-by-one, bad assumptions. Return JSON: {verdict: PASS|FAIL, issues:[...]}. Do NOT comment on security/style." SECURITY: "Review for injection, auth bypass, secrets, insecure deserialization. Return JSON: {verdict: PASS|FAIL, issues:[{cwe}...]}. Do NOT comment on correctness/style." # Orchestrator: gather() in parallel, merge issue lists, dedupe by line, route FAILs back

3 Aggregate, scale by risk, and bound the loop

The orchestrator waits for all verdicts before aggregating. If any reviewer returns FAIL, the merged issue list goes back to the implementer to revise. Two controls keep the pattern from becoming a tax:

Scale the panel to risk. Reviewer count is not fixed — it tracks how much a change can hurt. File-level risk classification drives automatic escalation: a change to auth or data-deletion code triggers the high tier regardless of task scope.

RiskReviewersTrigger
Low0Typos, config, one-liners
Medium1Bug fixes, features, refactors
High3 (cross-model)Auth, crypto, payments, schema migrations

Bound the loop. Set a maximum round limit — two to three rounds covers most cases. If the implementer cannot satisfy all reviewers within the limit, escalate to human review. Unresolved loops signal an underspecified task or conflicting reviewer criteria, not a stubborn bug.

The committee backfires when the axes overlap

If two reviewers evaluate the same dimension — both correctness and security flagging the same auth logic from different angles — the orchestrator gets contradictory feedback that is harder to act on than one consolidated review. And on trivial changes the multi-reviewer overhead just costs more and finishes slower. Low-diversity axes (a "correctness" and a "bugs" reviewer that surface the same findings) mean aggregation dedupes most of the work and the pattern buys nothing.

4 The cloud variant: fan-out, verify, aggregate

The committee's iteration loop has a cloud cousin that swaps the accept/revise loop for a single posted artifact. Claude Code's /ultrareview launches "a fleet of reviewer agents in a remote sandbox" (ultrareview docs); Anthropic's managed GitHub Code Review runs the same shape as a webhook service. Multiple agents fan out over defect classes, then a step that is the whole difference:

Fan-out without verification amplifies noise — each agent contributes its own false positives and aggregation can't tell real findings from hallucinated ones. Verification reproduces each candidate against actual code behavior, turning a high-recall, low-precision fan-out into a high-precision output.

Then the orchestrator deduplicates surviving findings, ranks by severity, and posts one review with inline comments. The trade-offs are concrete: /ultrareview takes 5–10 minutes and typically costs $5–$20; managed Code Review averages ~20 minutes and $15–25, scaling with PR size and how many findings need verification. Cost scales with PR size and trigger mode, so push-triggered review on a long-running PR is the primary budget risk — use manual or once-per-PR triggers there. Tune severity, skip rules, and nit caps in REVIEW.md, which is injected into every agent in the pipeline as highest priority.

↪ Your win: a panel, not a paragraph

Retrieval practice — recall, don't peek

Question 1Separating the implementer and reviewer prompts primarily removes…

Question 2Why does a panel of scoped reviewers beat one big prompt?

Question 3In the cloud fan-out variant, the verification step exists to…

Question 4A change to authentication code should trigger…

Question 5 · spaced recall from an earlier lessonAn agentic review is best understood as…

Ask me anything. Want a concrete reviewer-prompt set for your stack, or help drawing the risk-to-reviewer-count line for your repo? Next: Reproduce Before Report — the verification step, made into a hard gate so plausible-but-false findings never reach a human.
✎ Feedback