CLI reference
agent-gc with no arguments opens the same screen as the app, in the terminal: arrows move, space switches, o switches off everything unused for 30 days after asking, tab changes installation, c cleans, q quits.
Installation ids look like claude:~/.claude; agent-gc scan --json lists them, and the ids of every source.
agent-gc --help shows every command, agent-gc <command> --help one of them; --help never runs anything. An option a command does not know is an error, so a typo such as clean --dryrun stops instead of cleaning.
In a terminal, scan, clean, budget repo and toggle … unused off show a progress line on stderr while they work (what they are doing and for how long, e.g. ⠹ scanning · starting MCP servers to count their tools (3/12) · 4.1s); it is erased before the results, and never appears when stderr is not a terminal.
agent-gc scan
Section titled “agent-gc scan”agent-gc scan # cost, top sources, cleanable itemsagent-gc scan --jsonStart cost per installation, the heaviest sources with notes, what could be cleaned, what was switched off automatically (with restore ids) and, inside a repository with a budget file, its repo budget line. Changes no config and removes nothing. To size MCP servers it starts your configured stdio servers it has not counted in the last 24 hours; a repository’s .mcp.json servers only in a folder you trusted in Claude Code.
agent-gc clean
Section titled “agent-gc clean”agent-gc clean --dry-run # what would be removedagent-gc clean --yes # clean now, and confirm automatic modeagent-gc clean # clean now, once automatic mode is confirmedWithout --yes it refuses until automatic mode has been confirmed once. Everything removed stays restorable for a while. See Automatic cleaning.
agent-gc restore
Section titled “agent-gc restore”agent-gc restore # what can be put backagent-gc restore <id> # put one backagent-gc log
Section titled “agent-gc log”agent-gc log # the newest 50 things Agent GC didagent-gc log --processes --since 1d -v # every process stopped or ended today, full command linesagent-gc log --grep playwright # anything mentioning it: path, label or command lineagent-gc log -f # follow new entriesagent-gc log --json # one JSON object per lineagent-gc log --daemon # the background service's own logEvery entry has the time, the action (stop, end, quarantine, trash, delete, reclaim, worktree, switch-off, restore, …), what it was and, for processes, the full command line, why it was taken and how it ended (ended (SIGTERM), killed (SIGKILL after 5 s), already gone, resumed by someone else; left running). Filters: --since 30m|2h|3d|1w|<date>, --processes, --files, --sources, --action <a,b>, --grep <text>, -n <count>, --all. The journal is rotated at 4 MB, one older file is kept.
agent-gc auto
Section titled “agent-gc auto”agent-gc auto on # clean in the background, live: a login service (LaunchAgent / systemd)agent-gc auto offagent-gc auto statusagent-gc auto switch-off on # also switch off sources unused for 30 daysagent-gc auto switch-off on is the separate confirmation for switching off sources, needed once by users who confirmed automatic mode before that feature existed.
agent-gc toggle
Section titled “agent-gc toggle”agent-gc toggle claude:~/.claude mcp:global:meshy offagent-gc toggle claude:~/.claude unused off # every source not used in 30 days; each can go back onon switches a source back on.
agent-gc budget
Section titled “agent-gc budget”agent-gc budget claude:~/.claude 40000 # start-up budget: switch off only the heaviest unused sources until it fitsagent-gc budget claude:~/.claude off # remove itagent-gc budget repo [path] # this repository's start cost against its .agent-gc.toml budgetagent-gc budget repo exits 0 even when over. See Repository budget.
agent-gc notify
Section titled “agent-gc notify”agent-gc notify on # opt in: one line at the next session start after an automatic switch-offagent-gc notify offagent-gc top
Section titled “agent-gc top”agent-gc top # live view like htop: sessions and subagents, CPU, memory, context; sort, filter, endagent-gc top --json # one snapshot: account limits and the session treeSee agent-gc top.
agent-gc limits
Section titled “agent-gc limits”agent-gc limits on # opt in: record the plan's 5-hour and 7-day limits for `top` (wraps your status line; shared with sched)agent-gc limits status # per installation: installed or not, who uses it (limits, sched), whether your own status line is wrapped, age of the last numbersagent-gc limits off # puts back exactly the status line that was there (or none); kept while sched is onSee Limits.
agent-gc sched
Section titled “agent-gc sched”agent-gc sched on # opt in: warn and stop runaway Claude Code agents (asks first; --yes to skip)agent-gc sched status # on/off, hooks per installation, the subscription window, stopped agentsagent-gc sched release <id> # let a stopped agent continueagent-gc sched off # remove the hooks; your status line is restored unless limits is still onSee agent-gc sched.