Agent Broom

Agent Broom is the portable CLI + skill package for agent process hygiene: a small memory hook plus deterministic shell scripts for tracking, auditing, and cleaning up agent-spawned local processes and build artifacts.

Agent Broom packages the same model used by Kevin's Browser Testing Skills skill: the prompt stays small, while the script owns process tracking, localhost listener audit, dry-run cleanup, and artifact deletion. The repo exposes bin/agent-broom plus lib/*.sh; the reusable skill lives at skill/SKILL.md. Source: Kevin-Liu-01/agent-broom README, commit 1bab484c38a3061826cbb93cec591c5d786a48db

When To Use

Use Agent Broom before starting another dev server, before ending a turn that spawned long-running processes, when CPU or memory is high, when disk is low, or when a user asks what is running. The correct operating shape is audit first, then act only after reviewing ownership and risk.

In this wiki, Browser Testing Skills remains the canonical skill owner so there is one process-hygiene route. The full Agent Broom repo is vendored at skills/productivity/cleanup-terminals-browsers/references/agent-broom/ for source comparison and cross-harness reconstruction.

Commands

Agent Broom exposes the following command family:

agent-broom list
agent-broom audit
agent-broom add --pid <PID> --kind dev --port <PORT> --purpose "<why>" -- <command>
agent-broom stop
agent-broom stop --kill
agent-broom prune
agent-broom artifacts
agent-broom artifacts --clean
agent-broom devclean
agent-broom devclean --deep
agent-broom devclean --optimize
agent-broom devclean --disk
agent-broom devclean --apply
agent-broom doctor

Everything risky is dry-run first. stop --kill, artifacts --clean, and devclean --apply are the explicit mutation gates.

Safety Model

Agent Broom records long-running commands in ~/.cache/agent-processes/ledger.tsv, including repo root, cwd, PID, PGID, process kind, port, purpose, and command. That ledger turns cleanup from inference into ownership-aware accounting.

The safety model is conservative: kill by process group only after ownership is clear, prefer SIGTERM before SIGKILL, never kill the editor, Codex, the user's shell, or shared MCP servers, and delete only known regenerable artifacts.


Timeline

  • 2026-06-30 | Imported Agent Broom as the portable package/source form for Kevin's process-hygiene stack. The local cleanup skill keeps ownership, and the full repo is vendored under the skill's references with commit 1bab484c38a3061826cbb93cec591c5d786a48db. Source: https://github.com/Kevin-Liu-01/agent-broom