Folder

Is the Homebrew cache (~/Library/Caches/Homebrew) safe to delete on a Mac?

Yes, the Homebrew cache is safe to delete: it holds only downloads, installed formulae and casks do not run from it, and brew cleanup is the supported way to empty it.

2 safe1 careful1 never

updated read 3 minfor Homebrew 4 and later on macOS

The short answer

  1. 01

    Safe to delete. ~/Library/Caches/Homebrew holds downloaded bottles, casks and source archives. Installed tools live elsewhere.

  2. 02

    brew install and brew upgrade write it, and Homebrew trims it on its own only every 30 days and only for old files.

  3. 03

    You lose nothing installed. A reinstall of the same version downloads it again.

  4. 04

    The command: brew cleanup -s --prune=all. Add -n first to see what would go.

See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial

What is the ~/Library/Caches/Homebrew folder?

It is Homebrew's download cache: bottles (prebuilt packages), cask installers and source archives that brew fetched. Homebrew's FAQ says brew --cache shows the cache, which is usually ~/Library/Caches/Homebrew.

brew --cache

Prints the active cache folder, which HOMEBREW_CACHE can change. Removes nothing.

The tools themselves are not here. Formulae are installed in the Cellar (/opt/homebrew/Cellar on Apple silicon, /usr/local/Cellar on Intel), and casks install their apps where each cask says.

What writes it and why does it grow?

brew install, brew upgrade and brew fetch write to it. Each new version downloads a new file next to the old ones.

  • Old downloads linger: per Homebrew's manual, plain brew cleanup removes downloads more than 120 days old (set by HOMEBREW_CLEANUP_MAX_AGE_DAYS), so recent ones stay.
  • Latest versions stay: without -s, downloads for the latest versions are kept.
  • Automatic cleanup is partial: Homebrew runs cleanup for the packages you just installed, and every 30 days for all packages, unless HOMEBREW_NO_INSTALL_CLEANUP is set.

How big does the Homebrew cache get?

It depends on what you install and how often you upgrade, so there is no normal size. Measure your own:

du -sh "$(brew --cache)"

Prints the cache size. Removes nothing.

brew cleanup -n -s --prune=all

-n (--dry-run) shows what a full cleanup would remove, without removing anything.

Is it safe to delete the Homebrew cache?

Yes: it is downloads only, and Homebrew fetches them again when it needs them.

WhatVerdictWhat you lose
~/Library/Caches/HomebrewSafeDownloaded files. Reinstalling the same version downloads again.
~/Library/Logs/HomebrewSafeBuild logs, useful only when reporting a failed build.
Old versions removed by brew cleanupCarefulYou can no longer switch back to an older installed version without reinstalling it.
/opt/homebrew/Cellar or CaskroomNeverEvery installed formula, or Homebrew's record of installed casks. Use brew uninstall.

How do I clear the Homebrew cache?

Use Homebrew's own command:

brew cleanup -s --prune=all

-s (--scrub) includes downloads for even the latest versions, and --prune=all removes cache files of any age. It also removes stale lock files and old versions of installed formulae. Homebrew's manual notes that downloads for installed formulae or casks are still not deleted.

The manual way: to empty the cache completely, quit any running brew command and drag the folder brew --cache printed to the Trash. Homebrew recreates it on the next download.

What Hoardless does: its Homebrew detector lists ~/Library/Caches/Homebrew at the Auto tier and runs brew cleanup -s --prune=all, using the brew your login shell finds. When brew is not installed, it moves the folder to the Trash at the same tier, logged in the undo log.

What comes back and when?

Only downloads for what you install or upgrade next. Each brew install or brew upgrade downloads its bottle into the cache again, and Homebrew's own periodic cleanup trims it over time.

Nothing you already installed needs the cache to run, so clearing it never breaks a working tool.

Homebrew beside every other developer cache

Hoardless sizes the Homebrew cache (Auto tier, brew cleanup -s --prune=all) next to Cargo, Go, Gradle, Maven and Node caches, and previews the plan before anything runs.

14-day full trial. macOS 14 or later.

Questions

Does brew cleanup uninstall anything?

It removes old versions of installed formulae and outdated downloads. Current versions of what you installed stay installed.

Why is the Homebrew cache still big after brew cleanup?

By default brew cleanup only removes downloads older than 120 days and keeps downloads for the latest versions. -s scrubs those too, and --prune=all ignores age.

How do I stop Homebrew from cleaning up after every install?

Set HOMEBREW_NO_INSTALL_CLEANUP. Homebrew's docs say cleanup runs after installs and every 30 days for all packages unless that variable is set.

Is it safe to delete /opt/homebrew/Cellar?

No. The Cellar holds every installed formula. Deleting it breaks the tools you installed; use brew uninstall instead.