less than 1 minute read

Post on LinkedIn

Has anyone of you experienced the agentic refactoring death spiral [1]?

What I mean by that is that an agentic tool, in my case Claude Code, indefinitely keeps finding new things to “refactor.” So the cycle is “find refactoring opportunities” -> “implement refactoring opportunities” -> “find refactoring opportunities” -> … This happens to me regularly, even though I have a CLAUDE.md file, a PLAN.md into which I persist implementation plans, and the project is not that big. Claude Code keeps finding “new” issues between sessions, part of them caused by previous refactorings (or rather “defectorings”).

What helps is adding something to the prompt along the lines of not entering an agentic refactoring death spiral or telling Claude Code to focus on actual refactoring opportunities and not just slightly different ways of implementing the same thing. Nevertheless, this spiral keeps happening to me across different projects and programming languages…

[1] term suggested by Claude Code

Teachers protesting calculator use
Image created using Google Gemini/Nano Banana.</a>

Updated: