First: find out who the offenders are
Run these and prepare to be annoyed:
du -sh ~/Library/Developer 2>/dev/null
du -sh ~/Library/Caches 2>/dev/null
du -sh ~/.npm ~/.gradle ~/.cargo ~/.m2 ~/.cocoapods 2>/dev/null
du -sh ~/Library/Caches/Homebrew 2>/dev/null
On a working developer's machine these six lines alone commonly report 50–200 GB — nearly all of it regenerable.
The cleanup, ecosystem by ecosystem
Xcode & iOS development BIGGEST WIN
rm -rf ~/Library/Developer/Xcode/DerivedData
xcrun simctl delete unavailable
DerivedData is pure build state; deleting it costs you one full rebuild per project. Unavailable simulators are dead weight from old Xcode versions. The full breakdown — including DeviceSupport, archives and simulator runtimes — is in our dedicated Xcode guide.
JavaScript: npm, Yarn, pnpm SAFE
npm cache clean --force
yarn cache clean
pnpm store prune
These are download caches — packages re-download on the next install. Old node_modules folders in finished projects are a separate (and often bigger) story; see the JavaScript cache guide.
Homebrew SAFE
brew cleanup --prune=all
brew autoremove
Removes downloaded bottles for everything already installed and uninstalls orphaned dependencies. Often worth 5–15 GB on a long-lived install.
Android & JVM: Gradle, Maven SAFE
rm -rf ~/.gradle/caches
rm -rf ~/.m2/repository
Both re-download dependencies on the next build. Expect the first build afterwards to be slow. Android Studio also keeps AVD system images under ~/.android/avd — delete emulators you no longer use from Device Manager.
Python: pip, virtualenvs SAFE
pip cache purge
Stale virtualenvs and conda environments from abandoned projects are the bigger fish — each can be hundreds of MB. They live wherever you created them (.venv folders, ~/miniconda3/envs).
Rust & Go SAFE
cargo cache --autoclean # needs: cargo install cargo-cache
go clean -modcache
Rust's target/ directories inside project folders are routinely multi-GB each — cargo clean inside a project wipes its build artifacts.
Docker CHECK FIRST
docker system df # see what's reclaimable first
docker system prune # stopped containers, dangling images, networks
docker builder prune # build cache
Do not add --volumes reflexively — volumes are where your local databases live. Prune them only after reading the list it prints.
CocoaPods SAFE
pod cache clean --all
What not to delete
- Xcode Archives — they hold the dSYMs you need to read crash reports from App Store versions.
- Docker volumes — databases, not caches.
- Downloaded LLM models (Ollama, LM Studio) — re-downloading 40 GB of weights hurts. Delete deliberately, not in a sweep. More in the AI tools guide.
- Anything holding credentials or sessions — config files, cookies, keychains. A glob that drifts too wide can log you out of everything.
Keeping it clean without thinking about it
The honest problem with the commands above isn't running them — it's remembering to. Caches grow back silently, and six months later you're staring at "Your disk is almost full" again.
DevCleaner does this list for you
A free menu bar app that scans 22 developer toolchains — everything on this page plus JetBrains IDEs, Flutter, Unity, VS Code and AI coding tools. Every category is rated Safe / Warning / Danger, risky items are never pre-selected, files holding logins are protected by a hard deny-list, and it warns if the app you're about to clean is still running. Optional auto-clean keeps caches below a threshold with an age filter, so fresh work is never touched.
Download DevCleaner — free ↓FAQ
- Why is my Mac full when I barely store files?
- Because dev toolchains cache aggressively and never clean up. Build intermediates, package downloads and old simulators hide in
~/Libraryand dotfolders where Finder doesn't show them. - Is macOS "purgeable" space the same thing?
- No. Purgeable space is what macOS itself can evict (iCloud-synced files, system caches). Dev caches don't count as purgeable — the OS has no idea your DerivedData is regenerable. You have to clean it yourself.
- How much can I realistically get back?
- First cleanup on a machine that's never been cleaned: typically 30–100 GB. DevCleaner's anonymous community counter has tracked hundreds of GB freed since launch, averaging roughly 7 GB per cleanup.