Lv.1 0 XP

Chain Patterns — Per-File, Reduce, and Verification Chains

Core 7 min +25 XP
💡
THE ANALOGY

A relay race where each runner specializes. The mapper charts the terrain. The implementer follows the map. The inspector checks the result. Specialization at each stage produces better outcomes than one person doing all three.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Using the same Claude session for generation AND verification. The reviewer must be a separate API call with no generation context — otherwise it inherits the generator's reasoning bias and is far less likely to find errors.

KEY POINTS
1 Per-file chain: analyze each file independently in parallel, then synthesize cross-file patterns sequentially.
2 Reduce chain: each step transforms large input into smaller, refined output for the next step.
3 Verification chain: generation step → independent review with a SEPARATE API call, no shared context.
4 Separate verification call explicitly told to assume the code might be wrong.
5 Step failure isolation: retry failing step only — not the whole chain.