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:
Found a new crash pattern?
Let the zombie handle the restarts. 🧟
Top comments (0)