You know that sinking feeling when you check your disk space and find a 34GB folder you didn’t know existed? That was me last Tuesday. I was hunting for extra space to install a new game, and instead I discovered that my humble Next.js project had been silently hoarding enough cache to fill a small hard drive.
This isn’t a fluke. It’s a design failure baked into modern frontend tooling. The frameworks we love—Next.js, Vite, Webpack—are built on a simple bargain: Your build cache is not your friend. It’s your storage’s worst enemy. They promise speed by caching every artifact, every compiled module, every metadata file. But they treat your local SSD as an infinite, free dumping ground. And they never, ever clean up after themselves.
You’ve probably felt it too. The slow file explorer. The disk space warning. The moment you realize your .next folder has become a black hole. It’s not your fault—it’s the architecture. The industry optimized for build speed, and externalized the cost onto your finite hardware. The paradox: caching makes builds faster, but the resulting bloat makes your whole system slower. You’re trading long-term productivity for short-term gains.
I tried manual cleanup. I googled scripts. Nothing felt right. So I built next-nuke—a single command that nukes the .next folder and its bloated children. It’s not clever. It’s not sophisticated. It’s a sledgehammer. And it works.
Does a full clean risk clobbering an in-progress install? Yes, if you’re mid-flight, don’t run it. But if you’re tired of your SSD being a landfill, this is the cure. Don’t apologize for your bloated folder. Nuke it.
FAQ
Q: Doesn't Next.js need those cache files to function properly?
A: It needs some cache for incremental builds, but 34GB is absurd. next-nuke lets you wipe the entire .next folder and rebuild fresh. It's safe and actually improves performance by removing stale artifacts.
Q: When should I actually run next-nuke?
A: Run it when you notice disk space warnings, your system feels sluggish, or you've just finished a major refactor. It's also useful before cloning a new project to avoid cross-contamination. Don't run it during an active deployment or npm install.
Q: Isn't this just a band-aid for a deeper problem in the framework?
A: Absolutely. The real fix is for frameworks to implement smarter cache eviction and storage limits. But until they do, tools like next-nuke are the only practical solution. Sometimes you need a band-aid while you wait for surgery.