Is it safe to delete the Homebrew cache on Mac?
Safe~/Library/Caches/Homebrew
Yes. ~/Library/Caches/Homebrew only holds downloads Homebrew has already used. How to measure it, clear it with brew cleanup and what to leave alone.
Verdict: Safe. Everything in ~/Library/Caches/Homebrew is a download Homebrew has already used, so you can clear it, and Homebrew fetches anything it needs again the next time you install or reinstall. The cleanest way is brew cleanup --prune=all, which empties the cache and tidies old versions in one go.
What lives in the Homebrew cache
Homebrew keeps the files it downloads so it does not have to fetch them twice. Run brew --cache to see where; on a standard install it prints ~/Library/Caches/Homebrew. Inside you will find:
- downloads: bottles (pre-built packages) and source archives for the formulae you have installed.
- Cask: installers for apps you added with
brew install --cask, such as.dmgand.zipfiles. - api and other small folders: package information Homebrew fetches when it updates, and files that make Homebrew start faster.
The installed software itself is not here. On Apple silicon Macs, Homebrew lives in /opt/homebrew, with formulae in its Cellar. Cask apps usually go into your Applications folder.
Homebrew also cleans this folder for you. Its manual says brew cleanup runs for the packages you install, and every 30 days for all packages, unless you have set HOMEBREW_NO_INSTALL_CLEANUP. On the macOS 15.5 Mac we checked this on, the cache came to 57 MB.
What happens if you delete it
- Rebuilds by itself: everything. Package information downloads again on the next
brew update, and bottles and installers download again if you reinstall or upgrade. - Costs a little time: reinstalling something whose download you deleted means fetching it again, so you need a network connection.
- Lost for good: nothing you made yourself. Your installed formulae, casks and their settings are elsewhere.
One exception is worth knowing. If a package's download has disappeared from the internet, a cached copy is the only way to reinstall that exact version. That is rare, and only matters if you depend on an old, unmaintained package.
How to check its size safely
In Terminal, run:
du -sh "$(brew --cache)"
This prints the cache's size. It only reads. The quotes matter if the path ever contains a space.
To see what brew cleanup would remove, and how much space it would free, without deleting anything:
brew cleanup -n
-n is short for --dry-run. Homebrew lists each file it would remove and ends with an estimate of the space it would free.
In Finder, choose Go > Go to Folder, paste ~/Library/Caches/Homebrew, select the folder and choose File > Get Info.
The safest way to get the space back
Preview with
brew cleanup -n.Run the normal clean:
brew cleanupThis removes cached downloads older than 120 days and old versions of the packages you have installed. Warning: old versions are deleted for good, so pin anything you rely on with
brew pinfirst.To empty the download cache completely:
brew cleanup --prune=allThis removes every cached file, whatever its age, as well as doing a normal cleanup. Use a number of days instead, such as
--prune=7, to keep recent downloads.Check the result with
du -sh "$(brew --cache)"again.
If you would rather do it by hand, quit any brew command that is running, open the folder in Finder and move its contents to the Bin, then empty it. Using Homebrew's own command is better, because it also removes old versions and stale lock files.
What never to touch
/opt/homebrewitself, or/usr/localon Intel Macs. That is where installed software lives. Remove packages withbrew uninstall, not Finder.- The cache while
brewis running. Wait for installs and upgrades to finish. - Cask apps in Applications. Uninstall them with
brew uninstall --caskso Homebrew's records stay in step.
The cache is usually the small part of Homebrew's footprint. Our brew cleanup guide covers old versions, orphaned dependencies and unused packages. Other developer caches worth checking sit in ~/Library/Caches and the npm cache.
How Headroom helps
Headroom's Clean scan lists ~/Library/Caches/Homebrew under Developer caches as "Homebrew downloads", with the note "Installers Homebrew has already used." It is ticked by default and deleted for good when you clean, since Homebrew downloads again when needed. Headroom never changes /opt/homebrew; the Space map only shows it, as "Command-line tools installed with Homebrew". The scan and map are free. The $19 one-time licence clears what you tick. See the cleaner or download Headroom.
Questions
Does deleting the Homebrew cache uninstall my packages?
No. Installed formulae live in /opt/homebrew on Apple silicon Macs. The cache only holds downloaded bottles, source archives and cask installers that Homebrew has already used.
What is the difference between brew cleanup and brew cleanup --prune=all?
brew cleanup removes old versions of installed packages and cached downloads older than 120 days. Adding --prune=all removes every cached download whatever its age.
Where is the Homebrew cache on a Mac?
Run brew --cache to print it. On a standard install it is ~/Library/Caches/Homebrew.
Why is my Homebrew cache so small?
Homebrew tidies up after itself. Its manual says brew cleanup runs after installs and every 30 days for all packages, unless HOMEBREW_NO_INSTALL_CLEANUP is set.