← ~/pillars / multi-agent-orchestration / verification-topologies
Verification topologies
Fresh-context review, two-stage spec-then-quality checks, adversarial refutation, and how to calibrate a reviewer that will always find something.
updated 2026-09-07 ~5 min read pattern 02/06 Architecture & Orchestration
on this page
Context. An agent has produced work (a diff, a root-cause analysis, a migration) and you need to decide whether it is done. The longer the agent worked unattended, the more an independent check matters before you count it as done (best practices).
Forces. The implementing context cannot review itself: a model is biased toward code it just wrote. But an independent reviewer prompted to find gaps “will usually report some, even when the work is sound, because that is what it was asked to do”, and chasing every finding leads to over-engineering (best practices). Every review layer costs tokens and wall-clock time.
Resolution. Run review in a fresh context, structure it by question (spec first, quality second; one lens per reviewer), calibrate severity so only correctness and requirement gaps block, and automate the loop-until-dry with a verification condition the implementer cannot self-certify.
Why fresh context catches what self-review misses
The mechanism, as described in the best-practices documentation: “A reviewer running in a fresh subagent context sees only the diff and the criteria you give it, not the reasoning that produced the change, so it evaluates the result on its own terms” (best practices). No access to the implementer’s rationale means no anchoring to it. That is what surfaces the characteristic single-pass misses: requirements drift (the implementer rationalised away an edge case), scope creep (changes outside the task boundary), anchoring to a flawed initial approach, and the self-serving “it works, ship it” assessment.
The minimal form is the documented writer/reviewer pattern: session A
implements; session B reviews the named files for edge cases, race
conditions, and consistency with existing patterns; session A addresses the
feedback. The built-in /code-review skill is this pattern packaged: a
correctness-focused subagent review of the current diff.
Check that your reviewer is actually fresh
“In a subagent” stopped being a synonym for “in a fresh context”. Claude
Code’s built-in fork subagent type “inherits the entire conversation so
far instead of starting fresh”, and fork mode is on by default in
interactive sessions
(subagents). A fork asked to
review the work the parent just did is the self-review this whole topology
exists to avoid, wearing a subagent’s clothes, and the transcript looks the
same either way. Two consequences worth designing around:
- Name the reviewer. Definitions in
.claude/agents/are not run as forks, so an @-mentioned or--agent-selected reviewer still gets its own window. Every reviewer on this page should be a named agent, which is why the adversarial reviewer ships as a definition file rather than as a prompt to paste. - Local and headless now differ. Fork mode is off under
-pand in the Agent SDK unless you turn it on. The same instruction can therefore produce an isolated review in CI and an anchored one at your terminal, which is the wrong way round: the interactive case is where nobody is checking.
Two-stage review: spec, then quality
Run two separate reviewer invocations, not one:
- Spec review: check that every requirement is implemented, the listed edge cases have tests, and nothing outside the task’s scope changed.
- Quality review: bugs, race conditions, consistency with existing patterns.
Keeping them separate prevents conflating “did we build the right thing?” with “did we build it correctly?” A single combined reviewer drifts toward whichever question its first finding belongs to. A quality pass on code that fails spec review is wasted tokens; run spec first and gate on it.
One lens per reviewer, and adversarial refutation
A single reviewer gravitates toward one type of issue at a time. The countermeasure is domain partition: three parallel reviewers with explicitly orthogonal lenses: security implications, performance impact, test coverage (best practices). Each fresh context attends fully to its lens. This is the sectioning variant of parallelisation from Building effective agents; the same post’s voting variant (run the identical task several times and compare) fits high-cost-of-error checks where independent confirmations raise confidence.
For investigation rather than review, the documented structure is adversarial: spawn several teammates on competing hypotheses and “have them talk to each other to try to disprove each other’s theories, like a scientific debate” (agent teams). The rationale is anchoring bias: a single investigator’s analysis bends toward its first plausible theory, and a theory that survives active refutation by independent contexts is far more likely to be the real root cause. (Agent teams are experimental; the same shape works with sequential fresh-context subagents, trading wall-clock time for stability.)
Calibrating the reviewer
The caveat deserves repeating because it is the most common failure of this whole topology: a reviewer asked to find gaps will find gaps in sound work. The documented countermeasure is to tell the reviewer to flag only gaps that affect correctness or stated requirements, not style preferences (best practices). Two calibration rules worth adding on top, since no quantitative trust threshold is documented: require every finding to carry concrete evidence (file and line, plus a failure scenario or failing test), and require an explicit severity tag so non-blocking observations cannot quietly become rework. A finding without a failure scenario is an opinion. The adversarial reviewer artifact bakes both rules in.
Loop until dry
Verification as a one-off gate still relies on someone re-running it. Two
documented mechanisms close the loop
(best practices): /goal
sets a verification condition that a separate evaluator re-checks after every
turn (Claude keeps working until it holds), and a Stop hook runs your
check as a script and blocks the turn from ending until it passes (Claude
Code overrides the hook after 8 consecutive blocks, so it cannot loop
forever). The hook is the deterministic form: the implementer cannot
self-certify, because the gate is code. Wiring details are in
hooks as hard gates.
Worked example
A worker from the
orchestrator-worker
flow reports task T07 complete. The orchestrator dispatches the
adversarial reviewer in a fresh
subagent: spec text inline, the changed-files list from HANDOFF-T07.md, and
an instruction to verify independently: re-run the tests, do not trust the
report. Stage one returns one MISSING requirement (a documented edge case
with no test) and two non-blocking observations; only the MISSING finding
goes back to an implementer dispatch, the observations are recorded and
dropped. Stage two, after rework, returns no blocking findings, and the
verdict line, not the implementer’s claim, flips the task to complete. For
PR-shaped work, the same trio of domain reviewers runs headless in CI via the
fan-out review workflow.