
Homebrew cleanup frees disk space in two ways: it removes old versions of the packages you've upgraded, and it removes old downloads from its cache. Homebrew already does both by itself, after every upgrade and in a fuller cleanup every 30 days, so on most Macs its leftovers stay modest.
What it never removes is software you installed and stopped using. That takes uninstalling, package by package, with Homebrew. The packages it installed only because something else needed them are the exception: its cleanup removes those once nothing needs them any more.
Homebrew is a command-line tool with no app of its own, so its cleanup, uninstalls and settings are all commands. Two of its folders are plain folders you can clear in Finder instead: the download cache and the logs. The installed software, in / and /, is Homebrew's to remove.
This post goes through each place Homebrew uses space, what its cleanup removes and what it keeps, why old versions sometimes stay, and the casks and leftovers that can outweigh everything else.
Where Homebrew keeps its files on a Mac
Homebrew lives in its own folder, called its prefix: / on a Mac with Apple silicon, and / on an Intel Mac. Its download cache and logs are in your own Library folder.
| What | Where it is | What it holds | Level |
|---|---|---|---|
| Download cache | ~/Library/Caches/Homebrew | Bottles, app installers and package lists Homebrew downloaded | Safe |
| Logs | ~/Library/Logs/Homebrew | Output of package builds and installs | Safe |
| Cellar | /opt/homebrew/Cellar | Installed command-line tools and libraries, one folder per version | Review first |
| Caskroom | /opt/homebrew/Caskroom | Records of installed apps, and files some casks keep there | Review first |
| Homebrew itself | /opt/homebrew/Library | Homebrew's own code and any extra taps | Leave alone |
A formula is Homebrew's word for a command-line tool or library, and a bottle is a ready-built formula it downloads. A cask is an app or other ready-made download, usually installed into your Applications folder.
How do you open Homebrew's folders in Finder?
The prefix is inside /, a folder Finder doesn't show, and your Library folder is hidden too. You can still open them.
- In Finder, choose Go › Go to Folder.
- Type
/, oropt/ homebrew ~/for the cache. The tilde stands for your home folder.Library/ Caches/ Homebrew - Press Return.
Select a folder and choose File › Get Info to see its size. For the Cellar, choose View › as List, then View › Show View Options, and select Calculate all sizes to see each formula's size in the Size column.
Where does Homebrew show up in Storage settings?
Mostly in System Data. Storage settings, in System Settings › General › Storage, has no category for Homebrew, so its cache, logs and installed tools fall into System Data with everything else it can't name. The System Data guide explains what else ends up there.
Apps you installed with a cask are different. They're in your Applications folder, so Storage settings counts them under Applications, like any other app.
How much space does Homebrew use?
It depends mostly on what you've installed. The research behind the app's catalog puts Homebrew's cache and old versions together at 2 to 15 GB on a typical Mac that uses it. The installed software comes on top, and a single cask can outweigh all of it.
- Android SDK installed by one cask8.2 GB · Usually safe
- Cellar: 136 formulae2.1 GB · Review first
- Old formula versions in the Cellar0.2 GB · Review first
- Download cache0.1 GB · Safe
- Caskroom records0 GB · Review first
Measured on one Mac in October 2026, nine days after Homebrew's automatic cleanup last ran. The old versions are part of the Cellar's total. Apps installed by casks are in the Applications folder and not included.
On that Mac, the cache was small because Homebrew's own cleanup had run recently. The largest single item wasn't a formula at all, but a cask that installs Android's command-line tools and keeps the SDK packages they download inside Homebrew's folder.
What else is in /opt/homebrew?
Besides the Cellar and the Caskroom, the prefix has folders such as bin, lib and share. Most of what's in them is links into the Cellar, which is how a formula's commands become available to you, so they take almost no space of their own.
The exceptions are files tools write there themselves. On the Mac measured above, share held 8.2 GB, almost all of it the Android SDK described below, while var and etc, where formulae keep data and settings, held about 10 MB together.

