Guide

brew cleanup on Mac, flag by flag.

Homebrew keeps every bottle and installer it downloads, and old versions of formulae you've upgraded. One command handles both, and a few flags decide how far it goes.

The short version

Run brew cleanup. It removes old versions of upgraded formulae and downloads more than 120 days old from ~/Library/Caches/Homebrew. To empty the download cache completely, run brew cleanup --prune=all. Add -n first to see what would go. Installed formulae and casks keep working.

Where the Homebrew cache is on a Mac

brew --cache

That prints ~/Library/Caches/Homebrew unless you've set HOMEBREW_CACHE.

WhatDefault locationOn one Mac
Downloads (bottles, casks)~/Library/Caches/Homebrew813 MB
Installed formulae, all versions/opt/homebrew/Cellar (Apple silicon), /usr/local/Cellar (Intel)Not measured

The cache size is from one developer Mac running Homebrew 7 in October 2026. The cache holds the bottle (prebuilt package) for each formula version you've installed, and the .dmg or .zip for each cask. The other place space builds up is the Cellar, where old versions of a formula can stay after an upgrade.

What brew cleanup removes

brew cleanup -n                # show what would be removed, remove nothing
brew cleanup                   # old versions, plus downloads over 120 days old
brew cleanup --prune=all       # every download in the cache
brew cleanup -s                # scrub: downloads even for the latest versions
brew cleanup node              # only one formula
  • Plain brew cleanup removes old versions of installed formulae, stale lock files, and downloads more than 120 days old. Change that age with HOMEBREW_CLEANUP_MAX_AGE_DAYS.
  • --prune=all removes every cache file regardless of age. --prune=30 keeps the last 30 days.
  • -s scrubs the cache, including downloads for the latest versions. Downloads for anything currently installed still stay; Homebrew's help says to delete "$(brew --cache)" yourself if you want those gone too.

Is it safe? Yes. Everything in the cache can be downloaded again, and installed packages don't need their bottles to run. The only thing you give up is reinstalling an old version offline. If you pinned a formula with brew pin, cleanup leaves its versions alone.

Homebrew already cleans up, mostly

Homebrew runs a cleanup for each formula you upgrade or reinstall, and a full cleanup every 30 days. So on most Macs, running it by hand reclaims hundreds of megabytes, not tens of gigabytes. On the Mac above, the cache was 813 MB. If you've set HOMEBREW_NO_INSTALL_CLEANUP, none of that happens, and the cache and Cellar keep growing until you run brew cleanup yourself.

The bigger wins in Homebrew

The cache is rarely the problem. What's installed is:

brew leaves                    # formulae you installed on purpose
brew autoremove -n             # dependencies nothing needs anymore
du -sh $(brew --prefix)/Cellar/* | sort -h | tail

Uninstall what you don't use with brew uninstall, then run brew autoremove to remove the dependencies it left behind. Big ones are usually language runtimes and databases: several Python, Node, or PostgreSQL versions installed side by side.

Next: pip's cache sits beside Homebrew's, and npm's is often the biggest. Or see every tool's cache.

Disk Forecast finds this for you

Homebrew's cache lives in ~/Library/Caches, so Disk Forecast lists it as the Homebrew entry under Cleanup › Safe to clear › App caches, checked by default, and moves it to the Trash. Old versions in the Cellar aren't listed; brew cleanup is the right tool for those. It's free.

Questions

What does brew cleanup do?

It removes old versions of installed formulae, stale lock files, and downloads more than 120 days old from Homebrew's cache. Add -n to see what it would remove first.

How do I clear the Homebrew cache completely?

Run brew cleanup --prune=all. It removes every file in the cache regardless of age. Downloads for installed packages can stay; delete the folder brew --cache prints to remove those too.

Where is the Homebrew cache on a Mac?

In ~/Library/Caches/Homebrew. Run brew --cache to confirm, or set HOMEBREW_CACHE to move it.

Is it safe to delete the Homebrew cache?

Yes. Installed formulae and casks don't need their downloads to run, and Homebrew downloads them again if you reinstall. You only lose the ability to reinstall an old version offline.

Know before it's full.

Free. No account, no subscription.

macOS 14 or later · Apple Silicon and Intel · brew install --cask coreyhaines31/tap/diskforecast