A two-pass review architecture uses a cheap first-pass filter to scan every changed file, then routes flagged files—and security-sensitive paths—to an expensive deep review. It reduces cost by concentrating model attention where risk is higher, but silently inherits the filter’s false negatives. section 9.5.5 section 9.2.4
Implement the pattern with explicit routing and measurement:
- Run the inexpensive model across every changed file for formatting, naming, imports, dead code, and obvious logic defects. section 9.5.5
- Send first-pass findings and files touching authentication, payments, or data access to the deeper reviewer. section 9.5.5
- Sample roughly one in twenty files cleared by the filter and compare results with the full review to measure missed issues. section 9.2.4
CI cost routing
One pipeline ran Haiku at about $0.001 per file and escalated selected files to Sonnet at about $0.02. In the reported workload, Sonnet reviewed 15 of 45 daily files and monthly cost fell from $620 to $175 while reported issue coverage stayed the same; another configuration reported a 56% reduction, demonstrating that savings depend on routing and workload. section 9.5.5 section 9.2.4
Table 9.1 Change of costs between models
|
Task Type
|
Sonnet
|
Haiku
|
GPT-4.1-mini
|
Model to be selected
|
|
Tab completion
|
94%
|
93%
|
92%
|
Any
(≈)
|
|
Import statements
|
97%
|
96%
|
96%
|
Any
(≈)
|
|
Boilerplate generation
|
91%
|
88%
|
87%
|
Any
(≈)
|
|
Unit test scaffolding
|
89%
|
82%
|
80%
|
Sonnet*
|
|
Inline refactoring
|
90%
|
83%
|
81%
|
Sonnet*
|
|
Function implementation
|
88%
|
74%
|
72%
|
Sonnet
|
|
Complex debugging
|
85%
|
61%
|
58%
|
Sonnet
|
|
Multi-file refactoring
|
82%
|
52%
|
49%
|
Sonnet
|
|
Architecture planning
|
79%
|
41%
|
38%
|
Sonnet
|
Compare model performance by task complexity before deciding which tasks deserve escalation. section 9.2.4
