DiskInsight / Guides

Xcode DerivedData too big? Here's the safe fix

Why it balloons, where it lives, and the difference between clearing every build and the build you're still using.

Where DerivedData lives

Xcode stores build products, module caches, compile logs and link files in ~/Library/Developer/Xcode/DerivedData. Each project gets a folder named by its target plus a hash, so it's nearly impossible to tell what's safe to clear without opening it.

Why it grows without you noticing

DerivedData is rebuilt on every build. Old projects you haven't touched in months keep their DerivedData folders forever. Debug symbols, precompiled module caches and simulator support files routinely push a single install past 10 GB, and a machine with several projects cumulatively exceeds 20–50 GB.

The manual way

To clear everything: quit Xcode, then

rm -rf ~/Library/Developer/Xcode/DerivedData

You can also do it from Xcode: Settings → Locations → Derived Data → delete arrow. Clearing the whole folder means your next build compiles from scratch — slower, but harmless.

The per-project way

If you only want to delete stale projects, list the folders inside DerivedData, sort by size, and remove the ones whose project you no longer build. That's exactly what DiskInsight's Dev Cache Cleaner automates: it scans DerivedData plus Archives, iOS simulators, SwiftPM and more, shows each one's byte cost, and stages your picks for the Trash so nothing is permanently removed.

More guides

Related reading

Let DiskInsight find every build-cache byte

Dev Cache Cleaner covers Xcode, npm, CocoaPods, Gradle and more — all local.