ワンクリックで
mcp-reap
Reclaims orphaned Claude Desktop MCP server processes leaked by previously-closed sessions, in the background, without a restart.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Reclaims orphaned Claude Desktop MCP server processes leaked by previously-closed sessions, in the background, without a restart.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Interactively scaffold or adapt a project-level extension for any plugin skill. Lists available skills, checks for existing extensions, and creates or opens the correct files. Triggers on: "extend skill", "customize skill", "skill extension".
Audit CLAUDE.md files for size, structure, and token efficiency. Checks both project-level and global CLAUDE.md. Warns when files exceed 25 lines (the recommended maximum for index-style CLAUDE.md). Suggests creating one if missing. Triggers on: "lint claude md", "claude md check", "check claude md", "CLAUDE.md zu lang", "audit claude md", "claude md audit". Do NOT auto-trigger from user phrasing for editing CLAUDE.md content or for /devops-setup-project. MAY be invoked explicitly via the Skill tool by other skills (devops-learn, devops-setup-project) as a post-edit gate.
Generate an interactive HTML page for analysis, plans, concepts, prototypes, comparisons, or creative work — open it in the browser and monitor user decisions (toggles, selections, comments) to feed them back into the workflow. Triggers on: "concept", "concept page", "interactive plan", "show me this as a page", "visualize this". Also auto-suggest when Claude completes analysis, planning, comparison, or concept work that would benefit from interactive decision-making. Do NOT trigger for: simple code explanations, debugging (use /devops-fix), or static documentation (use /devops-setup-readme).
Read session logs, runtime errors, and crash output to diagnose and fix the current issue — root-cause analysis first. Use when something is broken or behaving unexpectedly. Triggers on: "debug", "this is broken", "doesn't work", "error", "crash", "blank screen", "warum geht das nicht", "funktioniert nicht". Also triggers on pasted error/stack traces or when post.flow.debug hook detects repeated Bash failures. Do NOT trigger for general code questions.
Capture a long-term learning/correction and route it to the correct project- specific instructions (skill, skill-extension, deep-knowledge, or as a last resort CLAUDE.md) — NOT to personal feedback memory. Also prunes now-duplicate `feedback_*.md` entries with confirmation. Routing details live in the skill body (Step 5 table). Triggers ONLY on explicit invocation: "/devops-learn", "lerne das", "merk dir das fürs Projekt", "remember this for the project", "capture learning". Do NOT trigger for one-off conversational corrections or for personal feedback memory.
Manually update the devops plugin to latest from GitHub. Delegates to ss.plugin.update hook (pull + cache + registry), then adds changelog and verification report. Triggers on: "update plugin", "plugin updaten", "self update", "devops update", "neue version". Explicit user request only.
| name | mcp-reap |
| description | Reclaims orphaned Claude Desktop MCP server processes leaked by previously-closed sessions, in the background, without a restart. |
| version | 0.1.0 |
| trigger | ss.mcp.reap.js (SessionStart, every session) AND stop.mcp.reap.js (Stop, ~20-minute per-worktree cooldown) |
| scope | per-worktree (Stop cooldown), machine-wide (the scan itself) |
Reclaims orphaned Claude Desktop MCP server child processes — leftovers from previously-closed sessions that were never reliably terminated and linger, accumulating RAM. Driven by two hooks so it runs both once per session and periodically thereafter, without requiring a restart:
hooks/session-start/ss.mcp.reap.js — fires once, every SessionStart.hooks/stop/stop.mcp.reap.js — fires on Stop (end of a response
turn), gated by a ~20-minute per-worktree cooldown so it doesn't scan
every turn. The cooldown marker uses the same atomic write-temp-then-
rename pattern as self-calibration, keyed to an md5 hash of
process.cwd() in os.tmpdir().Both hooks spawn scripts/mcp-reap.js --apply --json detached,
fire-and-forget, windowless ({ detached: true, stdio: 'ignore', windowsHide: true } + .unref()) and exit immediately — reaping never
delays a session start or a response turn.
The scan-and-kill logic lives in hooks/lib/mcp-reaper.js (fully unit
tested, 46/46 in mcp-reaper.test.js) and is Windows-only — the
dead-parent-PID orphan signal only means anything on Windows, so the module
is a documented no-op on macOS/Linux. A process is only ever a reap
candidate when it matches an MCP-server launcher signature, its parent PID
is confirmed dead, AND it falls outside the live-Claude census (every
currently-live claude/claude.exe process plus its full descendant
subtree) and the caller's own process subtree — an empty/unbuildable census
means "protection unknown" and refuses to produce any candidates at all.
Every candidate is re-validated against a fresh process snapshot immediately
before both the SIGTERM and any SIGKILL escalation (TOCTOU-safe), so a pid
reused for something else between scan and kill is skipped, never touched.
The reap() module itself defaults to dry-run — nothing is ever terminated
unless a caller explicitly passes --apply; both hooks opt into it
deliberately, on the reasoning that a leaked orphan is safe to reclaim
automatically once the safety net above holds. Any enumeration or kill
failure fails safe (skip, never throw).
node scripts/mcp-reap.js # dry-run, human summary
node scripts/mcp-reap.js --json # dry-run, JSON output
node scripts/mcp-reap.js --apply # reclaim now — sofort ohne Neustart
node scripts/mcp-reap.js --apply --json
Every run — including the detached ones spawned by the hooks — persists its
result to dotclaude-mcp-reap-status.json in os.tmpdir(), so "what did it
reap (or not)?" is inspectable after the fact even though the hooks discard
stdout (stdio: 'ignore').
powershell.exe/wmic process-enumeration calls).os.tmpdir() is unwritable, the Stop hook's
marker write fails silently and the hook simply fires every turn instead
of crashing.