Package managers & build caches

Where Does Homebrew Store Downloads? Find & Clear the Homebrew Cache (2026)

If you have been using Homebrew to manage packages on your Mac, you have probably noticed your available disk space shrinking over time without an obvious explanation. Understanding the homebrew cache location — and knowing how to clean it up safely — can reclaim several gigabytes without touching a single formula you actually use. This guide covers where Homebrew stores its downloads, what all those files are, and how to clear the cache on both Apple Silicon and Intel Macs running macOS Sequoia or Tahoe in 2026.

Where Does Homebrew Store Its Cache?

Homebrew separates its installation prefix (where your tools live) from its download cache (where source tarballs and bottles are kept while installing or upgrading). The download cache is what consumes disk space quietly in the background.

On macOS, the cache lives inside the standard user cache directory:

  • Apple Silicon (M1/M2/M3/M4 Macs): ~/Library/Caches/Homebrew
  • Intel Macs: ~/Library/Caches/Homebrew

Both architectures use the same user-level path. The difference between Apple Silicon and Intel is where Homebrew itself is installed (/opt/homebrew vs. /usr/local), not where it caches downloads.

You can always confirm the exact path Homebrew is using by running:

brew --cache

This prints the active cache directory, which is occasionally redirected via the HOMEBREW_CACHE environment variable if you or a script has overridden it.

What Is Inside the Homebrew Cache?

Open the cache folder in Finder with:

open ~/Library/Caches/Homebrew

You will find several types of files:

  • Bottles (*.bottle.tar.gz): Pre-built binary packages. These are the most common and often the largest items.
  • Source tarballs (*.tar.gz, *.tar.bz2, *.tar.xz): Downloaded when a bottle is not available and Homebrew must compile from source.
  • Casks (Cask/ subdirectory): Downloaded .dmg, .pkg, and .zip files for GUI applications installed via brew install --cask.
  • API cache (api/ subdirectory): JSON files that represent the Homebrew formula and cask registry so brew update is faster. These are small and regenerate automatically.

After an upgrade, the old version's bottle stays in the cache unless you explicitly remove it. Install a dozen packages over a year and update them a few times, and the cache can easily reach 5–15 GB.

How Much Space Is the Homebrew Cache Using?

Check the size quickly from Terminal:

du -sh ~/Library/Caches/Homebrew

For a folder-by-folder breakdown:

