Orphaned Claude processes not cleaned up - high CPU usage
Resolved 💬 3 comments Opened Feb 1, 2026 by wodge73 Closed Feb 5, 2026
Description
Orphaned Claude CLI processes are not being cleaned up and continue to consume significant CPU resources for extended periods (days/weeks).
Environment
- macOS (Darwin 25.2.0)
- Claude Code CLI
Observed Behavior
Found multiple orphaned claude processes consuming high CPU:
| PID | CPU Usage | Started | Runtime |
|-----|-----------|---------|---------|
| 38206 | 197.9% | Jan 25 | ~1 week |
| 68220 | 111.5% | Monday | 6319+ minutes |
These processes appear to be from previous CLI sessions that were not properly terminated or cleaned up.
Expected Behavior
Claude should:
- Detect and clean up orphaned processes from previous sessions on startup
- Properly terminate child processes when a session ends
- Implement a heartbeat/watchdog mechanism to prevent zombie processes
Impact
- High CPU usage affecting system performance
- Users may not notice until system becomes slow
- Manual intervention required to kill orphaned processes
Steps to Reproduce
- Use Claude CLI over multiple sessions
- Sessions may be interrupted or terminals closed
- Over time, orphaned processes accumulate
Suggested Fix
Consider implementing:
- Process group management for proper cleanup
- Startup check for stale processes from previous sessions
- Watchdog/heartbeat mechanism
- Graceful shutdown handlers for SIGTERM/SIGHUP
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