Cleanup
driga cleanup lists disk that agents left behind. Nothing is removed
automatically, and nothing is removed on another machine.
driga cleanup list # candidates with evidencedriga cleanup list --sizes # walk sizes on demand (30 s cap per walk)driga cleanup list --why # include worktrees that don't qualify, and whydriga cleanup remove <id> --dry-run # print the exact commandsdriga cleanup remove <id> # re-verify, then askdriga cleanup remove --kind worktree --all # every ready worktree; skips anything changedIn the terminal UI, cleanup lives under Machines → d.
Candidates
Section titled “Candidates”Worktrees. A linked worktree (never the main or a locked one) with no live
session or process inside, no tracked or untracked changes, commits merged into
the default branch or pushed, and idle for cleanup.worktree_idle (default
168h). The action is git worktree remove, git worktree prune, then
git branch -d only when merged, never -D. Ignored build output listed in
cleanup.regenerable (such as node_modules/ and target/) goes with the
worktree; any other ignored file, such as .env or a local database, makes the
candidate needs-review, and removing it needs --include-ignored.
Scratch. A Claude Code per-session temporary directory whose session ended at least 24 hours ago and that has no open files. It is moved to the trash (macOS Trash or the freedesktop trash on Linux), never deleted.
History. Agent history sizes by age. Report only: use the agent’s own
retention setting, such as Claude Code’s cleanupPeriodDays.
Safety
Section titled “Safety”Every check runs again just before acting; if anything changed, the action is
refused with the reason. Each attempt is appended to cleanup.log in the data
directory. Bulk removal reports completed, skipped and failed counts and exits
1 if any item fails.
On Windows (experimental), verified worktrees go to the Recycle Bin and Claude scratch cleanup is refused; see Windows.
The MCP tool list_cleanup_candidates reads the same candidates and never
removes anything.