# Cleanup agent team node processes

> Cleanup agent team node processes is an open-source agent skill for developer tools. Audits and safely cleans leftover node, browser and shell processes from agent team runs. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ruan-cat/monorepo/tree/main/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes
- **Repository:** https://github.com/ruan-cat/monorepo
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** cleanup-agent-team-node-processes
- **Collection:** https://github.com/ruan-cat/monorepo
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill helps an agent investigate Windows or PowerShell sessions after multi-agent automation leaves stray node, npx, command wrapper, browser or agent-browser processes behind. It starts with diagnosing whether the resource load actually comes from the current run, and routes editor, search, watcher, Defender or build-cache load to configuration fixes instead of process killing.

The core of the workflow is a bundled PowerShell script that runs a read-only audit by default and prints JSON to standard output. It groups candidates by ownership evidence such as PID, parent PID, command line, executable path, creation time and listening ports, and it reports WorkBuddy prewarm pools with a confidence level and a session state. Apply mode is gated: it needs a narrow include pattern, a temporary ledger file that is deleted in a finally block, and for WorkBuddy pools explicit selectors plus two confirmation switches. Long-running services, user browsers, editors and protected WorkBuddy roles are excluded.

The skill expects a Windows environment with PowerShell and runs against the native process information it gathers. Documentation is in Chinese, with reference files covering the output fields, a restricted recovery path for stuck one-shot Node commands, and a checklist of common mistakes.

## When your agent uses it

> Use when Windows or PowerShell agent-team sessions leave suspected stale node, npx, Windows command processor, agent-browser browser or CLI processes, stale MCP or dev-server children provably owned by the current run, lingering listeners, unclear process ownership after multi-agent automation, or unexplained WorkBuddy prewarm pools, MCP subtrees, native agent-browser workers, or shell-snapshot bash processes. 当 Windows 或 PowerShell 的 agent team 会话结束后，出现疑似残留 node / npx / Windows 命令处理程序 / agent browser 浏览器或 CLI 进程、可证明归属当前 run 的残留 MCP 或开发服务器子进程、残留监听器、多代理自动化后的进程归属不清，或无法解释的 WorkBuddy prewarm 池、MCP 子树、原生 agent-browser worker、shell snapshot bash 进程时使用。

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs PowerShell scripts](https://github.com/ruan-cat/monorepo/tree/HEAD/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes)
- [No network calls found in its scripts](https://github.com/ruan-cat/monorepo/tree/HEAD/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes)
- [License: MIT](https://github.com/ruan-cat/monorepo/tree/HEAD/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes)

## Features

- **Read-only process audit:** A default dry-run lists candidate Node, shell and browser processes as JSON without stopping anything.
- **Ownership evidence checks:** Candidates are judged by PID, parent chain, command line, start time, working directory clues and listening ports.
- **Gated cleanup mode:** Stopping requires an explicit apply flag, a narrow include pattern and a temporary ledger that is removed afterwards.
- **WorkBuddy pool grouping:** Prewarm pools and their process subtrees are grouped with confidence levels and explicit selectors for any stop.
- **Protected long-running services:** Gateways, memory services, queue workers, editors and user browsers are excluded from cleanup by default.
- **Post-cleanup verification:** Target PIDs and listening ports are sampled again to confirm what remains after a stop.

## Good for

- Find leftover node or npx processes after a multi-agent run on Windows
- Check whether a slow machine is caused by agent-run processes or by editor and indexer load
- Stop orphaned MCP or dev-server children that clearly belong to one finished run
- Review which WorkBuddy prewarm pool processes are still running before deciding on cleanup
- Diagnose lingering listening ports left behind by an agent session

## Install

### Claude Code

This skill ships in the `common-tools` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ruan-cat/monorepo
/plugin install common-tools@ruan-cat-tools
```

Or copy only this skill to `~/.claude/skills/cleanup-agent-team-node-processes`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/cleanup-agent-team-node-processes &&
cp -R "$tmp/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes" ~/.claude/skills/cleanup-agent-team-node-processes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/cleanup-agent-team-node-processes` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/cleanup-agent-team-node-processes` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/cleanup-agent-team-node-processes &&
cp -R "$tmp/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes" ~/.agents/skills/cleanup-agent-team-node-processes &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/cleanup-agent-team-node-processes` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/cleanup-agent-team-node-processes` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/cleanup-agent-team-node-processes &&
cp -R "$tmp/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes" ~/.cursor/skills/cleanup-agent-team-node-processes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/cleanup-agent-team-node-processes` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ruan-cat/monorepo.git --path ai-plugins/common-tools/skills/cleanup-agent-team-node-processes
```

Or copy the folder to `~/.gemini/skills/cleanup-agent-team-node-processes` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/cleanup-agent-team-node-processes`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ruan-cat/monorepo.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/cleanup-agent-team-node-processes &&
cp -R "$tmp/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes" ~/.copilot/skills/cleanup-agent-team-node-processes &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/cleanup-agent-team-node-processes` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ruan-cat/monorepo.git
```

Then copy `monorepo/ai-plugins/common-tools/skills/cleanup-agent-team-node-processes` into your agent's skills folder as `cleanup-agent-team-node-processes`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does the skill stop processes automatically?

No. It runs a dry-run audit by default and only stops processes when apply is explicitly passed with a narrow include pattern and a temporary output path.

### Which platforms does Cleanup agent team node processes need?

It is built for Windows with PowerShell and relies on the bundled cleanup script and native process information.

### Does Cleanup agent team node processes write reports into my workspace?

The documented default is stdout-only output. Any temporary ledger file is placed in the system temp folder and removed in a finally block.

### Can Cleanup agent team node processes kill a user's normal browser or editor?

Ordinary user browsers are only audited, and editor extension hosts and similar long-running services are excluded from cleanup.

### How do I install Cleanup agent team node processes in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/cleanup-agent-team-node-processes to use it in all your projects, or to .claude/skills/cleanup-agent-team-node-processes in one project. Or install the common-tools plugin, which includes it: /plugin marketplace add ruan-cat/monorepo, then /plugin install common-tools@ruan-cat-tools.

### Does Cleanup agent team node processes run scripts?

Yes. It runs PowerShell scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Cleanup agent team node processes?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Cleanup agent team node processes?

The closest alternatives to Cleanup agent team node processes are Windows child process lifecycle, Automation audit ops, System audit, Disk cleanup and Agentsmd optimize.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Windows child process lifecycle](https://ai-powered.com/skills/windows-child-process-lifecycle): Windows child process lifecycle is an open-source agent skill for developer tools.
- [Automation audit ops](https://ai-powered.com/skills/automation-audit-ops): Automation audit ops is an open-source agent skill for developer tools.
- [System audit](https://ai-powered.com/skills/system-audit): System audit is an open-source agent skill for developer tools.
- [Disk cleanup](https://ai-powered.com/skills/disk-cleanup): Disk cleanup is an open-source agent skill for developer tools.
- [Agentsmd optimize](https://ai-powered.com/skills/agentsmd-optimize): Agentsmd optimize is an open-source agent skill for developer tools.
- [Use pnpm](https://ai-powered.com/skills/use-pnpm): Use pnpm is an open-source agent skill for developer tools.
- [Agent architecture audit](https://ai-powered.com/skills/agent-architecture-audit): Agent architecture audit is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/cleanup-agent-team-node-processes
