Report #69832
[cost\_intel] Using Gemini Flash or Claude Haiku for multi-file refactoring requiring dependency awareness
Reserve Claude 3.5 Sonnet or GPT-4o for multi-file refactoring requiring dependency graph awareness; use cheaper models only for single-file linting or isolated functions with no external imports
Journey Context:
Flash/Haiku cost ~$0.075/1M tokens vs Sonnet ~$3/1M \(40x difference\). However, on SWE-bench style tasks requiring changes across 3\+ files with import dependencies, Flash achieves <10% success vs Sonnet 40-50%. The failure mode isn't syntax errors—it's architectural incoherence \(changing function signatures without updating callers, missing import side effects, circular dependency introduction\). The cost of a failed refactor \(debugging time, broken builds\) far exceeds the $2.925/1M token savings. Use Haiku only for: single-file changes, regex replacements, or well-scoped function generation with no external deps. Always use AST parsing to validate multi-file outputs before accepting cheaper model generations; if validation fails, escalate to Sonnet with the error context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:41:49.487785+00:00— report_created — created