How to clear the Homebrew cache on your Mac (yes, it's safe to delete)
~/Library/Caches/HomebrewYes, the Homebrew cache is safe to delete, and there's an official command for it: brew cleanup --prune=all. Nearly everything in ~/Library/Caches/Homebrew is a leftover download: bottles (pre-built packages) and cask app installers Homebrew kept after installing them. Your installed tools and apps live elsewhere and keep working. The only cost is that Homebrew re-downloads a file if it ever needs it again.
What it is
~/Library/Caches/Homebrew is Homebrew's download cache (the ~ means your home folder, /Users/yourname). When you run brew install, Homebrew downloads a bottle, which is a pre-built copy of the package, installs it, and keeps the downloaded file here in case you reinstall the same version later. Casks do the same thing with full app installers, so the .dmg, .pkg, or .zip for apps you've installed through Homebrew sits in this folder too. You can confirm the location on your machine by running brew --cache in Terminal.
The folder grows with every install and every upgrade, because each new version means a new download and the old files don't clean themselves up right away. Casks are the usual heavyweight: a single app installer can run to hundreds of megabytes, and they add up fast. On a Mac that gets regular brew upgrade runs, the cache often reaches several gigabytes, and heavy cask users can see 10 GB or more.
Is it safe to delete?
Yes, entirely. The software Homebrew installed does not live in this folder. Formulae are unpacked into the Homebrew prefix (/opt/homebrew on Apple silicon, /usr/local on Intel Macs), and cask apps end up in /Applications. The cache holds only the source downloads those installs came from, kept so a reinstall of the same version could skip the network. Delete it all and every installed tool and app keeps running exactly as before.
The worst case is mild: if you reinstall or upgrade something whose file was cached, Homebrew downloads it again. That's a bit of bandwidth and a short wait, nothing more. Diskmack flags this folder automatically and clears it using Homebrew's own cleanup command rather than raw deletion. Either way, nothing here is unique data, so there is no scenario where clearing it loses something you can't get back.
How to check its size
In Finder: In Finder, choose Go > Go to Folder (or press Command-Shift-G), type ~/Library/Caches/Homebrew and press Return. Then press Command-Up Arrow to jump to the Caches folder with Homebrew selected, and press Command-I to see its size.
In Terminal:
du -sh ~/Library/Caches/HomebrewHow to clean it
- Make sure no brew command is currently running in any Terminal window.
- In Finder, choose Go > Go to Folder (Command-Shift-G), type ~/Library/Caches/Homebrew and press Return.
- Press Command-Up Arrow. Finder jumps to the Caches folder with Homebrew selected.
- Press Command-Delete to move the folder to the Trash. Homebrew recreates it on its next download.
- Empty the Trash to actually reclaim the space.
The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.
brew cleanup --prune=allPlain brew cleanup is more conservative: it removes outdated package versions but only prunes cached downloads past a certain age. The --prune=all flag is what clears every cached download regardless of age. Add -n first (brew cleanup --prune=all -n) if you want a dry run that lists what would go.
Will it come back?
Yes. Every brew install and brew upgrade drops a fresh download into the cache, so it starts refilling the moment you use Homebrew again. Files are re-downloaded only when a formula or cask actually needs them, so the folder regrows in proportion to how often you install and upgrade. Someone running brew upgrade weekly can see gigabytes back within a few months; someone who installed three tools last year may never notice it again. Homebrew also triggers its own periodic cleanup of stale files when you run other brew commands, which slows the growth but doesn't stop it. Treat clearing it as routine maintenance, not a one-time fix.
Common questions
Will clearing the cache uninstall my Homebrew packages or apps?
No. Installed formulae live in the Homebrew prefix (/opt/homebrew or /usr/local) and cask apps live in /Applications. The cache only holds the installer files those came from. Everything you installed keeps working after the cache is gone.
What's the difference between brew cleanup and brew cleanup --prune=all?
Plain brew cleanup removes old versions of installed packages and prunes cache files past a default age, so recent downloads survive. Adding --prune=all deletes every cached download no matter how new it is. If your goal is maximum space back, use --prune=all.
Can I just delete the folder in Finder instead of using the command?
Yes. The cache is disposable, and Homebrew recreates the folder the next time it downloads something. The brew cleanup command is still the better habit because it also removes outdated versions of installed packages, which Finder deletion of the cache doesn't touch.
Why is my Homebrew cache so large?
Usually casks. Most formula bottles are small (big ones like llvm are the exception), but cask downloads are complete app installers, and a single one can be hundreds of megabytes. If you install or update apps like browsers, editors, or Docker through Homebrew, those installers stack up quickly.
Related folders
- Can You Delete the Library Caches Folder on a Mac?
- What Is the .cache Folder on a Mac, and Is It Safe to Delete?
- How to Clear the pip Cache on Your Mac (and Why It's Safe to Delete)
- Clearing the Cargo Cache on Mac: Is ~/.cargo/registry Safe to Delete?
- Can You Delete the .gem Folder on Your Mac?
- Is It Safe to Clear the Composer Cache on a Mac? (~/.composer/cache)