Task 4.5
Multi-Pass Review
Local and cross-file review passes with session isolation
📘What You Need to Know
Why Single-Pass Review Misses Issues
A single review pass over a multi-file change catches obvious local issues — syntax errors, missing imports within a file, naming inconsistencies. It misses cross-file problems: a function renamed in file A but not updated in file B, an interface changed in types.ts but not reflected in api.ts, a dependency added in package.json but never imported.
Multi-pass review separates local concerns from integration concerns. Each pass has a focused scope, explicit criteria, and ideally a fresh context window. The exam tests this two-pass strategy and the session isolation requirement.
Pass 1: Local File Review
The local pass reviews each changed file independently. Criteria focus on file-level quality: syntax correctness, naming conventions, missing error handling, function length thresholds, documentation requirements. Each file is reviewed in isolation — the reviewer does not need to know about other files in the changeset.
Local review can run in parallel across files since there are no cross-file dependencies to check. Use explicit criteria from lesson 4.1 to prevent alert fatigue during local review.
- •Review each changed file independently
- •Check syntax, naming, error handling, documentation
- •Apply explicit measurable criteria — not vague "quality" checks
- •Parallelizable across files in the changeset
Pass 2: Cross-File Integration Review
The cross-file pass reviews how changed files interact. It checks import/export consistency, interface contracts between modules, shared type definitions, configuration changes that affect multiple files, and dependency additions that require code changes elsewhere.
This pass needs the full changeset context — all changed files together — but should still run in a separate session from code generation to avoid confirmation bias.
# Pass 1 criteria (per file)
"Flag ONLY in this file: functions >50 lines, missing async try-catch,
public exports without JSDoc, hardcoded secrets"
# Pass 2 criteria (cross-file)
"Flag ONLY: imports referencing renamed/removed exports,
interface changes not reflected in implementing files,
package.json dependency additions without corresponding imports,
API route changes without matching client updates"Session Isolation: The Self-Review Anti-Pattern
Same-session self-review is a critical anti-pattern tested on the exam. When the same session generates code and then reviews it, the reviewer inherits the generator's reasoning context. It confirms its own assumptions, skips over gaps it already "knows" about, and shares blind spots.
Always use separate sessions for generation and review. In CI/CD, this means a distinct claude -p invocation for review — not continuing the generation session with "now review your changes."
Same-session self-review is an anti-pattern. The reviewer inherits the generator's reasoning blind spots and confirmation bias.
Designing a Multi-Pass Review Pipeline
A production multi-pass pipeline runs: generation (session A) → local review per file (session B, parallel) → cross-file review (session C, full changeset) → aggregate findings → present to developer. Each session gets explicit criteria, not vague instructions.
For CI/CD integration, each pass is a separate claude -p call with --output-format json. Findings from all passes merge into a single review report. Blocking findings (security, broken imports) prevent merge; advisory findings (style, documentation) are informational.
Domain 3 anti-pattern: same-session self-review in CI/CD. Domain 4 solution: separate sessions for generation and each review pass.
⚠️Exam Traps
Trap: Single-pass review for multi-file changes
Why it's wrong: Cross-file issues — broken imports, interface mismatches, missing dependency updates — are missed.
Trap: Same-session self-review after code generation
Why it's wrong: Confirmation bias from shared reasoning context — reviewer inherits generator blind spots.
Trap: Cross-file review without the full changeset context
Why it's wrong: Integration issues require seeing all changed files together — per-file context is insufficient.
Trap: Running multi-pass review with vague criteria on each pass
Why it's wrong: Multi-pass does not fix alert fatigue — each pass still needs explicit measurable criteria.
✓Concept Check
A developer generates code in one Claude session, then asks the same session to "review your changes." What is the primary problem?
🔨Build Exercise
Intermediate40 minutesDesign a Multi-Pass Review Pipeline
What you'll learn
- •Implement local and cross-file review passes
- •Enforce session isolation between generation and review
- •Define explicit criteria for each review pass