du -sh ~/Library/Caches/Homebrew/*
Subfolder Contents Typical Size Range Safe to Delete?
~/Library/Caches/Homebrew/*.bottle.tar.gz Binary bottles for installed formulae 500 MB – 8 GB Yes — re-downloaded if needed
~/Library/Caches/Homebrew/Cask/ GUI app installers (.dmg, .pkg, .zip) 200 MB – 5 GB Yes — re-downloaded on reinstall
~/Library/Caches/Homebrew/downloads/ Partially downloaded or staged files 0 – 2 GB Yes — stale after successful install
~/Library/Caches/Homebrew/api/ Formula/cask registry JSON 5 – 30 MB Yes — rebuilt on next brew update

How to Clear the Homebrew Cache (Step-by-Step)

Homebrew provides a built-in command for cache cleanup. Follow these steps to do it safely:

  1. Run a dry run first. See what will be removed without deleting anything:
    brew cleanup --dry-run
    This lists every file Homebrew considers stale — primarily old versions of bottles and casks that are no longer installed.
  2. Run the actual cleanup. Remove all stale downloads:
    brew cleanup
    By default, this deletes cached files for versions that are no longer installed and any files older than 120 days.
  3. Remove everything in the cache (nuclear option). If you want to start completely fresh:
    brew cleanup --prune=all
    This removes every cached file regardless of age, including downloads for currently installed versions. Your installed tools keep working — only the cached installers are gone.
  4. Verify the result. Confirm the folder is now smaller:
    du -sh ~/Library/Caches/Homebrew

None of these commands remove installed packages. The cache is purely a download staging area — deleting it does not uninstall anything.

Automating Cache Cleanup

Homebrew does not automatically prune its cache on a schedule, but you can add cleanup to your workflow in a few ways:

  • After every upgrade: Run brew upgrade && brew cleanup as a single command so stale bottles are removed immediately after updating.
  • Via a launchd plist or cron job: Schedule brew cleanup --prune=30 monthly to remove anything older than 30 days.
  • Set an environment variable: Adding export HOMEBREW_CLEANUP_MAX_AGE_DAYS=30 to your shell profile tells Homebrew to treat files older than 30 days as stale during every cleanup run.

Other Package Manager Caches Worth Checking

Homebrew is often the biggest culprit, but it is rarely the only one. If you are already auditing developer caches, these locations are worth a look as well — and if you want to understand how to clean up Node.js and npm caches on Mac, that guide covers the full npm and Yarn picture.

Common Developer Cache Locations

  • npm: ~/.npm/_cacache — cleared with npm cache clean --force
  • Yarn (classic): ~/Library/Caches/Yarn — cleared with yarn cache clean
  • pip / pip3: ~/Library/Caches/pip — cleared with pip cache purge
  • Cargo (Rust): ~/.cargo/registry/cache and ~/.cargo/registry/src — safe to delete manually
  • Maven: ~/.m2/repository — remove unused artifacts manually or via mvn dependency:purge-local-repository
  • Gradle: ~/.gradle/caches — cleared with gradle cleanBuildCache or by deleting the folder
  • Xcode DerivedData: ~/Library/Developer/Xcode/DerivedData — often the single largest developer folder; see why Xcode uses so much space for a full breakdown

Across an active development machine these locations can collectively hold 20–50 GB of files that serve no purpose once the original build or install succeeded. A tool like Crumb can audit all of these at once and show what is safe to remove before you delete anything.

Is It Safe to Delete the Homebrew Cache?

Yes. The cache directory is a download staging area, not an installation directory. Every file in ~/Library/Caches/Homebrew can be deleted without removing or breaking any installed package. If you install or upgrade a formula after clearing the cache, Homebrew simply downloads the bottle again. The only cost is download time. For most people on modern connections, that is a worthwhile trade for the gigabytes reclaimed.

If you are on a metered or slow connection, use brew cleanup (which keeps current-version bottles) rather than brew cleanup --prune=all, so Homebrew does not need to re-download packages you just installed.

Checking Your Overall Disk Usage

Clearing the Homebrew cache is one slice of a larger disk-space picture. System Data, application caches, language caches, and old iOS backups can each run into double-digit gigabytes. If you want to understand what is really taking up space on your Mac, that guide covers every major storage category and how to prioritize what to remove first.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Where is the Homebrew cache on a Mac?
The Homebrew cache is stored at ~/Library/Caches/Homebrew on both Apple Silicon and Intel Macs. You can confirm the exact path by running 'brew --cache' in Terminal.
Is it safe to delete the Homebrew cache?
Yes, completely safe. The cache holds downloaded bottle files and installers — not installed packages. Deleting it does not uninstall anything; Homebrew will simply re-download what it needs the next time you install or upgrade a formula.
Will clearing the Homebrew cache remove my installed packages?
No. Installed packages live in /opt/homebrew (Apple Silicon) or /usr/local (Intel), not in the cache. The cache is only a staging area for downloads, so removing it has no effect on what is already installed and working.
How do I clear only old or stale Homebrew downloads without removing everything?
Run 'brew cleanup' — this removes cached files for formula versions that are no longer installed and anything older than 120 days, while keeping caches for currently installed versions. Use 'brew cleanup --dry-run' first to preview what will be removed.
How much space can I recover by clearing the Homebrew cache?
It varies widely depending on how many packages you have installed and how often you upgrade them. On an active development machine it is common to find 3–15 GB in the Homebrew cache alone, with older long-running machines sometimes holding even more.