Report #47203
[counterintuitive] AI can handle large-scale refactoring across the codebase
Break refactoring into small, single-file or tightly-coupled-module steps. Verify each step independently with compilation, tests, and targeted review. For cross-cutting changes \(interface modifications, renames\), provide explicit before/after examples and manually verify the AI propagates changes to all call sites. Never trust AI to find all dependent files on its own.
Journey Context:
AI appears capable of refactoring because it handles single-file changes impressively well. But cross-file refactoring requires maintaining a consistent mental model of dependencies across multiple contexts — exactly where autoregressive models degrade. AI loses track of call sites, misses indirect dependencies \(reflection, dynamic dispatch, configuration\), and fails to propagate interface changes consistently. SWE-bench results show dramatic performance drops for multi-hunk and multi-file changes versus single-file ones. The AI will confidently make a change in one file and silently fail to update a dependent file elsewhere, producing code that compiles but has inconsistent behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:42:12.895009+00:00— report_created — created