Deleting the Homebrew cache is safe. ~/Library/Caches/Homebrew holds downloads and metadata, and your installed packages live in the Cellar, which the cache does not touch. Before you reach for the folder, ask brew cleanup what it would remove. Homebrew trims the cache on its own, and on my Mac the whole folder took 527 MB next to 2.1 GB of installed formulae.
Main rule: run every cleanup command with -n first. It prints what it would remove and how much space that frees.
Quick answer
- Find the folder with
brew --cache. - Run
brew cleanup -nto see what a routine cleanup removes. - Run
brew cleanup --prune=all -nto see what clearing the whole cache frees. - Run the command you chose without
-n. - Run
brew autoremove -nto find dependencies nothing needs anymore. - Leave the Cellar to
brew uninstall.
What lives in the cache
I measured the cache on 25 October 2026 on my Mac, with Homebrew 7.0.10:
Inside ~/Library/Caches/Homebrew | What it holds | On my Mac |
|---|---|---|
downloads | bottles, source archives and cask installers | 484 MB |
api | formula and cask metadata from Homebrew’s JSON API | 30 MB |
bootsnap | a load cache that speeds up brew itself | 13 MB |
Installed formulae sit elsewhere, in the Cellar under brew --prefix. On Apple silicon that is /opt/homebrew/Cellar, and on my Mac it took 2.1 GB. Homebrew’s logs live in ~/Library/Logs/Homebrew.
What Homebrew already cleans
The brew manpage describes two automatic rules:
brew install,brew upgradeandbrew reinstallrunbrew cleanupfor the packages they touch, and every 30 days for all packages. SettingHOMEBREW_NO_INSTALL_CLEANUPturns this off.brew cleanupremoves downloads older than 120 days.HOMEBREW_CLEANUP_MAX_AGE_DAYSchanges that number.
A cleanup also removes outdated downloads, stale lock files, and old versions of installed formulae. That last part frees space in the Cellar, which is often where the larger savings are.
On my Mac brew cleanup -n found nothing to remove, because the automatic cleanup had already done the routine work. brew cleanup --prune=all -n reported it would free about 507 MB.
What deleting the cache changes
- Installed packages stay.
brew listshows the same formulae and casks afterwards. - Reinstalls download again. Reinstalling or upgrading a package fetches its bottle or installer from the network.
- Cask installers are gone. The
.dmgand.pkgfiles that casks downloaded leave with the cache. - brew recreates the folder. The next download writes it back.
The commands, from mild to complete
brew cleanup -n # what a routine cleanup would remove
brew cleanup # remove it
brew cleanup --prune=all -n # what removing every cached file would free
brew cleanup --prune=all # remove it
brew cleanup -s, the scrub option, also removes downloads for the latest versions. Downloads of formulae and casks you have installed still stay, and the manpage points to rm -rf "$(brew --cache)" if you want those gone as well. Moving the folder to the Trash in Finder has the same effect and gives you a way back.
brew autoremove -n covers a different leftover: formulae installed only as dependencies of something you removed. It frees space in the Cellar, not in the cache.
When the cache is not the problem
If the cache is a few hundred megabytes, the space you want is somewhere else. Check the Cellar with du -sh "$(brew --prefix)/Cellar" and uninstall what you no longer use. Then look at the developer folders that usually dwarf Homebrew: Xcode’s DerivedData, simulators, and package caches such as SwiftPM.
Bottom line
Clearing the Homebrew cache breaks nothing, and the folder is rarely large, because Homebrew prunes it every 30 days. Use brew cleanup -n to see what is left, --prune=all when you want the folder empty, and brew autoremove for dependencies nothing needs. Installed packages stay put through all of it.
Frequently asked questions
Is it safe to delete ~/Library/Caches/Homebrew?
Yes. The cache holds downloads, API metadata and brew's own load cache. Installed packages live in the Cellar under brew --prefix and stay where they are. The only cost is that a reinstall or upgrade downloads its files again.
Does brew cleanup delete installed packages?
No. It removes outdated downloads, stale lock files and old versions of installed formulae. The current version of everything you installed stays.
How often does Homebrew clean its cache on its own?
brew install, brew upgrade and brew reinstall run a cleanup for the packages they touch, and every 30 days for all packages, unless HOMEBREW_NO_INSTALL_CLEANUP is set. A cleanup removes downloads older than 120 days by default, set by HOMEBREW_CLEANUP_MAX_AGE_DAYS.
How do I clear the entire Homebrew cache?
Run brew cleanup --prune=all -n to see what it would remove and how much space it frees, then run it again without -n. On my Mac it reported about 507 MB of the 527 MB folder.
Where is the Homebrew cache on Mac?
Run brew --cache. On macOS it prints ~/Library/Caches/Homebrew. Installed formulae are in the Cellar, which is /opt/homebrew/Cellar on Apple silicon.