Blog / Sep 15, 2026 · 3 min read
Clean Xcode DerivedData Without Fear (Save 20–60 GB)
If you write Swift or write iOS apps, you’re probably sitting on 20–60 GB of Xcode DerivedData you forgot you owned. It’s the single most predictable disk bloat on a developer Mac — and it’s 100% clearable without fear.
What DerivedData actually is
When Xcode builds, it dumps compiled artifacts into ~/Library/Developer/Xcode/DerivedData/<Project>-<hash>/. Inside:
- Build products —
.app, object files,.dylibs - Module caches — precompiled
.pcms - Index data — the code-completion + jump-to-definition DB
- Logs — build logs / previews
Open each build, Xcode rebuilds those artifacts anyway (that’s the point of a cache). So deleting DerivedData never breaks your project — you just pay one extra compile the next time you open Xcode. That’s the entire risk, and it’s a few minutes of compile, not data loss. Your actual source (in your repo) is untouched, always.
The one-line safe delete
rm -rf ~/Library/Developer/Xcode/DerivedData
Xcode recreates the folder automatically on next open. But don’t rm -rf if you’re nervous — go through the Trash instead (see below).
Better: delete by project, with the Trash
The smarter move for most devs: use ⇧⌘⇧ on the DerivedData path inside a disk analyzer, or just:
- Open
~/Library/Developer/Xcode/DerivedData - Sort by size
- Drag stale projects’ folders to the Trash (one per old app; keep the current one if you’re actively building)
That way the big, old, unneeded build caches are reclaimed, your current workflow stays fast, and everything is recoverable from the Trash until you empty it.
The DiskInsight way
Rationalized garbage is the whole DiskInsight thesis: a disk analyzer that knows what DerivedData is and flags it as developer cache, alongside CoreSimulator runtimes, Docker layers, and node_modules — instead of hiding it under System Data.
- One click shows every DerivedData folder, sorted by size.
- Every cleanup is staged to the macOS Trash — nothing permanent, nothing behind your back, everything reviewed.
- No subscriptions, no accounts, 100% local.
Pro tips
defaults write com.apple.dt.Xcode IDEDisableMinimumBuildHash— not a space fix, skip that rabbit hole.- Enable “Only when needed” for device debug in older Xcode — reduces log spam.
- Close physically you-don’t-need simulators; each booted runtime eats GBs.
- Run
xcodebuild cleanon dead branches before you prune DerivedData manually. - Schedule a weekly
DiskInsightscan flagging caches — most devs reclaim 30 GB the first week.
The bottom line
DerivedData is safe to clear, rebuilds itself, and is the #1 developer win on any Mac disk analyzer’s list. The only question is whether you do it rm-style (instant, permanent) or Trash-style (recoverable, reviewed). Choose Trash-style — that’s what DiskInsight is built around.