Developer Caches on Mac: What's Safe to Clear (Xcode, Gradle, npm and More)
Developer tools quietly fill your Mac with tens of gigabytes of caches. Here's where they live, which ones rebuild themselves, and the right command to clean each one.

If you write code on a Mac, a surprising share of your disk belongs to your tools rather than your projects. Build caches, package caches, simulators and old SDKs pile up silently. On a busy developer Mac it's common to find 30–80 GB of this.
The good news: almost all of it is rebuildable. Delete it and the tool downloads or rebuilds what it needs next time. The bad news: the first build afterwards is slower. Here's what's where, and how to clean each one properly.
Xcode
DerivedData —
~/Library/Developer/Xcode/DerivedData. Build products and indexes for every project you've opened. Safe to delete; Xcode rebuilds per project.Archives —
~/Library/Developer/Xcode/Archives. Your shipped builds and their dSYMs. Review these: you may need dSYMs to symbolicate old crash reports. Offload rather than delete.Device support —
~/Library/Developer/Xcode/iOS DeviceSupport. One folder per iOS version you've connected. Old versions are safe to remove.Simulators — remove unavailable ones with
xcrun simctl delete unavailable, and old runtimes in Xcode → Settings → Platforms.
Gradle (Android, Kotlin, Java)
~/.gradle/caches holds downloaded dependencies and build caches. It's safe to delete; Gradle downloads what it needs on the next build. Stop any running daemons first with ./gradlew --stop.
JavaScript: npm, pnpm, yarn
npm —
~/.npm. Clean withnpm cache clean --force.pnpm — the content-addressable store. Remove unreferenced packages with
pnpm store prune.yarn —
yarn cache clean.node_modulesin old projects — often the biggest of all. Delete them in projects you haven't touched in a while;npm installbrings them back.
Python: pip and uv
pip —
~/Library/Caches/pip. Clean withpip cache purge.uv —
~/.cache/uv. Clean withuv cache clean(oruv cache pruneto keep what's in use).Old virtual environments (
.venv) inside abandoned projects can be deleted and recreated.
iOS and Flutter dependencies
CocoaPods —
~/Library/Caches/CocoaPods. Clean withpod cache clean --all.Flutter / Dart —
~/.pub-cache. Clean withflutter pub cache clean.
Homebrew
Homebrew keeps old versions and downloaded bottles. brew cleanup removes old versions; brew cleanup --prune=all also clears the download cache.
Docker
Docker Desktop stores everything in one large disk image that doesn't shrink on its own. Use docker system prune (add -a to remove unused images too) or Docker Desktop → Troubleshoot → Clean / Purge data.
Rules of thumb
Never delete
.gitfolders or projects you changed recently.Prefer the tool's own clean command over deleting folders by hand; it knows what's in use.
Offload instead of deleting when a rebuild would be slow or costly, like large model downloads or archived builds you might need again.
The short version
DerivedData, Gradle, npm, pip, uv, CocoaPods and Homebrew caches all rebuild themselves. Archives and old projects deserve a second look. Clean with each tool's own command, and offload anything slow to rebuild.
Clearbay recognises these folders, labels each one Safe, Review or Caution, and never suggests .git folders or projects you've touched in the last 7 days. Coming soon to the Mac App Store.


