Disk and cleanup
Runs keep their records, worktrees and logs so you can always see what happened. forge also keeps a list of everything it puts on disk, so taking space back is one command.
See what forge takes
forge du # this repo forge du --all # every repo forge knows
It lists each run folder's review snapshots, logs and other files, each run's worktree folder, and forge's data home, with the command that takes each part back. forge-ui's Disk screen charts the same report by kind and by repository.
Take space back, keep every run
forge runs compact --repo . # remove leftover review snapshots forge runs compact --repo . --logs # also gzip each agent's log copy
Compaction imports the run into the dataset first, holds the run's lock, skips active runs and worktrees, and reports anything forge didn't create instead of deleting it. On one real 2.3 GB plan folder it took back 2.2 GB. At run start forge also compacts idle runs in the background and warns past a size you set:
forge config set storage.compact auto # or off forge config set storage.warn-gb 20 # or off
Delete a run
forge runs rm "$PLAN" --dry-run forge runs rm "$PLAN" --worktrees --branches
The run's lessons stay in the dataset. Failed tasks' worktrees are the record of what went wrong, so forge never removes them on its own.
Remove worktrees
forge worktrees rm ../.forge-worktrees/plan/* --dry-run forge worktrees rm ../.forge-worktrees/plan/* --branches
It removes finished and failed worktrees and leftover folders by forge-ui's rules: one in use, with uncommitted changes, locked or still needed by its run is skipped, with the reason, and nothing is forced. forge-ui's Worktrees screen does the same for the rows you select.
Full reference Every flag and edge case: docs/commands.md