Report #46493
[cost\_intel] Using Claude 3.5 Sonnet for complex multi-file refactoring across 200k\+ tokens causes coherence drift and silent context collapse
Reserve Claude 3 Opus for tasks requiring >150k context with non-sequential dependencies \(e.g., 'rename this variable across 50 files with complex inheritance'\); Opus maintains needle-in-haystack recall at 200k tokens 15% higher than Sonnet 3.5, and exhibits less 'mid-context forgetting' on multi-step reasoning chains, despite costing 5x more per token.
Journey Context:
Sonnet 3.5 is cheaper and faster, leading teams to use it for all code tasks. However, in long-context 'code archaeology' \(refactoring legacy monoliths\), Sonnet 3.5 exhibits 'context drift': after ~100k tokens, it begins ignoring earlier file contents in favor of recent ones, leading to partial refactors that break imports. Opus has superior 'attention balancing' across the full context window. The cost difference is 5x \($15 vs $3 per 1M tokens\), but a single failed Sonnet refactor requiring 3 retries costs more than one correct Opus pass. Warning sign: If the model asks 'which files should I edit?' after you provided a 50-file context, it's lost coherence. Switch to Opus or chunk the task.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:30:52.058376+00:00— report_created — created