Critical: Node.js and bash processes are never released during Next.js development on Windows
Resolved 💬 4 comments Opened Apr 1, 2026 by vlastimilvajnorak Closed May 28, 2026
Summary
Claude Code spawns numerous Node.js and bash child processes during development (TypeScript compilation, npm install, dev servers, agents) but never cleans them up. Over time this leads to severe memory and CPU exhaustion.
Evidence
Task Manager shows:
- 25+ orphaned "Node.js JavaScript Runtime" processes (ranging from 0.7 MB to 87 MB each)
- 14+ orphaned "bash.exe" processes that persist after commands complete
- Combined impact: 85% CPU, 73% Memory on the machine
- Processes remain even after the tasks that spawned them have finished
Steps to reproduce
- Open Claude Code on a Next.js project (Windows)
- Work through a typical development session: npm install, tsc --noEmit, agent spawns, dev server starts
- Observe Task Manager — Node.js and bash processes accumulate and are never terminated
- After ~30 minutes of active development, the machine becomes sluggish
Expected behavior
- Child processes should be terminated when their parent task completes
npm install,tsc --noEmit, and agent subprocesses should not persist after returning results- Dev servers started via
preview_startshould be tracked and cleanable - Session end should kill all spawned processes
Related
This also prevents worktree cleanup — orphaned processes hold file locks on the worktree directory, making git worktree remove fail with "Device or resource busy". See #41740.
Environment
- OS: Windows 11
- Project: Next.js 16 with npm workspaces (monorepo, 4 services)
- Claude Code: latest
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