Blog / Sep 21, 2026 · 3 min read

Homebrew Cache Is Bigger Than You Think — brew cleanup, the Hidden GB

homebrewbrewdevelopercachescleanup

Homebrew is the friendliest package manager on macOS — and one of the quietest disk hogs. Every brew install and brew upgrade downloads a bottle (the prebuilt formula), and Homebrew keeps every one of them forever, plus old versions of every formula you no longer need.

Most devs never look. A year of Homebrew usage routinely sits at 5–15 GB of pure caching. Here’s how to measure it, clear it, and stop it from re-growing.

How big is the damage?

du -sh ~/Library/Caches/Homebrew/*

The two heavy hitters:

  • ~/Library/Caches/Homebrew/downloads — every bottle you’ve ever downloaded
  • ~/Library/Caches/Homebrew/api — formula metadata (less, but nonzero)
  • $(brew --prefix)/Cellar — installed versions of formula (old ones pile up here too)

The trick: /Cellar is your installed software, but Homebrew keeps old versions of formula you’ve upgraded installed in place. Unless you’re using an old library that pins a version, the old ones are dead weight.

The one-liner that reclaims it all: brew cleanup

Homebrew has a built-in that’s underrated:

brew cleanup
  • Removes old versions of formula in Cellar (keeping only the current one)
  • Removes old downloads from ~/Library/Caches/Homebrew/downloads
  • Removes old log files

Add --prune=all to also wipe the download cache entirely:

brew cleanup --prune=all

Safe to delete? Yes. Homebrew only removes stuff it considers safe — old versions and cached downloads. Your installed software stays put. This is the gentle built-in, not a nuclear option.

What’s the nuclear option?

brew cleanup -s

-s scrubs everything cached, including older bottles that brew cleanup (without -s) would keep as upgrade candidates. Only run it if you’re happy to lose download cache — which you are, because Homebrew re-downloads on the next upgrade.

The full sweep (all of it, carefully)

If you want to reclaim everything safely in one pass:

# 1. built-in cleanup (safe, removes stale versions)
brew cleanup --prune=all

# 2. caches Homebrew owns (safe - re-downloaded)
rm -rf ~/Library/Caches/Homebrew/downloads

# 3. old tap caches (re-fetches on next brew update)
rm -rf $(brew --prefix)/var/cache/homebrew 2>/dev/null
rm -rf ~/Library/Caches/Homebrew/api

# 4. casks' downloaded installers (app stores cache, safe)
rm -rf ~/Library/Caches/Homebrew/Cask

Everything in that list is re-downloadable. Your formulas, your data, your config — untouched.

Measure first, because “safe” depends on your disk

brew cleanup cautiously only removes what it decides is stale. If you want to know exactly where the GB are before touching anything, scan with a tool that maps your disk by bytes — the ~/Library/Caches/Homebrew folder and $(brew --prefix)/Cellar show up instantly as giant blocks, along with node_modules, Docker.raw, and the rest of the dev-bloat family in one treemap.

DiskInsight gives you that map: every folder ranked by size, hidden folders included, everything staged to the Trash for review, and nothing ever auto-deleted. 100% local, no telemetry, one-time price.

Homebrew isn’t the only package cache

The same pattern applies to all your toolchains:

  • npm: npm cache clean --force (see node_modules guide)
  • pnpm: pnpm store prune
  • CocoaPods: pod cache clean --all
  • Cargo: cargo cache clean or remove ~/.cargo/registry
  • SwiftPM: .build directories and DerivedData (see DerivedData guide)

All re-downloadable, all re-growing. The discipline is the same: caches are rebuildable, your source is not.

Bottom line

Homebrew’s cache is one of the easiest multi-GB wins on a dev Mac because the cleanup tool is built in:

  1. brew cleanup --prune=all — safe, removes stale versions + old downloads.
  2. Optionally rm -rf ~/Library/Caches/Homebrew/downloads for the full reclaim.
  3. Confirm the damage is gone with du -sh.

Do it now, then go build something.

Get DiskInsight Pro · $9.99 one-time to see every cache on your Mac by byte size. Full step-by-step in our Mac disk cleanup guide.