/arc:prune-agents
Kill orphaned agents
—What it does
Prune-agents finds and kills Claude Code processes that have become orphaned — detached from their terminal (TTY shows "??"). These accumulate when the Task tool spawns subagents that don't cleanly exit after completion.
—Why it exists
Orphaned Claude processes consume memory and CPU in the background. Pruning periodically keeps your system clean without affecting active terminal sessions.
Source document
Prune Orphaned Agents
Run the cleanup script to kill orphaned Claude agent processes.
scripts/cleanup-orphaned-agents.sh
This kills Claude Code processes that have become detached from their terminal (TTY shows "??"). These accumulate when the Task tool spawns subagents that don't cleanly exit after completion.
Safe to run anytime — only kills orphaned processes. Active terminal sessions are preserved.
After running, report the result to the user including how many processes were cleaned up.