Agent Janitor

Process hygiene for agent machines — finds the background processes your agent left behind (dev servers, tunnels, watchers, nohup jobs) using evidence signals (ppid=1 reparent, port listener via /proc/net/tcp{,6}, dev-server traits, TTL exceeded) and attributes them to the originating tool call via agent-ledger's ledger when present. Dry-run by default: nothing is killed until you write policy_mode=enforce; system daemons and host/VM management agents are exempt by name, a user-editable whitelist covers your real infrastructure, and each kill re-reads the cmdline first (SIGTERM, 2s, SIGKILL with PID-reuse check). stdlib-only, fails open.

Good to know before installing

Inside Hermes it only appends terminal commands that look like they start background work (first 300 characters, which can include inline secrets) to plugin-data/agent-janitor/spawns.jsonl, and reads agent-ledger's ledger.db read-only when present. Killing is a separate CLI you run yourself (janitor_cli.py sweep): after you write "enforce" to plugin-data/agent-janitor/policy_mode it sends SIGTERM then SIGKILL to every process re-parented to PID 1 for over a minute that is not on its built-in exempt list or your whitelist, whoever started it (for example a tmux server or a nohup'd hermes gateway), including other users' processes when run as root. Dry-run first; the dry-run list is the kill list.

From the plugin's catalog listing.

How to install

  1. Install it. Hermes asks for any API keys it needs, then asks whether to turn it on.
    hermes plugins install agent-janitor
  2. Said no? Turn it on later:
    hermes plugins enable agent-janitor
  3. Restart Hermes so it loads the plugin.

Some plugins also need a sign-in or settings: see Full setup & settings. Memory plugins ask whether to become your memory provider instead. Steps follow the official plugins guide (opens in a new tab).

Category
Cost, speed & monitoring
Maintained by
ZidoCode (Community)
Needs
No API keys declared
Needs Hermes
0.21.6 or newer
Version
0.3.1
In the catalog
2026-10-13
GitHub stars
3

Full setup & settings ↗Source code ↗

More in cost, speed & monitoring

All cost, speed & monitoring plugins

New Hermes Agent updates every day on X. Follow @HermesWatcher

← All plugins