A Claude Code plugin that safely finds and kills orphaned Claude subagent processes to free memory and CPU.
Claude Code MCP plugins (especially claude-mem) spawn background subagent processes that can accumulate over time. These orphaned workers keep running indefinitely even after the tasks that created them are long finished, consuming significant RAM (often 2-5 GB) and CPU.
The /kill-orphans command:
- Scans all Claude processes on your system
- Identifies orphaned subagent workers (children of the
claude-memdaemon with--output-format stream-json) - Shows you exactly what it found — how many orphans, how much RAM, what project spawned them
- Asks for your confirmation before killing anything
- Gracefully terminates orphans (SIGTERM, then SIGKILL for survivors)
- Reports how much memory was freed
Your active Claude terminal sessions are never touched. The skill distinguishes active sessions (which have a TTY) from orphaned workers (which don't).
- Always asks for confirmation before killing any processes
- Never kills active sessions — only targets background subagent workers
- Graceful shutdown first — sends SIGTERM, waits 2 seconds, then SIGKILL only for survivors
- Works from any directory — scans system-wide processes regardless of your current working directory
- macOS and Linux — uses standard POSIX tools (
ps,lsof,kill)
Note: This skill runs
ps,lsof, andkillcommands on your machine. Review the output before confirming. If you're unsure, choose "No" when prompted — nothing will be killed.
/plugin marketplace add SotoAlt/claude-kill-orphans
/plugin install kill-orphans@sotoalt-toolsJust run:
/kill-orphans
You'll see output like:
| Category | Count | RAM |
|-------------------------------|-------|---------|
| Orphaned subagents (project) | 83 | ~2.9 GB |
| Active terminal sessions | 8 | Safe |
Kill all 83 orphaned subagents (~2.9 GB)?
> Yes, kill them
- Your machine feels sluggish and
Activity Monitorshows manyclaudeprocesses - You've been using Claude Code with MCP plugins for days/weeks without restarting
ps aux | grep claude | wc -lshows dozens of processes you don't recognize
- Claude Code CLI installed
- macOS or Linux (uses
ps,lsof,kill) - No special permissions needed — only kills processes owned by your user
MIT