Skip to content
Tech News
← Back to articles

AI Agents and the Refactoring That Never Happens

read original more articles
Why This Matters

The article highlights a concerning trend in the tech industry where teams are increasingly reluctant to refactor complex systems, especially when working with AI agents. This reluctance can lead to unmanageable codebases, making future development and maintenance more difficult, and potentially impacting the reliability and safety of AI-driven systems. Recognizing the importance of refactoring is crucial for sustainable software development and ensuring AI systems remain adaptable and understandable.

Key Takeaways

Rodrigo Rosenfeld Rosas

September 2, 2026 at 12:00 PM

Working with AI agents day to day, I’ve started noticing a trend that worries me. Teams — including experienced engineers who used to know better — have quietly stopped pushing to rewrite or restructure the gnarliest parts of their systems. It’s not about the quality of the code the agents write. It’s about a decision that used to happen almost reflexively and now rarely does: the decision to stop and say this has become unmanageable, we need to refactor it before we go any further.

Human context is small, and that shaped how we build software

A computer can hold far more in “working memory” than a human can. We can’t reason about a complex system when it branches in dozens of directions, each branch with its own implications, all interconnected. It’s simply too much to keep in our heads at once.

So historically we did the only thing we could: we split systems into modules small enough to understand in isolation, and then we spent effort connecting those modules together with interfaces we could also understand. Modularity, encapsulation, layering — these aren’t aesthetic preferences. They’re concessions to the size of human working memory. We break the system down until each piece fits in one person’s head, because that’s the only way a person can reason about it, change it safely, and review someone else’s change.

The refactoring reflex

Systems rarely start out confusing. A piece of code is written when the requirements are still simple, and at first it reads cleanly. Then the requirements change. A developer adds a branch for a new case, then another for an exception, then a special case on top of that exception. Over enough iterations the original “rule” the code expressed is buried under exceptions — sometimes the requirements have shifted so far that the code is now nothing but exceptions, with no clear rule left at all.

There’s a moment every experienced developer recognizes: you’re debugging an issue, you follow the code, and you get lost. The branches no longer form a picture you can hold in your head. Historically, that feeling was a signal. A senior engineer, upon getting lost in a piece of the system, would pause and say: this has become unmanageable — before I add anything else, I need to rewrite or refactor this so it’s understandable again. Not for elegance, but so that they and everyone after them could reason about it and safely review future changes.

That reflex — “I’m lost, therefore it’s time to refactor” — has quietly been one of the most important forces keeping long-lived systems maintainable. And it was triggered by a human limitation: the moment a person could no longer follow the code.

... continue reading