At some point, every dev hits it.
You’re installing something routine—npm install, a Go build, whatever—and macOS throws it in your face:
Disk Full.
You check storage, expecting the usual suspects. Not your videos. Not even Docker (okay, maybe a little).
It’s Homebrew quietly eating your SSD in the background.
Left unchecked, Homebrew turns into a museum of bad decisions:
- tools you needed once, 14 months ago
- duplicate runtimes “just in case”
- dependencies of dependencies of dependencies
Let’s fix it—without nuking your setup.
Phase 1: Basic Hygiene
Start simple.
Most of the mess comes from neglect, not complexity.
Do This More Than Once a Year:
brew update && brew upgrade
Now the important one:
brew autoremove
This cleans up dependencies that are no longer needed. Think: uninstalling an app but leaving behind all its junk—this gets rid of the junk.
Then:
brew cleanup
By default, Homebrew keeps old versions around for 120 days. That’s generous to a fault. If you’re low on space:
brew cleanup --prune=all
That’s the “stop hoarding” flag.
Phase 2: Kill the Cache
Homebrew caches everything it downloads. Useful in theory. Useless in practice.
Check how bad it is:
du -sh $(brew --cache)
If you see gigabytes, don’t overthink it:
rm -rf "$(brew --cache)"
Nothing breaks. Worst case, Homebrew downloads stuff again later. Best case, you just freed multiple GB instantly.
Phase 3: Audit What You Actually Installed
Now for the uncomfortable part.
brew leaves
This shows only the packages you explicitly installed—not the dependency noise.
Scroll through it slowly. You’ll find:
- tools you forgot existed
- experiments you never cleaned up
- “productivity boosters” you never opened twice
If you don’t recognize it, remove it:
brew uninstall <package>
Be honest here. This is where most of the real cleanup happens.
Phase 4: Let Homebrew Diagnose You
When things feel off—broken builds, weird paths, random failures:
brew doctor
It’s surprisingly blunt. It will call out:
- permission issues
- broken symlinks
- outdated or conflicting installs
Fix what it tells you. It’s usually right.
The “Controlled Burn” Reset (When Things Are Truly Messy)
If your setup feels fragile or inconsistent, don’t keep patching it. Reset it cleanly.
First, snapshot what you actually want:
brew bundle dump --force
This creates a Brewfile—your source of truth.
Then clean everything not in that file:
brew bundle clean --force
This is the closest thing to a fresh start without losing your essentials.
One Command to Rule Them All
If you want to stay out of trouble, automate the basics:
alias brew-burn='brew update && brew upgrade && brew autoremove && brew cleanup && brew doctor'
Run it every couple of weeks. Takes a minute, saves hours later.
The Reality
You’re not running out of disk because macOS is inefficient.
You’re running out because:
- you install fast
- you delete slow
- and Homebrew never forgets
Clean it up once, and you’ll usually get back several gigabytes.
Ignore it, and you’ll be back here in three months wondering why your laptop feels like 2015 again.
Your call.
Discover more from Ido Green
Subscribe to get the latest posts sent to your email.