Agentinel — local resource sentinel (CLI)
Agentinel ships a zero-overhead CLI (~12 MB, no WebView) that snapshots every
process on the machine, classifies AI-agent CLIs, and flags leaks / zombies /
duplicate sessions / heavy disk. Use it to answer "what's going on with my
machine right now" without guessing.
When to use
Trigger when the user asks things like:
- "What's eating my RAM / CPU?" · "為什麼這麼吃記憶體?" · "什么最吃内存?"
- "Do I have any zombie or forgotten agent sessions?" · "有沒有忘了關的 agent?"
- "Which Claude / Codex sessions are still running?"
- "Is anything leaking?" · "What can I clean up on disk?" · "磁碟可以清什麼?"
How to run
Run from the repo root (or anywhere agent_monitor/ is importable). The wrapper
./agentinel auto-finds a sibling .venv; otherwise use python -m agent_monitor.
Prefer --json for parsing, fall back to the text table for display.
agentinel scan --json # whole-system snapshot (parse this)
agentinel scan --agents-only --json # AI agents only
agentinel scan --top 50 # text table, top 50
agentinel advise # local AI CLI writes markdown advice
agentinel advise --engine codex # pick the engine (claude|codex|gemini|opencode)
agentinel doctor # which AI CLIs are installed + fallback order
# (equivalently: python -m agent_monitor <subcommand> …)
What scan --json returns
{ system, processes[], findings[] }:
- system:
ram_used_gb, ram_total_gb, ram_pct, cpu_pct, swap_used_gb, swap_total_gb
- processes[]:
pid, label, category, project, mem_mb, cpu, age_hr,
idle_min, parent_name, parent_alive, ports[], children, cmdline
- findings[]: rule-engine anomalies —
{ severity, title, detail, pids, action }
How to respond
- Summarize the 1–2 things that matter most (biggest RAM users, suspected leaks,
idle zombies, duplicate sessions in the same project).
- Cite concrete evidence: memory size/growth,
idle_min, parent_alive=false,
bound ports, child count.
- Recommend keep / end / watch for each — but do not kill or delete anything.
Safety
scan / advise / doctor are read-only. There is no CLI kill or cleanup —
do not invent one. Destructive actions (kill / suspend / disk cleanup) live only in
the GUI's confirm-to-run flow (python agentinel.py). If the user wants to act, point
them there, or ask for explicit confirmation before running anything destructive.
1---2name: agentinel3description: Inspect this machine's live resource usage via the Agentinel CLI — find runaway / zombie / leaking AI-agent processes (Claude Code, Codex, Gemini, OpenCode, MCP & dev servers, Ollama…), duplicate sessions, heavy memory users, and reclaimable disk caches. Use when the user asks what's eating RAM/CPU/disk, whether they have forgotten or leaking agent sessions, which agents are still running, or wants a cleanup recommendation. Read-only — it never kills or deletes.4metadata:5 source: https://skillmd.com/skills/0x0funky/agentinel6---78# Agentinel — local resource sentinel (CLI)910Agentinel ships a zero-overhead CLI (~12 MB, no WebView) that snapshots every11process on the machine, classifies AI-agent CLIs, and flags leaks / zombies /12duplicate sessions / heavy disk. Use it to answer "what's going on with my13machine right now" without guessing.1415## When to use1617Trigger when the user asks things like:1819- "What's eating my RAM / CPU?" · "為什麼這麼吃記憶體?" · "什么最吃内存?"20- "Do I have any zombie or forgotten agent sessions?" · "有沒有忘了關的 agent?"21- "Which Claude / Codex sessions are still running?"22- "Is anything leaking?" · "What can I clean up on disk?" · "磁碟可以清什麼?"2324## How to run2526Run from the repo root (or anywhere `agent_monitor/` is importable). The wrapper27`./agentinel` auto-finds a sibling `.venv`; otherwise use `python -m agent_monitor`.28**Prefer `--json` for parsing**, fall back to the text table for display.2930```bash31agentinel scan --json # whole-system snapshot (parse this)32agentinel scan --agents-only --json # AI agents only33agentinel scan --top 50 # text table, top 5034agentinel advise # local AI CLI writes markdown advice35agentinel advise --engine codex # pick the engine (claude|codex|gemini|opencode)36agentinel doctor # which AI CLIs are installed + fallback order37# (equivalently: python -m agent_monitor <subcommand> …)38```3940## What `scan --json` returns4142`{ system, processes[], findings[] }`:4344- **system**: `ram_used_gb`, `ram_total_gb`, `ram_pct`, `cpu_pct`, `swap_used_gb`, `swap_total_gb`45- **processes[]**: `pid`, `label`, `category`, `project`, `mem_mb`, `cpu`, `age_hr`,46 `idle_min`, `parent_name`, `parent_alive`, `ports[]`, `children`, `cmdline`47- **findings[]**: rule-engine anomalies — `{ severity, title, detail, pids, action }`4849## How to respond50511. Summarize the 1–2 things that matter most (biggest RAM users, suspected leaks,52 idle zombies, duplicate sessions in the same project).532. Cite concrete evidence: memory size/growth, `idle_min`, `parent_alive=false`,54 bound `ports`, child count.553. Recommend **keep / end / watch** for each — but **do not kill or delete anything.**5657## Safety5859- `scan` / `advise` / `doctor` are **read-only**. There is **no** CLI kill or cleanup —60 do not invent one. Destructive actions (kill / suspend / disk cleanup) live only in61 the GUI's confirm-to-run flow (`python agentinel.py`). If the user wants to act, point62 them there, or ask for explicit confirmation before running anything destructive.