Skip to content

4.6 Multi-Instance and Multi-Pass Review

Self-review means that a model checks its own output in the same conversation session. An independent instance is a separate Claude invocation without that prior reasoning context. Attention dilution is uneven attention when one pass reviews too much at once. A confidence score is the model’s own report of its certainty about a finding.

This lesson uses one made-up example throughout: a mortgage broker. The broker has Claude extract income and outgoings from a client’s application pack: payslips, bank statements, a credit report and a valuation. Claude then reviews its own extraction.

In self-review, the model retains its original reasoning chain. It already “knows” why it chose each approach, classified each finding at a particular severity, or selected certain values. So the model tends to confirm those decisions rather than challenge them. This is how self-review works in one session. Plan your design for this behaviour. If Claude counted a large transfer as salary, a same-session review still holds that reason. So the review is likely to approve the figure again.

An independent instance judges the output on what it sees alone, without the bias of “I chose this because…”. This lack of bias makes the independent instance much better at finding subtle issues.

// Anti-pattern: self-review in the same session
const generation = await client.messages.create({
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({
messages: [
{
role: "user",
content: `Review this code for bugs, security issues, and edge cases:\n\n${generatedCode}`
}
// Fresh instance — no prior reasoning context
]
});

In a single pass, large reviews (multi-file PRs, complex extraction pipelines, broad code audits) suffer from attention dilution. These are the symptoms:

  • Detailed feedback on some files, superficial comments on others
  • Obvious bugs missed in the middle of the review
  • Contradictory findings: flagging a pattern as problematic in one file while approving identical code elsewhere

One pass over the broker’s pack might check the first payslip line by line, skim the third statement, and flag a transfer it approves elsewhere. The fix is to split the review into focused passes.

Pass 1: Per-file local analysis. Each invocation reviews one file with a focused prompt, so that file gets full attention and every file gets consistent depth.

Pass 2: Cross-file integration. After the review of every file is complete, a separate pass receives all the per-file findings. This pass checks data flow between modules, consistent API usage across services, dependency conflicts, and contradictions in the per-file findings themselves. This pass catches cross-file issues that no single-file review would identify. One example is a payslip salary that differs from the credits on the bank statement. Separate passes stop contradictory findings from appearing in the same output.

// Pass 1: Per-file analysis
const perFileFindings = await Promise.all(
files.map(file =>
client.messages.create({
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({
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)}`
}]
});

Why Larger Context Windows Do Not Fix This

Section titled “Why Larger Context Windows Do Not Fix This”

A bigger context window holds the broker’s whole pack, but the model still spreads its attention unevenly across files. The problem is attention quality, not context size. Only focused per-file passes give consistent depth.

For uncertain findings, the model can self-report confidence alongside each finding. The score is the model’s own view of its certainty, not self-reported accuracy. The score allows routing, which decides where each finding goes:

  • High confidence findings: Report directly to developers
  • Low confidence findings: Route to human review for validation
  • Threshold calibration: Use labelled validation sets (examples where you already know the answer) to calibrate what confidence score correlates with actual accuracy

A low-confidence finding for the broker, such as “may be a one-off bonus”, goes to an adviser.

{
"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"
}

A raw score is uncalibrated, so it is unreliable for automated decisions. Calibrate the score by running labelled examples (where you already know the answer, such as the broker’s past packs) through the system. Measure how closely reported confidence follows actual accuracy. Then adjust the routing thresholds from that data. A threshold that you validated against labelled sets is suitable for routing. Using uncalibrated confidence for automated decisions is an anti-pattern.

A production review architecture combines all three concepts:

  1. Generation: First instance generates code, extraction, or analysis
  2. Per-file review: Independent instances review each output unit individually
  3. Integration review: Separate instance checks cross-unit consistency
  4. Confidence routing: Low-confidence findings go to human review
  5. Calibration loop: Labelled validation sets continuously calibrate confidence thresholds

For the broker, this architecture means one extraction, a check per document, one cross-document check and an adviser for doubtful findings.

The exam tests this principle directly. To improve review quality, the correct answer uses a separate model instance. It is wrong to add “please review carefully” instructions to the same session. It is also wrong to depend on extended thinking within the generating session. Both options leave the original reasoning in context.

For large multi-file reviews, one specific wrong option reads “switch to a higher-tier model with a larger context window”. The exam also distinguishes raw confidence scores from calibrated confidence thresholds. Raw confidence scores are uncalibrated and unreliable for automated decisions. Calibrated confidence thresholds are validated against labelled sets and are suitable for routing.

This architecture is more expensive than single-pass review. It is worth the cost when review quality directly affects production reliability. Examples are CI/CD pipelines, financial extraction like the broker’s, compliance analysis, and any system where issues that a review misses have downstream consequences.

Six exam-style multiple-choice questions on Multi-Instance and Multi-Pass Review. Pick an answer, then open the explanation.

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 flagged as problematic in one file but approved in another). How should you restructure the review?

  • A. Switch to a higher-tier model with a larger context window to handle all 14 files in one pass
  • B. Per-file local analysis passes for consistent depth, then a separate cross-file pass for data flow issues
  • C. Run three independent review passes on the full PR and only flag issues found in at least two of three runs
  • D. Require developers to split large PRs into smaller submissions of 3-4 files before automated review
Answer & explanation

Correct: B

  • A is wrong because larger context windows do not solve attention quality issues. The model can hold more text but still gives uneven attention across files.
  • B is correct because per-file analysis ensures every file gets consistent, focused attention. The integration pass catches cross-file issues and contradictions.
  • C is wrong because requiring consensus on issues found in at least 2/3 passes suppresses real bug detection. Some bugs are caught intermittently.
  • D is wrong because this shifts burden to developers without improving the review system itself.

Why is self-review (asking the model to review its own output in the same conversation session) less effective than independent review?

  • A. The model retains its reasoning context and is less likely to question its own decisions
  • B. Self-review uses more tokens than independent review, reducing output quality
  • C. The model forgets its earlier output and cannot compare it accurately
  • D. Self-review is slower because the model must re-process the entire conversation history
Answer & explanation

Correct: A

  • A is correct because the model remembers why it made each decision and tends to confirm rather than challenge those decisions. An independent instance evaluates the output fresh.
  • B is wrong because token usage is not the issue. The reasoning bias from retained context is.
  • C is wrong because the model does not forget — it retains the full conversation context, which is the actual problem.
  • D is wrong because speed is not the issue. The quality of review is lower because of reasoning context retention.

Your multi-pass code review runs per-file analysis on each of 10 files. What should the cross-file integration pass check for?

  • A. Grammar and spelling consistency across file comments
  • B. Whether each file passes compilation independently
  • C. Data flow issues, contradictions, and API violations
  • D. Total line count and code complexity metrics across the PR
Answer & explanation

Correct: C

  • A is wrong because grammar checking is not the purpose of cross-file integration.
  • B is wrong because compilation checking is a build system concern, not a review integration concern.
  • C is correct because the integration pass catches systemic issues no single-file review identifies: data flow problems, contradictions in per-file findings, and API contract violations across services.
  • D is wrong because metrics collection is separate from review quality. The integration pass is about finding cross-file logical issues.

Your review system adds confidence scores to each finding. A finding has confidence 0.92 but independent verification reveals it is incorrect. What does this indicate?

  • A. The model is defective and should be replaced
  • B. The independent verifier made an error; high-confidence findings are always correct
  • C. Confidence scores above 0.90 should be automatically accepted without review
  • D. Raw self-reported confidence is uncalibrated
Answer & explanation

Correct: D

  • A is wrong because poorly calibrated confidence is a known characteristic, not a defect.
  • B is wrong because the independent instance approaches the finding fresh and may be more accurate than the self-assessed confidence.
  • C is wrong because this question directly demonstrates why automatic acceptance of high-confidence findings is risky without calibration.
  • D is correct because raw self-reported confidence does not reliably correlate with accuracy. Calibration using labelled validation sets reveals the actual relationship and allows you to set reliable routing thresholds.

How should you calibrate confidence thresholds for routing findings to human review?

  • A. Set the threshold at 0.5 since that represents the midpoint between confident and uncertain
  • B. Run labelled validation sets through it and compare reported confidence against accuracy
  • C. Ask the model to self-calibrate by reporting its own accuracy statistics
  • D. Gradually lower the threshold until no findings reach human review, optimising for efficiency
Answer & explanation

Correct: B

  • A is wrong because an arbitrary midpoint has no empirical basis. The relationship between confidence scores and accuracy varies by task.
  • B is correct because labelled validation sets provide ground truth. Measuring confidence vs actual accuracy reveals which threshold produces reliable routing.
  • C is wrong because the model’s self-assessment of its accuracy has the same calibration problem as its confidence scores.
  • D is wrong because eliminating human review removes the safety net for uncertain findings, reducing overall quality.

A production review architecture combines generation, per-file review, integration review, confidence routing, and calibration. This is more expensive than single-pass review. When is the cost justified?

  • A. Always — quality should never be compromised for cost
  • B. Only when using the batch API to offset the multi-pass cost with 50% savings
  • C. Only for codebases with more than 100 files
  • D. When review quality directly affects production reliability downstream
Answer & explanation

Correct: D

  • A is wrong because cost-quality trade-offs are necessary. Not every review needs multi-pass architecture.
  • B is wrong because the batch API addresses cost timing, not review quality. The decision to use multi-pass depends on quality requirements, not API choice.
  • C is wrong because codebase size is not the determining factor. A 5-file PR in a financial system may warrant multi-pass review.
  • D is correct because the multi-pass cost is justified when missed issues have real downstream consequences — production systems, financial data, compliance requirements.