agents-ps: see what your AI agents are running on your Mac
agents-ps is a free command-line tool that finds every Claude Code, Codex CLI, Cursor Agent, Aider, Gemini CLI, opencode, Goose, Amp, omp and Ollama session on your Mac, groups everything each one started into a tree, and shows CPU, memory and listening ports per process. It also lists the processes agents left behind after they exited. It is read-only: it never kills, signals or changes anything.
Install
brew install nqhung291/tap/agents-psOr build from source with cargo install --git https://github.com/nqhung291/agents-ps, or download the universal binary from the GitHub releases. Source and docs: github.com/nqhung291/agents-ps.
Commands
agents-ps: one block per running agent session with its full process tree, CPU %, memory, ports and per-tree totals, largest first.agents-ps orphans: processes still running after the agent that started them exited, with their age, memory, ports and the agent that most likely started them.agents-ps ports: every listening TCP port held by an agent tree or orphan, and who owns it.--jsonon any command for scripts;--no-hintto hide the one-line footer.
Example: find what an agent left behind
$ agents-ps orphans
agents-ps orphans 1 process left behind by agents that already exited
PID PROCESS AGE RSS PORTS LIKELY FROM EVIDENCE
15687 bash sleep 300 & bash -c "sle… 21h 30m 5.6 MiB - Claude Code env marker
agents-ps never kills anything. To stop them yourself:
kill -TERM 15687agents-ps prints the kill command; you decide whether to run it. To stop a whole tree without respawns, see how to kill a process tree on macOS.
agents-ps or Agents Monitor?
Use agents-ps when you want a quick look from the terminal. Use Agents Monitor when you want to see it live, get warned before your Mac runs out of memory, and clean up without typing pids.
| Feature | agents-ps (free) | Agents Monitor |
|---|---|---|
| Price | Free, MIT licensed | $39.99 once, lifetime updates |
| Agent sessions, trees, CPU, RAM, ports | Snapshot when you run it | Live, refreshed every 2 seconds |
| Orphans left by exited agents | Listed with the kill command to copy | Listed, cleaned in one confirmed click |
| Killing processes | Never. You run the command yourself | Safe tree kill with confirmation and guards |
| Alerts at CPU or RAM limits | No | Per process and per tree |
| Idle orphan auto-kill | No | Opt-in, with a countdown |
| Working-folder growth | No | node_modules, target, .venv and more |
| Interface | Terminal, plus --json for scripts | Native menu-bar app and window |