Homebrew's download cache
Before it installs or upgrades anything, Homebrew downloads it into ~/. Its documentation names that as the download folder on a Mac, and it keeps the files after installing them.
What's in the Homebrew cache?
Three kinds of thing. Bottles, the ready-built packages for formulae. Installers for casks, which can be large because they're whole apps. And the package lists Homebrew downloads to know what's available, plus a few files that help it start faster.
Each download is named after the package and its version, so you can tell what's there by looking. Removing one doesn't uninstall anything: the software is in the Cellar or the Applications folder, not here.
Is it safe to delete the Homebrew cache?
Yes. Homebrew downloads anything it needs again, and its package lists come back the next time it runs. The only cost is that reinstalling or upgrading something downloads it again.
- Make sure Homebrew isn't installing or upgrading anything.
- In Finder, choose Go › Go to Folder, type
~/and press Return.Library/ Caches - Move the Homebrew folder to the Trash.
- Empty the Trash when you're sure you don't need it back.
Move only the Homebrew folder, never the Caches folder itself, which every app on your Mac uses.
What does Homebrew's cleanup remove from the cache?
Homebrew's cleanup removes outdated downloads, the ones for versions you no longer have, and every download more than 120 days old. Recent downloads of the versions you have installed stay, so a reinstall can use them.
Its cleanup command has options that go further, according to Homebrew's manual:
| Option | What it removes from the cache |
|---|---|
| None | Outdated downloads and anything older than 120 days |
| Prune, with a number of days | Every cache file older than that many days |
| Prune, set to all | Everything in the cache |
| Scrub | Downloads of even the latest versions, except those of installed packages |
| Dry run | Nothing: it only lists what would go |
The 120 days can be changed with a Homebrew setting, and the manual notes that deleting the cache folder itself is the way to remove downloads of installed packages too. That's the same as moving it to the Trash in Finder, except that the Trash lets you change your mind.
Why does the cache come back so quickly?
Part of it is Homebrew's package lists, which it refreshes when it updates itself, by default at most once every 24 hours since Homebrew 4.0. On the Mac measured above, those lists and the files that help Homebrew start faster were about two thirds of the cache.
The rest comes back with each install and upgrade. That's expected: the cache is where Homebrew puts things before installing them.
Can the cache live somewhere else?
Yes. A Homebrew setting in your shell's configuration can point the download cache at another folder, and Homebrew's manual lists it with the other settings. If ~/ is small but Homebrew downloads a lot, that setting may be why.
Why would the cache be large?
Usually for one of two reasons. Casks are whole apps, so the installers for a few large ones, such as an IDE or a design tool, can add up to gigabytes on their own.
The other is that automatic cleanup is turned off. Some people turn it off to keep old versions, and then the cache only grows. The next section explains how to tell.
How Homebrew cleanup frees disk space
Homebrew's cleanup is the one tool that deals with all of its own leftovers at once. Knowing when it runs, and what it skips, explains most of the space Homebrew keeps.
When does Homebrew clean up by itself?
At two moments. When you upgrade a formula, Homebrew removes its old version straight away. And every 30 days, when you install, upgrade or reinstall something, it runs a full cleanup of everything.
Homebrew's documentation lists the settings that change this. One turns automatic cleanup off entirely, another excludes particular formulae, and a third sets the number of days between full cleanups. If old versions pile up on your Mac, one of these may be set in your shell's configuration.
What if you rarely use Homebrew?
Then it rarely cleans up. The 30-day cleanup only runs as part of an install, upgrade or reinstall, so a Homebrew you haven't touched in a year still has whatever its cache and Cellar held a year ago.
That's usually harmless, because nothing new arrives either. It does mean the cache of an old, unused installation is worth a look, and it won't shrink until you either use Homebrew again or clear it in Finder.
What does a full cleanup remove?
A full cleanup does more than remove old versions. Homebrew's own code lists each step:
- Old versions of installed formulae, where it's safe to remove them.
- Outdated downloads, and downloads older than 120 days, from the cache.
- Formulae that were installed only as dependencies and that nothing needs any more. Homebrew now does this by default, unless a setting turns it off.
- Logs of builds and installs older than 30 days.
- Stale lock files and other temporary files Homebrew left behind.
What it never does is uninstall a formula you asked for, or an app you installed with a cask. Those stay until you uninstall them.
Why does Homebrew keep some old versions?
Homebrew's code skips an old version in four cases:
- The newest version isn't installed yet. If a formula is outdated, Homebrew leaves all its versions alone until you upgrade it.
- The old version is linked, meaning it's the one your commands actually run.
- The formula is pinned, which is how you tell Homebrew not to upgrade it.
- Something has marked that version as still needed. Homebrew names what needs it.
On the Mac measured above, 11 formulae still had an older version, about 200 MB together, some of them from seven months earlier, although a full cleanup had run nine days before. When you run Homebrew's cleanup yourself, it says why it skips each one.
Cleanup, autoremove and uninstall: what's the difference?
Homebrew has several commands that free space, and each removes something different. None of them has an app or a button.
| Homebrew's command | What it removes | What it never removes |
|---|---|---|
| Cleanup | Old versions, old downloads, old logs, unneeded dependencies | Anything you installed on purpose |
| Autoremove | Formulae installed only as dependencies that nothing needs now | Formulae you asked for |
| Uninstall | One formula or cask, and dependencies nothing else needs | Data kept outside the Cellar, and apps' files in your Library folder |
| Uninstall with zap | A cask's app and the files its maintainers list for it | Files nobody listed |
| Untap | A tap's Git repository | Installed formulae and casks |
What these commands remove doesn't go to the Trash: it's deleted straight away. Moving the cache or logs to the Trash in Finder is the one route here that you can undo.
Should you turn automatic cleanup off?
Only if you need old versions to stay, for example to switch back after an upgrade breaks something. Homebrew's FAQ explains the catch: with automatic cleanup off, uninstalling a formula removes only its latest version, and older ones stay until you remove them.
If you've turned it off in the past and forgotten, that may be where Homebrew's extra gigabytes come from.

