aspect output-basesshows what is there. It changes nothing.aspect gcremoves what nothing is using.
1. See what is there
--sort=size measures sizes, which takes a du of every base; drop it for a listing that returns at once.
Two numbers usually matter:
- Removable bases: orphaned (the workspace was deleted) and idle (unused for 30 days). The listing ends with their count and size.
- Running servers: each holds its memory until it has been idle for Bazel’s
--max_idle_secs(3 hours by default). The line under the census gives the total.
2. Preview
gc would remove and why, the stale download-cache entries, and the total it would free. Nothing is deleted.
3. Reclaim
4. Tune the rules
The grace period keeps an orphaned base for an hour after its last use, so a worktree torn down and recreated at the same path gets its base back.
5. Run it on a schedule
gc asks before deleting, and refuses off a terminal unless --force says it may. A nightly cron entry on a developer machine:
gc cannot find counts as gone.
Worktrees and agents
Each worktree is a new workspace path, so each gets its own output base, server andexternal/ tree. Deleting the worktree orphans them; gc removes them an hour after their last use.
aspect worktree avoids that by reusing a pool of slots at fixed paths, each keeping one warm output base for its next lease. gc does not treat a pool slot’s base as orphaned, though it still removes one idle past --base-max-idle-days; aspect worktree prune deletes slots that have gone stale, base and all.
Scripting
Both tasks take--output=json. For example, the workspaces whose bases gc would remove:

