How to Safely Clean Xcode DerivedData on macOS
If you’re an iOS or macOS developer, DerivedData is one of the quietest disk-space thieves on your Mac. It stores intermediate build artifacts, indexes, and logs that Xcode generates every time you hit Build. Over months, a single project can accumulate several gigabytes. Multiply that by multiple projects, and it’s easy to lose 10–30 GB without noticing.
The good news: DerivedData is 100% safe to delete. Xcode regenerates everything on the next build. The only risk is accidentally deleting something else while you’re poking around ~/Library/Developer/Xcode. This guide shows you the safe manual approach, then the one-click alternative.
What Is DerivedData?
When Xcode builds your project, it produces a mountain of intermediate files:
- Build products — compiled object files, linked binaries, and dSYM bundles
- Index data — the index that powers jump-to-definition, autocomplete, and refactoring
- Logs — build transcripts, warnings, and analyzer output
- Module cache — precompiled Swift and Clang modules for faster incremental builds
All of this lives under:
~/Library/Developer/Xcode/DerivedData/
Each workspace gets its own folder named with a hash suffix, e.g. MyApp-abcd1234.... The folder contents are tied to a specific checkout and build configuration, so deleting them does not affect your source code, assets, or Git history.
Method 1: The Manual (Safe) Way
Step 1 — Check how much space you’re losing
du -sh ~/Library/Developer/Xcode/DerivedData
It’s not unusual to see 8.2G or more.
Step 2 — Delete the contents
Move the folder to Trash so you have a recovery window:
mv ~/Library/Developer/Xcode/DerivedData/* ~/.Trash/
Or, if you’re confident and want immediate space back:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Step 3 — Rebuild your project
Open Xcode and hit ⌘+B. The first build will be slower because Xcode rebuilds the index and module cache, but subsequent builds return to normal speed.
Method 2: Clean Build Folder (Within Xcode)
Xcode has a built-in command that wipes the active project’s DerivedData without touching other projects:
Product → Clean Build Folder (⇧⌘K)
This is safe and project-scoped, but it only targets the current workspace. It won’t clean up old projects you haven’t opened in months.
Method 3: One-Click with Bytegone
If you want to reclaim space across all your projects — plus browser caches, npm caches, Docker images, and more — without memorizing paths or touching Terminal, Bytegone does it in one click:
| Method | Scope | Recovery | Time |
|---|---|---|---|
| Manual Terminal | All projects | Only if you Trash first | ~2 min |
| Clean Build Folder | Current project only | None (rebuild required) | ~30 sec |
| Bytegone | 13 categories incl. DerivedData | Moves to Trash by default | ~10 sec |
Reclaim disk space the safe way
Bytegone scans 13 reclaimable locations — including Xcode DerivedData — and moves them to Trash with your confirmation. Never your work, never system files.
Download BytegoneFAQ
Will deleting DerivedData break my project?
No. DerivedData is entirely generated from your source. Xcode recreates it on the next build. The only side effect is a slightly slower first build while the index regenerates.
Why does DerivedData grow so large?
Every time you switch branches, change build settings, or update dependencies, Xcode creates new intermediate files. Old ones are rarely purged automatically. Over a year, this can balloon to 20 GB+.
Is it safe to delete ~/Library/Developer/Xcode entirely?
Mostly yes, but ~/Library/Developer/Xcode also contains DeviceSupport and UserData. DeviceSupport files are large (iOS symbol caches) but re-download automatically. UserData holds your custom snippets and themes. Bytegone specifically targets DerivedData and known caches, leaving the rest alone.