MacBook App Cleaner
Home › Blog › How to Clean Homebrew Cache on a Mac

How to Clean Homebrew Cache on a Mac

Published August 16, 2026 · 6 min read · By the MacBook App Cleaner team

In short: Homebrew quietly stashes old downloads and outdated versions that can eat gigabytes over time. Here's how to clean the Homebrew cache on your Mac using the built-in brew commands, plus a couple of safety habits so you never remove more than you meant to.

If you use Homebrew to install command-line tools and apps, it slowly builds up a cache of downloaded files and older package versions. None of this is dangerous, but it can quietly grow to several gigabytes. The good news is that Homebrew ships with its own cleanup tools, so you rarely need anything else to reclaim that space.

This guide walks through how to clean the Homebrew cache on your Mac using the official commands, what each one actually does, and how to check your work. It applies to macOS 14 (Sonoma) and macOS 15 (Sequoia).

What Homebrew Stores and Why It Grows

Every time you install or upgrade a package, Homebrew downloads a file (a "bottle" or source archive) into a cache folder. It keeps those downloads, plus older versions of formulae you've upgraded, in case you need them again. Over months of updates, that adds up.

You can see where the cache lives by running this in Terminal:

brew --cache

On Apple Silicon Macs, Homebrew itself installs under /opt/homebrew, while the download cache typically sits at ~/Library/Caches/Homebrew. Because it's inside your home folder, this is user-level junk, which is exactly the kind of thing that's safe to trim.

Run brew cleanup, the Right Way

The main command is brew cleanup. By default it removes outdated downloads and old versions of packages you've since upgraded. Before you delete anything, preview what it would touch:

brew cleanup --dry-run

The --dry-run flag lists the files Homebrew would remove without actually removing them. This is the calm way to work: look first, then decide. When you're happy with the list, run it for real:

brew cleanup

Homebrew prints how much space it freed at the end. If you want it to also clear the download cache for the latest versions (not just old ones), add the -s flag:

brew cleanup -s

That -s scrubs the download cache more aggressively. It's still safe, but it means the next install of a package will re-download its files instead of reusing a cached copy.

Remove Unused Dependencies with autoremove

Over time you accumulate packages that were only installed as dependencies of something you've since uninstalled. Homebrew can find and remove those:

brew autoremove --dry-run

Again, preview first. If the list looks right, drop the flag:

brew autoremove

This only targets formulae that nothing else depends on, so it won't break a tool you actually use. Pairing brew autoremove with brew cleanup is the standard one-two for reclaiming space.

Check the Health of Your Setup

After cleaning, it's worth running Homebrew's built-in checkup:

brew doctor

This scans for common problems, such as broken symlinks or leftover files, and tells you exactly what (if anything) needs attention. Most warnings are harmless, and brew doctor usually suggests the precise command to fix each one. You can also see what's installed and outdated with brew list and brew outdated, which helps you decide whether an upgrade is worth doing before you clean.

A Quick Word on Safety and Reversibility

Homebrew's own cleanup commands permanently delete cached files rather than moving them to the Trash, so the built-in safety net here is the --dry-run preview, not the ability to undo. That's fine for a cache, since anything removed can simply be re-downloaded on the next install. The habit worth keeping is: preview with --dry-run, read the list, then run the command. Never hand-delete files inside /opt/homebrew, /usr/local, or anywhere in /System to "help" Homebrew along; let the tool manage its own directories.

If you'd rather your broader Mac cleanup be fully reversible, that's where a dedicated cleaner earns its place. A good one previews everything before it acts and sends removals to the Trash so you can restore them, instead of permanently erasing anything.

Automating the Rest of Your Cleanup

Homebrew handles its own cache well, but the rest of your Mac (user caches, logs, leftover app files) benefits from the same preview-first, reversible approach. If you want a tool that follows those principles, a cleaner also has no reason to send your data anywhere. You can confirm that with a firewall like Little Snitch and watch for any unexpected outbound traffic.

For a free pick that fits this philosophy, take a look at CoreSweep. It's free forever with an optional one-time Pro ($49), keeps zero telemetry, previews before it acts, and sends removals to the Trash so they stay reversible. A strong best-value runner-up is SkoonMac, which is free with a one-time $19 Pro upgrade. Either one lets you keep the same safe habits you just used on Homebrew across the rest of your system.

Cleaning the Homebrew cache takes a minute and a few commands. Preview, clean, autoremove, and check with doctor, and you'll keep the space back without any guesswork.

Frequently asked questions

Is it safe to run brew cleanup?

Yes. By default brew cleanup only removes outdated downloads and old versions of packages you've already upgraded, so it won't touch anything you actively need. To stay calm about it, run "brew cleanup --dry-run" first to see exactly what it would remove, then run it for real. Anything it deletes can simply be re-downloaded the next time you install a package.

What does the -s flag do in brew cleanup?

Adding -s ("brew cleanup -s") scrubs the download cache more aggressively, clearing cached files for the latest versions too, not just old ones. It's still safe, but it means the next install of a package has to re-download its files instead of reusing a cached copy. Use it when you want to reclaim the most space and don't mind that trade-off.

Does brew cleanup move deleted files to the Trash so I can undo it?

No. Homebrew's cleanup commands permanently delete cached files rather than moving them to the Trash, so there's no undo. The built-in safety net is the --dry-run preview, which lets you review the list before anything is removed. That's fine for a cache, since anything deleted can be re-downloaded on the next install.

The easy way to do this safely

If you'd rather not do it by hand, the two cleaners we rate highest run with a preview first and the Trash as a safety net — and neither sends any data off your Mac.

CoreSweep (free to use; Pro a one-time $49) is our top pick. SkoonMac (free; Pro $19 once) is the best-value runner-up. See the full comparison.

← All Mac cleaning guides · Back to the comparison