Installed formulae: what you can remove
The Cellar holds every formula you've installed, each in its own folder, with a subfolder for each version. It's often the largest Homebrew folder, but it's software you're using, not leftovers.
Can you delete the Cellar folder?
No. Everything in it is installed software, and Homebrew links each formula from the Cellar into place so you can use it. Removing folders in Finder leaves Homebrew's links pointing at nothing, and the tools that need them stop working.
Uninstalling a formula with Homebrew removes its folder and its links together. That's the only supported way to remove one, and Homebrew has no app or button for it.
Which formulae are you not using?
Homebrew can list its "leaves": formulae that no other installed formula or cask depends on. Those are the ones you installed yourself, plus any it installed as dependencies that are now on their own. They're the list to go through.
To see the largest ones, open / in Finder with Calculate all sizes turned on, and click the Size column heading. On the Mac measured above, the largest were a Java runtime at about 300 MB, Ruby, Deno and Ghostscript.
Why do several Pythons or Javas stay installed?
Homebrew names some formulae with a version, such as python@3.14, openjdk@17 or openssl@3. Each of those is a separate formula, not a version of one, so cleanup never treats an older one as an old version to remove.
If you installed python@3.13 once and later python@3.14, both stay until you uninstall the one you don't need, or until autoremove finds that one was only a dependency nothing uses. On the Mac measured above, five formulae had a version in their name. The post on uninstalling Python on a Mac covers Homebrew's Pythons.
What happens to dependencies when you uninstall?
Many formulae need others to work, and Homebrew installs those for them. When you uninstall a formula, Homebrew removes the dependencies nothing else needs as part of the same step, unless a setting turns that off.
Homebrew also refuses to uninstall a formula that something else depends on, unless you tell it to go ahead. That's what keeps an uninstall from breaking another tool.
What about the data a formula keeps?
Some formulae keep data of their own, such as a database server's databases. Homebrew's guidelines put files that should survive upgrades outside the Cellar, in folders such as / and /.
Those folders aren't part of a formula's Cellar folder, so uninstalling the formula leaves them where they are. That protects your data, but it also means a database you no longer use keeps its space until you remove its data yourself, after checking you don't need it.
What does a formula cost to reinstall?
Usually just a download. Bottles are ready-built, so reinstalling a formula is like reinstalling an app. Formulae that have no bottle for your Mac are built from source, which can take much longer and needs Apple's Command Line Tools.
| Folder | Can you remove it in Finder? | What to do instead |
|---|---|---|
~/Library/Caches/Homebrew | Yes | Or let Homebrew's cleanup trim it |
~/Library/Logs/Homebrew | Yes | Or let Homebrew's cleanup trim it |
/opt/homebrew/Cellar and its folders | No | Uninstall formulae with Homebrew |
/opt/homebrew/Caskroom and its folders | No | Uninstall casks with Homebrew |
/opt/homebrew/Library | No | Leave it: it's Homebrew itself |
/opt/homebrew as a whole | No | Use Homebrew's uninstall script |
Casks: apps, and what they leave behind
A cask installs an app or another ready-made download. The app goes into your Applications folder; Homebrew keeps a record of it in the Caskroom so it can upgrade and uninstall it later.
Why not just drag a Homebrew app to the Trash?
Because Homebrew doesn't know you did. Its record stays in the Caskroom, and it still lists the app as installed. Uninstalling the cask with Homebrew removes the app and its record together.
If you've already moved such an app to the Trash, uninstall the cask with Homebrew as well, so its record goes too. For what any app leaves in your Library folder, see the guide to uninstalling apps properly.
Where do cask installers go after installing?
A cask's download, such as a disk image or an installer package, stays in Homebrew's download cache after the app is installed. Cleanup removes it once a newer version replaces it, or when it's more than 120 days old.
So a Mac that installs several large apps with casks in one week can see the cache jump by gigabytes, then shrink again over the following months.
What does uninstalling a cask leave behind?
Much of what dragging an app to the Trash leaves: its preferences, caches and data in your Library folder stay, though some casks also remove helpers and background items they installed. Homebrew's uninstall has a zap option for a more complete removal, using a list the cask's maintainers keep of the files the app creates.
Homebrew's documentation adds two warnings. Zap is never done by default, only when you ask. And because its list can include shared resources such as an app updater, zapping one app can affect others that use them.
Casks that keep files outside the Applications folder
Not every cask is an app. Some install command-line tools or SDKs, and those keep their files inside Homebrew's folders rather than in Applications. The Caskroom's own size doesn't show what they download later.
On the Mac measured above, a cask for Android's command-line tools kept the SDK packages they downloaded in /: 8.2 GB, nearly four times the whole Cellar.
That folder is the Android SDK, managed with Android's own tools. In Android Studio, choose Tools › SDK Manager, clear the packages you no longer need, and click Apply.

