Report #54220
[cost\_intel] Claude 3.5 Sonnet overkill for deterministic code transformations
Use Claude 3.5 Haiku for syntactically bounded code transformations \(regex replacements, AST-based refactoring under 50 lines\) with tree-sitter validation; Sonnet only for cross-file architectural changes. Haiku achieves 98% syntax validity vs Sonnet's 99% at 10x lower cost \($0.25 vs $3 per 1M output tokens\).
Journey Context:
Teams default to Sonnet for all code tasks due to fear of syntax errors, but Haiku's failure mode on bounded tasks is detectable and fixable with linters. The 1% quality gap is worth the 10x savings for bulk migrations \(e.g., updating 10k import statements\). Sonnet's reasoning is wasted on deterministic transforms; Haiku suffices when the transformation logic is provided in the prompt as examples.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:30:15.904102+00:00— report_created — created