I've been using Claude Code for my side projects lately.
It's great, but there's one problem. Claude keeps editing files automatically, which triggers rebuilds. And Turbopack doesn't handle that well.
The loop became my life:
- Claude edits a file
- Turbopack crashes
- Ctrl+C β
npm run dev - Claude edits another file
- Crash again
- Ctrl+C β
npm run dev - ...repeat all day
After a weekend of this, I built a CLI to handle it automatically.
next-zombie π§
npx next-zombie
It watches your dev server. When it crashes, it restarts. Automatically.
No more Ctrl+C. No more switching terminals. Just keep coding.
It also clears .next cache before each restart.
What It Looks Like
Starting up:
$ npx next-zombie
[next-zombie] Cleaning .next cache...
[next-zombie] Starting Next.js with auto-recovery...
[next-zombie] $ pnpm run dev
β² Next.js 15.0.3 (Turbopack)
- Local: http://localhost:3000
β Ready in 1.2s
When crash happens:
β¨― [Error: ENOENT: no such file or directory, open '.next/static/development/_buildManifest.js.tmp']
[next-zombie] Cache error detected!
[next-zombie] Restarting in 0.5s...
[next-zombie] Cleaning .next cache...
[next-zombie] Restarting... (#1)
[next-zombie] Starting Next.js with auto-recovery...
[next-zombie] $ pnpm run dev
β² Next.js 15.0.3 (Turbopack)
- Local: http://localhost:3000
β Ready in 1.1s
On exit:
^C
[next-zombie] Session: 3 restarts, uptime 1h 42m
Before & After
Before:
Crash β Ctrl+C β npm run dev β Crash β Ctrl+C β npm run dev β ...
After:
Crash β [next-zombie restarts] β keep coding
Recovery time: ~700ms
How It Works
next-zombie
β
βββΊ Start: pnpm run dev
β
βββΊ Monitor stdout/stderr
β β
β βββΊ Cache error? β Restart
β β
β βββΊ Crash? β Restart
β
βββΊ Ctrl+C β Show stats β Exit
Detected patterns:
-
_buildManifest.js.tmpENOENT -
.nextcache errors - Any non-zero exit
Features
- β Auto-restart β no more Ctrl+C loop
- β
Auto cache clearing β clears
.nextbefore restart - β PM detection β works with npm, pnpm, yarn, bun
- β Session stats β see how many restarts happened
Install
Try it now:
npx next-zombie
Add to project:
npm install -D next-zombie
{
"scripts": {
"dev": "next-zombie"
}
}
FAQ
Q: Does this fix Turbopack?
No. It's a workaround. When Turbopack crashes, next-zombie handles the restart.
Q: Production?
Dev only. Production builds don't have this issue.
Q: Why not disable Turbopack?
You can. But Turbopack is fast. I'd rather have speed + auto-recovery.
Links
- π¦ npm: next-zombie
- π GitHub: relkimm/next-zombie
If this saves you some frustration:
β Star on GitHub
Found a new crash pattern?
π Open an issue
Let the zombie handle the restarts. π§
Top comments (0)