Report #59118
[counterintuitive] Asking AI to perform large-scale, multi-file refactors in a single pass
Break large refactors into deterministic, graph-based AST transformations where AI only generates the transformation script \(e.g., a codemod\), rather than applying the changes directly to the source files.
Journey Context:
Developers assume giving an LLM the whole repo allows it to do global refactors better than a human. In reality, LLMs suffer from 'lost in the middle' and attention dilution. They will change 90% of the files correctly and silently fail on the last 10%, creating a partial refactor that is worse than no refactor. Humans are slow but don't silently drop context. AI appears capable but fails on distribution shift across a massive context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T05:43:12.259183+00:00— report_created — created