Logs, taps and other leftovers
A few smaller things round out Homebrew's footprint. None is usually large, but each has its own rule.
Is it safe to delete Homebrew's logs?
Yes. Homebrew saves the output of each build and install in ~/, one folder per formula, so a failed install can be investigated. Installed software doesn't need them, and Homebrew's full cleanup removes logs older than 30 days by itself.
To clear them sooner, choose Go › Go to Folder, type ~/, and move the Homebrew folder to the Trash. The only cost is that you can't look back at an old install's output.
What are taps, and do old ones take space?
A tap is a collection of formulae and casks beyond Homebrew's main ones, kept as a Git repository in /. Most are small.
The exceptions are Homebrew's own main taps on older installations. Since Homebrew 4.0, in February 2023, Homebrew downloads its package lists from its online service instead of reading them from those large Git repositories.
Its release notes say that, unless you develop formulae or casks, you can remove those two taps to save space. Homebrew removes a tap with its own untap command, which has no button either.
Homebrew's own Ruby and other internals
Homebrew runs on its own copy of Ruby and keeps its code in /. Leave that folder alone: it's Homebrew itself. Its cleanup removes old copies of its own Ruby when you run it by hand, though not during the automatic cleanup.
Homebrew on an Intel Mac, or a second one under Rosetta
On an Intel Mac, Homebrew's prefix is /, and everything in this post applies with that path instead. On a Mac with Apple silicon, / can hold a second Homebrew.
Can a Mac have two Homebrews?
Yes. Homebrew chose / for Apple silicon partly so that it could live alongside an Intel installation in /, run through Rosetta 2. A Mac that once ran Homebrew under Rosetta 2 can carry both, each with its own Cellar and Caskroom.
Homebrew now treats Intel macOS as legacy, with its lowest level of support. If / exists on an Apple silicon Mac, check whether you still use anything from it.
How do you tell if the second one is still used?
Open / with Go › Go to Folder and switch to List view with the Date Modified column. If nothing there has changed in years, and your tools all come from /, the older installation is likely unused.
Remove it with Homebrew's uninstall script, which Homebrew's FAQ points to, rather than in Finder. That way its links and files go together.
Don't move /usr/local itself
/ isn't only Homebrew's. Other installers put files there too, such as the Node.js installer from nodejs.org, which puts node and npm in its bin folder. Moving the whole folder breaks those tools as well.
Where to start: a worked example
On most Macs, Homebrew's cleanup has already done the easy part. What's left is a few decisions, and the order matters less than knowing what each step frees.
What each step would free on the Mac measured above
| Step | Space it frees | Can you undo it? |
|---|---|---|
| Move the download cache to the Trash in Finder | About 70 MB | Yes, until you empty the Trash |
| Move the logs to the Trash in Finder | Nothing: the folder was empty | Yes |
| Upgrade outdated formulae, then let cleanup run | Up to about 200 MB of old versions | No |
| Uninstall formulae no longer used | Depends on which; the largest was about 300 MB | Reinstall to get it back |
| Remove Android SDK packages no longer used | Up to 8.2 GB | Download them again |
The cache and old versions were small because automatic cleanup was on. The real space was in what had been installed, and the largest part of it wasn't a formula at all.
What that means for your Mac
If Homebrew's cache is several gigabytes, automatic cleanup is probably off or hasn't run for a while, and clearing the cache is the quick win. If it's small, look at the Cellar's largest formulae and at casks that download SDKs, because that's where the space is.
Mistakes to avoid
Homebrew's folders look like ordinary folders in Finder, which makes it tempting to tidy them by hand. Most problems come from that.
Don't remove versions from the Cellar in Finder
A folder for an old version can look safe to remove, and sometimes it is. But it may be the linked version, a pinned one, or one another formula needs, which are exactly the cases Homebrew's cleanup checks for. Let Homebrew decide.
Don't run Homebrew as an administrator
Homebrew installs and builds packages as your own account, so that build scripts don't get unrestricted access to your Mac, and its FAQ explains why it warns against administrator rights. Some casks ask for your password to install, which is expected. Clearing the cache and logs in Finder doesn't need it.
Don't delete the whole prefix to uninstall Homebrew
Moving / to the Trash removes every tool you installed and leaves Homebrew's cache and logs behind. Homebrew's FAQ points to its own uninstall script for removing Homebrew entirely, and that's the way to do it.
Don't paste cleanup commands from a web page
Homebrew's own cleanup is a command, but a command copied from a web page can do much more than it says. Everything you can do in Finder here, clearing the cache and logs, needs no Terminal at all, and Homebrew already runs its cleanup every 30 days when you install or upgrade.
Keep Homebrew's footprint small
Homebrew's leftovers come back with every install and upgrade, and its cleanup takes them away again. The space that stays is what you've installed.
A routine that works
- Leave automatic cleanup on, unless you have a reason to keep old versions.
- Upgrade now and then, so outdated formulae don't hold on to their old versions.
- Every few months, look at Homebrew's leaves and uninstall tools you no longer use.
- Check for casks that download SDKs or other large files, and manage those with their own tools.
- Clear the cache in Finder when you need room quickly.
Make reinstalling cheap
Homebrew's bundle command can record everything you've installed in a file called a Brewfile, and install it all again from that file. With a Brewfile kept somewhere safe, removing tools you rarely use costs little, because getting them back is one step.
Other developer tools keep download caches of their own, often larger than Homebrew's. The post on npm, Yarn, pnpm and Bun caches covers the JavaScript ones.
How often should you look?
Every few months is enough for most people, or when System Data grows for no clear reason. Homebrew's own cleanup handles the leftovers in between, as long as it's turned on and you install or upgrade now and then.
What about Time Machine?
Homebrew's download cache is in your Library's Caches folder, and the installed software can be downloaded again. If your backup disk is short of space, the cache is a reasonable thing to leave out, in System Settings › General › Time Machine under Options.
How the app does it
Wombit finds Homebrew's folders, explains each one, and shows its size, with hard links and APFS clones counted once. Select one on the map to see what it is and what removing it costs.
The download cache and the logs are Safe: they start checked in Cleanup, and go to the Trash, where Put Back returns them. The Cellar and the Caskroom are Review first, and the app doesn't remove them: they're installed software, so it explains how to uninstall what you don't need with Homebrew instead.
~/
Library/ Caches/ Homebrew Packages, app installers and package lists that Homebrew downloads before it installs or upgrades software.
Safe · Moves it to the Trash
~/
Library/ Logs/ Homebrew Logs that Homebrew writes when it builds and installs packages, in one folder for each package.
Safe · Moves it to the Trash
/
opt/ homebrew/ Cellar Command-line tools and libraries installed with Homebrew, in one folder for each package and version.
Review first · Explained only: never removed
/
opt/ homebrew/ Caskroom Records of the apps and other casks installed with Homebrew, and the files that some casks keep here.
Review first · Explained only: never removed
Seeing Homebrew's folders and what's in them is free. Moving the cache and logs to the Trash in Cleanup is PRO: one payment of $4.99 with lifetime access. Every Pro tool's review is free to open, so you see what would go and why before you buy.
Frequently asked questions
Can I delete ~/Library/Caches/Homebrew?
Yes. It holds downloads and package lists, not installed software, and Homebrew downloads anything it needs again. Quit any running installs, then move the Homebrew folder to the Trash in Finder, never the Caches folder itself.
Where does Homebrew store downloads on a Mac?
In ~/Library/Caches/Homebrew, unless a Homebrew setting moves it. Installed formulae are in /opt/homebrew/Cellar on Apple silicon or /usr/local/Cellar on Intel Macs, and apps from casks go to the Applications folder.
Does brew cleanup uninstall anything?
It never uninstalls a formula you asked for or an app you installed with a cask. It removes old versions of formulae, old downloads and logs, and, by default, formulae that were installed only as dependencies and that nothing needs any more.
How often does Homebrew clean up automatically?
It removes a formula's old version as soon as you upgrade it. Every 30 days, the next install, upgrade or reinstall also runs a full cleanup of everything. Both can be turned off or changed with Homebrew's settings.
Why is Homebrew keeping old versions of a formula?
Homebrew leaves every version of a formula alone while a newer version than the one installed is available, and keeps a version that's linked, pinned or marked as needed. With automatic cleanup turned off, it keeps everything until you clean up yourself.
Can I delete /opt/homebrew/Cellar to free space?
No. It holds the software you installed, and Homebrew links it into place so you can use it. Removing folders there in Finder breaks those tools; uninstall the formulae you don't need with Homebrew instead.
How do I see how much space Homebrew uses?
In Finder, choose Go › Go to Folder, type /opt/homebrew and press Return, then select a folder and choose File › Get Info. Check ~/Library/Caches/Homebrew the same way. Apps installed with casks are counted in your Applications folder instead.
What does uninstalling a cask with zap remove?
Besides the app, it removes files the cask's maintainers list as belonging to it, such as its preferences and caches in your Library folder. Homebrew never does this by default, and warns that shared resources, such as an app updater, can be removed too.
Sources
- Go directly to a specific folder on Mac · Apple
- FAQ (Frequently Asked Questions) · Homebrew
- brew(1): the manual · Homebrew
- Cask Cookbook: the zap stanza · Homebrew
- Homebrew 4.0.0 · Homebrew
- cleanup.rb · Homebrew