Skip to content

Automatic cleaning

On first launch it only shows what it could clean. Nothing is removed or switched off until you confirm automatic cleaning once: Clean automatically in the app or the TUI, agent-gc clean --yes or agent-gc auto on. That one-time confirmation is what these docs call automatic mode; it covers both lists below. After that it collects as things happen — an agent exiting, files settling, an object reaching its age — and at least daily; it removes only:

What When
Agent temp session dirs untouched for 3 days, no live agent could own them, no unmerged worktree inside
Interrupted plugin installs (temp_git_*) older than a day
Plugin versions no install points at untouched for 7 days
Transcripts older than your agent’s own cleanupPeriodDays
Orphaned helper processes parent agent gone, and it was the agent’s child, part of a configured MCP server’s process tree (npx/uvx launchers included), or runs a configured MCP command
Worktrees clean, fully merged into the default branch, and untouched for 3 days with no live session inside (ignored files such as .env go to the graveyard with it)

From then on it also switches off context sources. Context sources (plugins, skills, MCP servers) are switched off automatically only after the user has turned automatic mode on, only when unused, only between sessions, and always reversibly. Concretely: unused for 30 days (and first seen at least 30 days ago), nothing running, and hooks are excluded. The app and the TUI list what was switched off with Bring back, agent-gc scan prints it with restore ids, and a source you bring back is never taken again. An optional start-up budget (agent-gc budget) takes only the heaviest unused ones. A one-line notice at the next session start is opt-in (agent-gc notify on). Switching off sources needs its own confirmation for users who confirmed automatic mode before this version: the app, the TUI and agent-gc scan ask once (agent-gc auto switch-off on).

It never kills an agent session (idle ones get an End button), never touches agent memory, and never deletes a config.