← All guides

brew cleanup, properly

CacheCleaner guides · Updated July 18, 2026

Homebrew hoards by default: every bottle it ever downloaded stays in ~/Library/Caches/Homebrew, and outdated versions of installed formulae stay in the Cellar until you run brew cleanup.

See what's reclaimable

brew cleanup -n        # dry run – lists what would be removed and how much
du -sh ~/Library/Caches/Homebrew

Clean it

brew cleanup --prune=all   # all cached downloads + outdated versions
brew autoremove            # dependencies nothing needs anymore

Make it automatic

# in your shell profile:
export HOMEBREW_CLEANUP_MAX_AGE_DAYS=7
# or let every install/upgrade clean up after itself:
export HOMEBREW_NO_INSTALL_CLEANUP=   # unset = periodic auto-cleanup (default since 2019)

Homebrew already runs a periodic cleanup every 30 days; the env var tightens the window. The cache refills as you upgrade – cleaning it never breaks installed software.

CacheCleaner includes the Homebrew cache in its scan next to npm, cargo, pip and the rest – one pass over every package manager on the machine instead of remembering each tool's cleanup incantation.

Get CacheCleaner for Mac