Every startup reaches the moment. Deployment takes three hours. A simple feature change breaks two unrelated things. Your engineers are spending more time working around the existing code than building anything new. Someone in a standup says the words: "We should just rewrite this from scratch."
It is a seductive idea. Start fresh. Do it properly this time. Use modern tools, clean architecture, all the things you wish you had done from the beginning. The fantasy is compelling because it is simple. The old system is messy. A new system would be clean. Therefore, rewrite.
The problem is that rewrites are one of the most reliably destructive decisions a startup can make. Joel Spolsky called it "the single worst strategic mistake that any software company can make." Netscape did it and nearly died. Basecamp's founders have written extensively about why they resist the temptation. The graveyard of startups that rewrote their way into oblivion is vast and well populated.
That said, sometimes a rewrite genuinely is the right call. I have seen codebases where refactoring was throwing good money after bad, where the architecture was so fundamentally wrong that no amount of incremental improvement would get you where you needed to go. At Risika, we made hard calls about which parts of the system to rebuild and which to evolve, and getting that distinction right was critical to reaching profitability.
The question is not "should we ever rewrite?" The question is "how do we know when refactoring is enough and when it genuinely is not?"