Back to Blog

Is It Safe to Delete the Homebrew Cache on Mac?

What ~/Library/Caches/Homebrew holds, why deleting it never uninstalls anything, what brew cleanup already removes on its own, and the commands to clear the rest.

Published October 25, 2026 Author Vladimir Chemeris Read time 3 min read
HomebrewCachesDeveloper Cleanup

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

  1. Find the folder with brew --cache.
  2. Run brew cleanup -n to see what a routine cleanup removes.
  3. Run brew cleanup --prune=all -n to see what clearing the whole cache frees.
  4. Run the command you chose without -n.
  5. Run brew autoremove -n to find dependencies nothing needs anymore.
  6. 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/HomebrewWhat it holdsOn my Mac
downloadsbottles, source archives and cask installers484 MB
apiformula and cask metadata from Homebrew’s JSON API30 MB
bootsnapa load cache that speeds up brew itself13 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 upgrade and brew reinstall run brew cleanup for the packages they touch, and every 30 days for all packages. Setting HOMEBREW_NO_INSTALL_CLEANUP turns this off.
  • brew cleanup removes downloads older than 120 days. HOMEBREW_CLEANUP_MAX_AGE_DAYS changes 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 list shows 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 .dmg and .pkg files 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.

About the author

Vladimir Chemeris

Founder, StorageRadar

Vladimir Chemeris builds StorageRadar, a privacy-first macOS storage analysis app focused on review-first cleanup, developer storage, and before-and-after visibility.

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.

Sources & references

See every package cache with its size.

StorageRadar's Dev Cleanup sizes the Homebrew, npm, pnpm, Yarn, pip and SwiftPM caches next to Xcode's folders, labels each by risk, and shows the result of a Dry Run before cleanup.