Windows: repeated agent-driven Playwright runs leak orphaned Next.js (Turbopack) postcss.js workers — 1,220 processes / ~10 GB RAM
Open 💬 0 comments Opened Jun 10, 2026 by Gubisoul07
Summary
After several weeks of Claude Code sessions on a Next.js 16 project on Windows 11, the machine ended up with 1,220 orphaned node.exe processes consuming ~9.9 GB of RAM, all running .next\dev\build\postcss.js <port> (Turbopack's external PostCSS worker).
Chain of events
- Project's
playwright.config.tsuseswebServer: { command: 'npm run dev' }(next dev, Next 16 → Turbopack). - Claude Code's workflow rules require running Playwright E2E specs before declaring tasks done, so the agent runs the suite very frequently across sessions.
- Each run: Playwright starts
next dev, Turbopack spawnspostcss.jsgrandchild workers, Playwright kills the dev server at the end — but on Windows the grandchildren are not killed and are orphaned. - A handful leak per run; hundreds of autonomous runs later: 1,220 zombies, RAM and disk pressure on the whole machine.
Environment
- Windows 11 Home 10.0.26200, Node 24, Next.js 16.2.3 (Turbopack), Tailwind 4 (
@tailwindcss/postcss), Playwright viawebServer - Claude Code VS Code extension
Why report here and not (only) next.js
The root orphaning bug is arguably Next.js/Playwright on Windows. But Claude Code is the amplifier: an unattended agent re-running the test loop hundreds of times turns a minor leak into a machine-degrading one, and the user only notices when RAM is exhausted. Suggestions:
- When Claude Code terminates a Bash/background task on Windows, consider reaping the full descendant process tree (Job Objects), not just the direct child.
- Consider detecting/flagging runaway accumulation of identical orphaned processes spawned during a session.
Workaround applied locally
Playwright globalTeardown that kills postcss.js node processes whose parent PID is no longer alive.