Task Statement 4.6·Domain 4 — 20% of exam
Multi-Instance and Multi-Pass Review
Design multi-instance and multi-pass review architectures
Official Exam Guide Objectives
Task 4.6: Design multi-instance and multi-pass review architectures
Knowledge of
- Self-review limitations: a model retains reasoning context from generation, making it less likely to question its own decisions in the same session
- Independent review instances (without prior reasoning context) are more effective at catching subtle issues than self-review instructions or extended thinking
- Multi-pass review: splitting large reviews into per-file local analysis passes plus cross-file integration passes to avoid attention dilution and contradictory findings
Skills in
- Using a second independent Claude instance to review generated code without the generator's reasoning context
- Splitting large multi-file reviews into focused per-file passes for local issues plus separate integration passes for cross-file data flow analysis
- Running verification passes where the model self-reports confidence alongside each finding to enable calibrated review routing
What You Need to Know
A model asked to review what it has just written is not approaching the work neutrally — it still holds the reasoning that produced it, and reasoning it has already justified is reasoning it is inclined to defend. That is not a defect to prompt around. It is a property to design around.
The Self-Review Limitation
Within one session, the chain that produced the output is still present: why each approach was taken, why a finding was rated where it was, why particular values were selected. Asked to review, the model reads its own justifications alongside the output, and confirmation is the path of least resistance.
An independent instance — a separate invocation carrying none of that history — has only the artefact to go on. It evaluates the code, the findings, the extraction as they stand, with no prior commitment to explain away. That absence of context is precisely what makes it better at finding what the first pass missed.
The exam tests this directly. Offered a set of ways to improve review quality, the option that scores is the one that moves the review to a separate instance. Instructing the same session to take more care, or giving it more room to think, both leave the justifications in place — and those are the problem.
// Anti-pattern: self-review in the same session
const generation = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 4096,
messages: [
{ role: "user", content: "Write a function to process orders" },
{ role: "assistant", content: generatedCode },
{ role: "user", content: "Now review your code for bugs" }
// Model retains its reasoning — less likely to find its own mistakes
]
});
// Correct: independent review instance
const review = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 4096,
messages: [
{
role: "user",
content: `Review this code for bugs, security issues, and edge cases:\n\n${generatedCode}`
}
// Fresh instance — no prior reasoning context
]
});Multi-Pass Review Architecture
Put a multi-file PR, a broad audit or a long extraction through one pass and attention dilution sets in. It announces itself the same way every time:
- Close, specific commentary on some files and summaries on others
- Plain defects passed over somewhere in the middle of the set
- The same construct raised as a problem in one file and accepted without comment in another
Splitting the work into passes that each answer one kind of question resolves it:
Pass 1: Per-file local analysis. One file per invocation, reviewed on its own terms. Because nothing else is competing for the budget, the depth of the tenth file matches the depth of the first.
Pass 2: Cross-file integration. With the per-file work complete, a further pass receives those findings and looks for what only exists between files: data flowing between modules, API usage that diverges across services, dependency conflicts, and disagreements among the findings themselves.
// Pass 1: Per-file analysis
const perFileFindings = await Promise.all(
files.map(file =>
client.messages.create({
model: "claude-sonnet-5",
max_tokens: 4096,
messages: [{
role: "user",
content: `Review this file for local issues (bugs, security, logic errors):\n\n${file.content}`
}]
})
)
);
// Pass 2: Cross-file integration
const integrationReview = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 4096,
messages: [{
role: "user",
content: `Given these per-file findings, identify cross-file issues:\n` +
`- Data flow inconsistencies between modules\n` +
`- Contradictory patterns flagged in different files\n` +
`- API contract violations across service boundaries\n\n` +
`Findings:\n${JSON.stringify(perFileFindings)}`
}]
});Each symptom maps onto a part of this. Uneven depth disappears because no file shares its pass. Cross-file problems get found because one pass exists to look for nothing else. Contradictions surface rather than shipping, because comparing the findings is now an explicit step.
Why Larger Context Windows Do Not Fix This
One distractor recurs: move to a higher-tier model with a larger context window. It follows naturally — if 14 files will not fit comfortably, supply more room. But capacity was never what failed. Attention distributes unevenly across whatever is present, and a larger window changes how much can be present rather than how evenly it is treated. The fall-off simply begins later. Only giving a file a pass of its own guarantees it a full share.
Confidence-Based Routing
Where a finding is uncertain, the model can attach its own confidence to it, which makes routing possible:
- High confidence findings: go straight to the developer
- Low confidence findings: divert to a person before anyone acts on them
- Threshold calibration: decide where that line sits by measuring reported confidence against known-correct answers
{
"finding": "Potential race condition in order processing",
"severity": "major",
"confidence": 0.65,
"reasoning": "The lock acquisition pattern appears correct but the unlock timing depends on an async callback whose ordering I cannot fully verify.",
"route": "human_review"
}What that number reports is the model's sense of its own certainty, which is not the same thing as its accuracy. The two only become related through measurement: run examples whose answers you already know, observe how the reported confidence tracks correctness, and set the routing threshold from what you observe.
That measurement is the whole distinction the exam draws — between a raw score, which is uncalibrated and unfit to automate against, and a calibrated threshold validated on labelled data. Automating decisions on the former is an anti-pattern.
Putting It All Together
A production review architecture combines all three concepts:
- Generation: the first instance produces the code, extraction or analysis
- Per-file review: each unit is examined by an instance holding nothing but that unit
- Integration review: a further instance looks only for what sits between units
- Confidence routing: whatever falls below the threshold reaches a person
- Calibration loop: labelled data keeps that threshold honest as the system changes
It costs more than reviewing once, and the question is what a missed issue costs by comparison. Where the review gates a CI/CD pipeline, financial extraction or compliance analysis, what escapes it goes downstream — and the extra passes are cheap against that.
Deep Dive
Official guidance: fresh context is the mechanism, not a heuristic
Anthropic's own best-practices documentation states the principle this lesson teaches as settled guidance, not a tip: "A fresh context improves code review since Claude won't be biased toward code it just wrote." This is offered as one of several "quality-focused workflows" enabled by running multiple sessions — the exam's "independent instance" requirement is a direct restatement of this documented pattern, not an inference from first principles.
Sourcecode.claude.com › best-practicesfetched 2026-07-30
The Writer/Reviewer session pattern
The concrete architecture the docs describe: "use a Writer/Reviewer pattern... You can do something similar with tests: have one Claude write tests, then another write code to pass them." One session (or instance) generates the artefact; a second, separately-initialised session reviews it; the first then addresses the feedback. This is a two-instance loop, not a three-stage pipeline — the reviewer's only job is to evaluate, never to have also produced the thing it is evaluating.
Sourcecode.claude.com › best-practicesfetched 2026-07-30
Adversarial review sees only the diff and the criteria
Before treating work as done, the docs recommend a review step that deliberately withholds the generating reasoning: "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." This is the precise mechanism behind why self-review under-performs — it isn't that the same model is "worse," it's that it has extra information (its own justification) that a genuinely fresh reviewer never receives, and that extra information biases it toward confirmation.
Sourcecode.claude.com › best-practicesfetched 2026-07-30
Verification by a second opinion that tries to refute the result
The docs describe a specific pattern for high-stakes verification: "a verification subagent or a dynamic workflow that checks its own findings has a fresh model try to refute the result, so the agent doing the work isn't the one grading it." The framing — trying to refute, not merely re-confirm — is stronger than a neutral second look; it's an adversarial stance that surfaces the subtle issues a confirmatory pass would skate past.
Sourcecode.claude.com › best-practicesfetched 2026-07-30
Subagent context isolation is the architectural primitive underneath
The independent-instance pattern rests on the same isolation property that makes subagents useful generally: "subagents use their own isolated context windows, and only send relevant information back" to the coordinator. An independent review instance is this same primitive applied to review specifically — it never inherits the generating session's conversation history, so it cannot be biased by reasoning it never saw.
Sourceclaude.com › building-agents-with-the-claude-agent-sdkfetched 2026-07-30
LLM-as-judge is explicitly the weakest verification method
The Agent SDK guidance ranks verification methods and places model-judges-model near the bottom: "Verification via LLM-as-judge... is generally not a very robust method, and can have heavy latency tradeoffs." This matters directly for confidence-based routing in this task statement — a raw, self-reported confidence score is a form of the model judging itself, which is exactly the weak pattern this guidance warns against. It is one more reason routing thresholds must be calibrated against labelled data rather than trusted as reported.
Sourceclaude.com › building-agents-with-the-claude-agent-sdkfetched 2026-07-30
Calibration method: evaluate the end state with a rubric, starting small
Anthropic's multi-agent research system describes the calibration workflow this task statement's confidence-routing skill depends on. First, judge outcomes, not process: "Instead of judging whether the agent followed a specific process, evaluate whether it achieved the correct final state." Second, use a structured rubric rather than free-form grading: "an LLM judge that evaluated each output against criteria in a rubric: factual accuracy, citation accuracy, completeness, source quality, and tool efficiency." Third, start small — "about 20 queries representing real usage patterns" is enough to see the impact of a change — and keep a human in the loop regardless of automation, because "people testing agents find edge cases that evals miss."
Sourceanthropic.com › multi-agent-research-systemfetched 2026-07-30
Quick Reference
| Item | Value / rule |
|---|---|
| Documented principle | "A fresh context improves code review since Claude won't be biased toward code it just wrote" |
| Writer/Reviewer pattern | Session A generates → Session B reviews (fresh) → Session A addresses feedback |
| What an adversarial reviewer sees | Only the diff and the review criteria — never the generating reasoning |
| Verification-by-second-opinion goal | A fresh model actively tries to refute the result, not just re-confirm it |
| Architectural basis for independence | Subagent context isolation — isolated context windows, no inherited history |
| Weakest documented verification method | LLM-as-judge — "not a very robust method," heavy latency tradeoffs |
| Attention dilution symptoms | Inconsistent depth, missed middle-file bugs, contradictory findings |
| Fix for attention dilution | Per-file passes + a separate cross-file integration pass — NOT a bigger context window |
| Why bigger context windows don't fix it | The problem is attention quality, not context capacity |
| Confidence-routing rule | High confidence → direct report; low confidence → human review |
| Raw self-reported confidence | Uncalibrated — a form of the model judging itself |
| Calibration method | Compare reported confidence against labelled validation sets, not intuition |
| Evaluation judging principle | Judge whether the correct final state was reached, not whether a specific process was followed |
| LLM-judge rubric example | Factual accuracy, citation accuracy, completeness, source quality, tool efficiency |
| Starting eval set size | ~20 representative queries is enough to see the impact of a change |
| Manual testing | Still essential even with automated evals — catches edge cases evals miss |
Exam Traps
Practice Scenario
A pull request modifying 14 files receives inconsistent review: detailed feedback on some files, superficial comments on others, obvious bugs missed, and contradictory findings — the same pattern is flagged as problematic in one file but approved in another. How should you restructure the review?
Build Exercise
Build a Multi-Pass Code Review System
Difficulty: Advanced (3/4)
60 minutes
- Create a single-pass review prompt and run it against a 10-file mock PR — document instances of inconsistent depth, missed issues, and contradictory findings
Why: Establishing the single-pass baseline demonstrates the three symptoms of attention dilution: inconsistent depth across files, missed bugs in the middle of the review, and contradictory findings flagging the same pattern differently in different files.
You should see: Detailed feedback on some files (typically first and last) but superficial comments on others, at least one obvious bug missed in a middle file, and at least one contradictory finding where the same code pattern is flagged as problematic in one file but approved in another.
- Implement per-file local analysis: iterate over each file with a focused review prompt that examines only that file for bugs, security issues, and logic errors
Why: Per-file analysis ensures every file receives consistent, focused attention. Each invocation examines only one file, eliminating the attention dilution that causes inconsistent depth and missed bugs in single-pass reviews.
You should see: Consistent review depth across all 10 files. Bugs that were missed in the single-pass review should now be caught, especially those in the middle files. Each review should be focused and thorough.
- Implement a cross-file integration pass: feed all per-file findings into a separate prompt that checks for data flow inconsistencies, contradictory findings across files, and API contract violations
Why: Per-file analysis catches local issues but misses cross-file concerns: data flow between modules, consistent API usage, and contradictions in per-file findings. The integration pass is a separate invocation that receives all findings and checks for systemic issues.
You should see: A synthesis output identifying cross-file issues that no single-file review could catch: data passed between modules in incompatible formats, contradictory findings from per-file reviews, and API contracts violated across service boundaries.
- Add confidence scoring to each finding (0.0-1.0) and implement routing: high confidence findings go directly to the developer, low confidence findings go to a human review queue
Why: Confidence-based routing directs limited human reviewer attention to the findings that need it most. The exam distinguishes raw uncalibrated confidence from calibrated thresholds validated against labelled sets.
You should see: Each finding annotated with a confidence score, reasoning for the score, and a routing decision (direct_report or human_review). The routing threshold should separate clear-cut findings from uncertain ones.
- Use a separate Claude instance (fresh session, no prior context) to review a subset of the generated findings and compare its assessment to the original confidence scores for calibration
Why: Independent review instances approach output fresh without the bias of I chose this because reasoning. This step calibrates confidence thresholds by comparing self-reported confidence against independent assessment, the method the exam identifies as the correct approach.
You should see: A calibration dataset showing the relationship between reported confidence scores and independent verification results. Some high-confidence findings may be overturned, revealing calibration gaps that adjust your routing thresholds.
Sources
- Claude Certified Architect Foundations Exam Guide — Task Statement 4.6 — Anthropic
- Prompt Engineering Overview — Anthropic
- Building with Claude API (Skilljar) — Anthropic
- Claude Code Best Practices — Anthropic
- Building Agents with the Claude Agent SDK — Anthropic
- How We Built Our Multi-Agent Research System — Anthropic
Appendix A — Build Exercise Step Hints
Progressive hints revealed by the "Stuck? Get a nudge" control on each step.
Step 1. Create a single-pass review prompt and run it against a 10-file mock PR — document instances of inconsistent depth, missed issues, and contradictory findings
Why: Establishing the single-pass baseline demonstrates the three symptoms of attention dilution: inconsistent depth across files, missed bugs in the middle of the review, and contradictory findings flagging the same pattern differently in different files.
You should see: Detailed feedback on some files (typically first and last) but superficial comments on others, at least one obvious bug missed in a middle file, and at least one contradictory finding where the same code pattern is flagged as problematic in one file but approved in another.
Stuck? Get a nudge
Step 2. Implement per-file local analysis: iterate over each file with a focused review prompt that examines only that file for bugs, security issues, and logic errors
Why: Per-file analysis ensures every file receives consistent, focused attention. Each invocation examines only one file, eliminating the attention dilution that causes inconsistent depth and missed bugs in single-pass reviews.
You should see: Consistent review depth across all 10 files. Bugs that were missed in the single-pass review should now be caught, especially those in the middle files. Each review should be focused and thorough.
Stuck? Get a nudge
Step 3. Implement a cross-file integration pass: feed all per-file findings into a separate prompt that checks for data flow inconsistencies, contradictory findings across files, and API contract violations
Why: Per-file analysis catches local issues but misses cross-file concerns: data flow between modules, consistent API usage, and contradictions in per-file findings. The integration pass is a separate invocation that receives all findings and checks for systemic issues.
You should see: A synthesis output identifying cross-file issues that no single-file review could catch: data passed between modules in incompatible formats, contradictory findings from per-file reviews, and API contracts violated across service boundaries.
Stuck? Get a nudge
Step 4. Add confidence scoring to each finding (0.0-1.0) and implement routing: high confidence findings go directly to the developer, low confidence findings go to a human review queue
Why: Confidence-based routing directs limited human reviewer attention to the findings that need it most. The exam distinguishes raw uncalibrated confidence from calibrated thresholds validated against labelled sets.
You should see: Each finding annotated with a confidence score, reasoning for the score, and a routing decision (direct_report or human_review). The routing threshold should separate clear-cut findings from uncertain ones.
Stuck? Get a nudge
Step 5. Use a separate Claude instance (fresh session, no prior context) to review a subset of the generated findings and compare its assessment to the original confidence scores for calibration
Why: Independent review instances approach output fresh without the bias of I chose this because reasoning. This step calibrates confidence thresholds by comparing self-reported confidence against independent assessment, the method the exam identifies as the correct approach.
You should see: A calibration dataset showing the relationship between reported confidence scores and independent verification results. Some high-confidence findings may be overturned, revealing calibration gaps that adjust your routing thresholds.
Stuck? Get a nudge
Appendix B — Interactive Study Prompts
Two prompts to paste into Claude. B1 drills the judgement the exam actually measures; B3 reviews the code you wrote for the Build Exercise above. The exam simulator between them is the interactive quiz on this page.
B1. Concept Check — Discrimination Drill
You are examining me for the Claude Certified Architect – Foundations (CCAR-F) exam, Domain 4: Prompt Engineering & Structured Output (20% of the exam), Task Statement 4.6: Multi-Instance and Multi-Pass Review. Use British English throughout.
What this exam actually measures. Not one item on the official exam asks what something is. Every item drops you into a production system that is already misbehaving, offers four defensible engineering responses, and asks which is best. The skill being tested is proportionality: fix the root cause with the cheapest instrument that gives the guarantee the situation demands. So do not quiz me on definitions. Make me choose between options that are both defensible, then attack whatever I chose.
How to run this session.
- One question at a time. Stop and wait. Never answer your own question, and never move on until I have committed.
- Never reveal which option is right before I commit to one.
- Do not praise me. A correct answer earns "Yes" and the next question. If I am right for the wrong reason, say so — that is the failure that costs marks on exam day.
- When I am wrong, quote the exact phrase in my answer that gave it away, correct it in one sentence, and move on. One correction at a time.
- If I write something fluent but empty, name it: "That is a restatement, not a reason."
- Set every scenario inside one of the exam's production contexts: Structured Data Extraction (pulling fields out of unstructured documents, validating them against a JSON schema, handling edge cases, feeding a downstream system) or Claude Code for Continuous Integration (automated review on pull requests, generated tests and PR feedback, with false positives to keep down).
Session plan — about twelve questions.
Round 1 — Anchor (1 question). One concrete question to check I have actually read the material. If I cannot answer it, stop the session and tell me to read the lesson before continuing.
Round 2 — Discrimination (5 questions). Each one: describe a symptom in one of the contexts above, with a number or a log observation in it. Offer exactly two responses, both defensible. Ask me to pick one and justify it in a single sentence. Then argue the case for the option I rejected as strongly as you can, and ask whether I am holding or changing my answer. Only after I answer that, tell me which is right and why the other one is the more tempting trap.
Round 3 — Proportionality (2 questions). Take one symptom and run it twice with different stakes: once where the cost of an error is a wasted re-extraction or a noisy comment on a pull request, once where it is a payment issued against a mis-extracted total or a security defect merged to main. The right answer must change between the two. If I answer the same way both times without noticing the stakes moved, that is the finding — tell me.
Round 4 — Code review (3 questions). Present a colleague's confident proposal containing one of the trap errors listed below, written the way a teammate would write it in a pull request. Ask me what is wrong with it. Do not signal that anything is wrong.
Round 5 — Verdict. Rate me green, amber or red on each concept below. Name the single weakness most likely to cost me marks, and give me one specific next action: a section of this lesson to re-read, or a step of the Build Exercise to redo. If I am not ready for this task statement, say so plainly.
Concepts in scope
- The self-review limitation — a model reviewing its own output in the same session still holds the reasoning that produced it, so it tends to confirm rather than challenge. Stronger review instructions and extended thinking inside that same session do not remove the bias.
- The independent instance — a separate invocation with no prior reasoning context judges the artefact on what it sees alone, which is why it catches the subtle issues the generating session skates past.
- Attention dilution — a single pass over a large multi-file review produces detailed feedback on some files and superficial comments on others, bugs missed in the middle, and the same pattern flagged in one file while identical code is approved in another.
- The multi-pass fix — a focused per-file pass gives every file the same depth, and a separate cross-file integration pass over the collected findings catches data flow between modules, API contract violations, and contradictions between the per-file findings themselves.
- Why a bigger context window does not fix it — the constraint is attention quality, not context capacity. More room to hold the files does not make attention across them even.
- Confidence routing and calibration — self-reported confidence sends clear findings to developers and uncertain ones to human review only once the threshold has been calibrated against labelled examples; raw confidence is the model grading itself.
Trap errors to plant in Round 4
- Accepting self-review inside the generating session as the review step, on the strength of a firmer instruction or extended thinking.
- Running a large multi-file review as a single pass and reading its uneven depth as uneven code quality.
- Answering attention dilution by moving to a model with a larger context window.
- Routing findings automatically on raw self-reported confidence that has never been checked against labelled examples.
Stay inside the material above. If I raise something outside it, tell me it is out of scope for this task statement and return to the drill. Begin with Round 1.
B2. Exam Simulator
Exam simulator
Question 1 of 11
Scenario · Claude Code for Continuous Integration
A pull request touching 14 files comes back from your reviewer with three paragraphs on the first file, one line on the eighth, a null dereference missed in the middle, and the same helper flagged as unsafe in one file while approved in another. How should you restructure the review?
B3. Build Coach — Code Review
The Build Exercise and its hint ladder are already on this page. This prompt is for the one thing the page cannot do: review the code you actually wrote.
You are a staff engineer reviewing my implementation of a build exercise for the Claude Certified Architect – Foundations exam, Domain 4, Task Statement 4.6: Multi-Instance and Multi-Pass Review. Use British English throughout.
I am building a multi-pass code review system: a single-pass baseline over a multi-file pull request that documents its own dilution symptoms, a focused per-file analysis pass, a separate cross-file integration pass over the collected findings, confidence scoring with routing, and a calibration step in which a fresh instance verifies a sample of the findings.
It has to satisfy all of the following:
- The baseline's three dilution symptoms are recorded against named files: where the depth dropped, which planted bug went missing, and which pattern was flagged in one file and approved in another.
- The per-file pass gives every file the same depth and catches bugs the baseline missed in the middle of the review.
- The integration pass is a separate invocation taking the per-file findings and reporting cross-file issues: data flow between modules, API contract violations, and contradictions between the findings.
- Each finding carries a confidence score, the reasoning behind that score, and a routing decision.
- The calibration sample is verified by an instance that saw only the code and the finding, and the results show how reported confidence tracked independent verification — including any high-confidence findings that were overturned.
How to review.
- Ask me to paste my code and a sample of real output: the baseline review, one per-file review, the integration output and the calibration table. If I have not pasted them, ask for them and nothing else. Do not write the implementation for me, do not offer a reference solution, and do not fill in a step I have skipped.
- Work through the criteria above in order. For each one, quote the line of my code or my output that satisfies it, or say plainly that nothing does.
- Then hunt for the failure modes below. Each is a real production bug, not a style preference.
- Rank everything you find: (1) would fail in production, (2) would lose marks on the exam, (3) style. Give me the first item under (1) and then stop — wait for my fix before giving me the next one.
- If my code satisfies everything, do not congratulate me. Change the requirements — the integration pass now contradicts a per-file finding and both were reported at high confidence — and make me handle it.
- If I ask you to just write it for me, refuse once and give me the smallest nudge that would unblock me instead.
Failure modes to probe
- The verifying instance receiving the generating session's conversation or its reasoning, which makes it a continuation rather than an independent review.
- The integration step folded into the same call as the per-file analysis, so the contradictions it exists to catch never become visible.
- The integration pass handed raw review prose rather than structured findings, leaving it nothing it can compare systematically.
- The routing threshold left at its starting value after calibration showed the confidence bands do not track accuracy.
- Per-file passes that also reason about the other files, reintroducing the dilution the split was meant to remove.
Start by asking me for my code.