Reclaim Disk Space with brew cleanup
brew cleanup removes old version kegs and cached downloads; -s also scrubs the download cache, --prune=all removes everything cached.
01Command
$ brew cleanup -s && brew cleanup --prune=all02What it does
Homebrew quietly keeps old kegs for 120 days so you can roll back, and every .tar.gz it downloads stays in the cache — on active machines this accumulates to several gigabytes. Preview the damage with `brew cleanup -ns` (dry run) before committing. Cleanup runs automatically after some brew commands on newer versions, but an explicit periodic `brew cleanup -s` is still worth scheduling on CI and build machines.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- Homebrew Man PageEvidence: Documents brew cleanup (--scrub/-s to clear cache, --prune=all to remove all cached downloads) and the default 120-day retention.
Last verified: 2026-09-17 · Category: Developer
06Related solutions
See the full APFS container layout: every volume, its capacity, used space, and mounted snapshots.
List what an installer actually put on your disk, long after the installer window closed.
The built-in tool for the hidden ._* files that litter non-HFS volumes and clog network shares.