/local-skills:agent-reapfrom local-skills
Clean up runaway/orphaned/redundant agent processes: stuck zip/tail/python/node, high CPU, memory-hogging or duplicate MCP and language servers, dead Claude/Codex sessions.
Ships in local-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Dead agent sessions leave behind heredoc interpreters and shell-snapshot jobs reparented to launchd, spinning at 100% CPU with nobody left to read their output. Live sessions leak too: every MCP reconnect strands the previous MCP server and its language-server subtree, idle at 0% CPU but still resident. This skill finds both with explainable rules and kills only what the user explicitly approves.
Resolve the checkout explicitly; never assume the caller's cwd:
DOTFILES_DIR="${DOTFILES_DIR:-$(
for l in "$HOME/.zshrc" "$HOME/.agent/AGENTS.md" "$HOME/.claude/settings.json"; do
t=$(readlink "$l" 2>/dev/null) || continue
r=$(cd "$(dirname "$t")/.." 2>/dev/null && pwd) || continue
[ -d "$r/scripts" ] && printf '%s' "$r" && break
done
)}"
test -f "$DOTFILES_DIR/scripts/agent_reap.py"
Scan (read-only): python3 "$DOTFILES_DIR/scripts/agent_reap.py".
--threshold 30--mem-threshold 150 (MB)--json for machine-readable output.Read the summary line first. It reports agent-owned RSS next to Chrome's, so a small reclaim number is not mistaken for a wrong diagnosis — if Chrome dominates, say so instead of hunting for more candidates.
Show the candidate table to the user. Each row carries a rule tag explaining
why it was flagged, and a SUBTREE column counting the descendants that
die alongside it:
ORPHAN-INLINE — old, high-CPU ppid 1 interpreter running inline code
(python -c, sh -c, …); both the CPU and --min-age gates must pass.AGENT-CHILD — long-running high-CPU descendant of a live agent process
or a Claude shell-snapshot job.ORPHAN-CPU — ppid 1 CLI tool (non-app, non-system) pegging the CPU.STALE-MCP — redundant MCP server under a live session: same session,
binary, argv and cwd as a younger sibling. No CPU gate; these idle at 0%
while holding a whole language-server subtree resident.ORPHAN-BROWSER — ppid==1 agent browser launcher (agent-browser,
chrome-devtools-mcp) still holding a Chrome tree. ppid==1 already
proves the session that spawned it is gone.AGENT-MEM — agent descendant above --mem-threshold, regardless of CPU.Memory is the physical footprint Activity Monitor reports, not ps RSS.
macOS compresses and swaps idle processes out, so RSS under-reports a hung
language server by two orders of magnitude — never diagnose from RSS.
Never kill without explicit user confirmation. Present the exact PID list
(AskUserQuestion works well) — AGENT-CHILD, STALE-MCP and AGENT-MEM
rows belong to sessions that are still alive, so name which session is
affected before asking. For STALE-MCP say what actually breaks: nothing,
unless the surviving server is also killed.
Kill only the approved pids:
python3 "$DOTFILES_DIR/scripts/agent_reap.py" --kill --pids <approved,comma,separated>
--force only if SIGTERM survivors remain.Re-run the scan to verify, and report reclaimed memory and CPU.
--kill refuses any pid not in the current candidate set. Descendants of an
approved pid are terminated with it, since they exist only to serve it.STALE-MCP always leaves the youngest server of each group alive, so a live
session never loses its tooling. cwd is part of the group identity: servers
with identical argv but different working directories are distinct, not
duplicates.agent-browser-chrome-<uuid>)
or launcher binary, never by "is Chrome" — a real browsing session has
neither and stays out of reach.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub voidmatcha/dotfiles --plugin local-skills17 skills in this plugin
/agent-reachUse public web, GitHub, social/community, video, RSS, and career search surfaces from the CLI/MCP when local repo evidence is not enough. Routes to public-only research tools while avoiding internal/company URLs and secret-bearing pages./agent-usage-auditAudit installed Claude/Codex agents, skills, commands, metadata-level reference counts, and source-level token pressure to decide what to prune, keep, or route. This inventory skill does not mine historical correction content or decide the current session's handoff state./context-checkCheck Claude/Codex context, cache, and handover pressure; advise continue, compact, clear, or hand off./dotfiles-syncApply dotfiles changes to this machine and judge the LLM tooling layer — plugin drift, hook registration, skill pins, dirty state, and whether local or repo should win. Use for 'dotfiles 반영해줘', 'dotfiles 업데이트', 'sync dotfiles', 'skill 최신으로', 'hook 등록 확인', or when install/update output needs interpreting. Do not use for plain verification (use dotfiles-verify) or for editing unrelated code./dotfiles-verifyVerify dotfiles install scripts, plugin manifests, hooks, TOML/JSON/plist config, and CI-style smoke checks./hypothesis-debuggingUse when investigating bugs, regressions, flaky or intermittent failures, unexpected UI/runtime behavior, incidents, or a fix that didn't work — especially when the symptom and the cause aren't obviously linked, or repeated guesses keep missing. Triggers: 'debug this', 'why is this failing', 'find the root cause', 'this fix didn't work', '디버깅', '원인 찾아줘', '왜 안돼'.