Products sometimes get to a state where new features break old ones and there are parts of the codebase developers would rather not touch. At this point usually someone says that maybe we should rewrite the thing. These days it sounds even more tempting, because AI agents can write a lot of code fast.
But Sonos is a good reminder that with full rewrites, the juice often isn’t worth the squeeze. In May 2024, the company launched a rebuilt mobile app that was missing features customers loved, like alarms and sleep timers, and kept crashing or dropping speakers off the network. Because it had replaced the old app for everyone at once, there was nothing to go back to. By the fiscal fourth quarter revenue had fallen 16%, the CEO stepped down in January 2025, and the app overhaul was estimated at $20–30 million.

Is rewriting really still that hard, even with AI?
It is, because writing the new system was never the hard part. The hard part is understanding the old one, and old code knows things nobody wrote down. Most of its odd features and strange-looking parts are there because someone once had to patch a real bug or build something for a client fast. Even the part that is written down takes effort to read: developers spend a lot of their time just figuring out how things work, and it gets tougher when the code is old, written by different people or, increasingly, generated by AI. That is how a team doing a rewrite ends up rebuilding something it doesn’t fully understand.
What agents do change is the mechanical work. Porting code to a new language, writing tests and moving data all go much faster with them, and speed matters here, because during a rewrite the team supports the old product and builds the new one at the same time. The sooner the new one is ready, the less the company pays twice. Agents can also read the existing code and map out what it does, which helps when nobody has a full feature list, but they see only what’s in the code and not the reasons behind it. So with AI a rewrite gets cheaper and a bit faster, but not safer.

When does a full rewrite make sense?
There are still cases where starting over is the right call. One is technology so old that nobody supports it, security fixes have stopped, and it’s hard to hire people who know it. Another is a product that is still small and that the team knows well, so there isn’t much hidden knowledge to lose. The third is a business that has changed so much that the architecture no longer fits and can’t be changed piece by piece.

If not a rewrite from scratch, then what?
The usual alternative is the Strangler Fig pattern, which Martin Fowler, a well-known software engineer, named after a fig that grows around a host tree and slowly replaces it. A system is replaced the same way: it keeps running while the team rebuilds one piece of it, say payments or reporting. Once that piece is ready, it starts handling real traffic, the old one is switched off, and the team moves on to the next.
It also has some downsides. The old and new systems run side by side, often for a long time, and some teams replace 90% of a system and never get to the last 10%. But through all of it the product keeps running, users get improvements bit by bit, and if something breaks, only one part has to be rolled back.
Sometimes even that is more than a system needs. When it has no tests and feels too risky to touch, it’s often enough to cover the critical parts with tests and then refactor them one at a time.

Here are the questions teams can ask before they decide:

Is the problem outdated tech, an architecture that doesn’t fit anymore, or a few messy areas?

Could we rebuild the worst part first and see how it goes?

Do we have a full list of what the product does today, including the stuff nobody mentions because it just works?

How will users move to the new version, and what’s the plan if something goes wrong?

What happens to the roadmap while the rewrite is going on?

How much will the old system cost to maintain in the meantime, and will the rewrite really be cheaper over the next few years?


When the answers match one of the three cases above, a full rewrite may be the right call. If they show that the problem sits in a few parts of the system, it makes sense to start with those: a full rewrite can still happen later, and by then the team will understand the system much better. And the whole time, the product stays live and keeps bringing in revenue.