Xcode · free up space
Where is DerivedData, and is it safe to delete?
~/Library/Developer/Xcode/DerivedData. Deleting it is safe: every byte of it is build output Xcode can make again. What it costs you is the rebuild.
What is actually in there
One folder per project, each holding compiled objects, module caches, indexes, logs and the built app itself. Xcode never cleans them up: a project you last opened two years ago still has its folder, at full size, and a project you have since deleted still has its folder too.
On the Mac this app was built on, DerivedData was 9.06 GB — the single largest reclaimable thing on the disk, and most of it belonged to scratch projects that no longer existed.
It also comes back. DerivedData was cleared again on 11 September 2026 (3.1 GB that time); by 1 October 2026 it was 0.67 GB, from three weeks of ordinary builds. Clearing it is maintenance, not a one-off: the folder grows with every project you open and never shrinks by itself.
Finding it by hand
du -sh ~/Library/Developer/Xcode/DerivedData
du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -h | tail -20The second line is the useful one: it names the projects, largest last. A folder whose project you cannot place is the easiest space on the whole machine to get back.
How to delete DerivedData
Quit Xcode first, whichever way you do it.
- From Xcode: Xcode → Settings → Locations shows the Derived Data path, and the arrow beside it opens the folder in Finder. Move what is inside to the Trash, then empty the Trash; nothing is freed until you do. Product → Clean Build Folder (⇧⌘K) only clears the open project's build products, so it rarely frees much.
- From Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData/*deletes every project's folder at once, skipping the Trash. There is no undo, which is fine for build output, but read the path twice. To clear one project, delete just its folder.
The same steps with screenshots, and how RefreshYourMac does it, are in clearing DerivedData three ways.
What deleting it costs
- A full rebuild of any project you open next — minutes, not seconds, on a large one.
- The index goes, so Xcode re-indexes before jump-to-definition and autocomplete work properly again.
- Nothing else. No source, no settings, no signing identity. It is output, not input.
Do not delete it while Xcode is building. Removing a build tree mid-build does not just fail the build; it can leave Xcode confused about a target until it is restarted.
The neighbours, which are often bigger
DerivedData is rarely alone. In the same ~/Library/Developer tree sit archives from every distribution build you ever made, device support folders for every iOS version you ever plugged in, and CoreSimulator caches. Simulator runtimes live elsewhere again and are usually the biggest of the lot — see removing old simulator runtimes.
Where the app comes in
RefreshYourMac measures all of them separately, rates DerivedData Safe for auto removal — every byte of it regenerates, and the only cost is that rebuild — and refuses to touch it while Xcode is open. It shows you the folders and their sizes before anything is deleted, and nothing goes without you saying so. If the disk is full right now, start with what to delete first.
What to do next: see these numbers for your own Mac. Download RefreshYourMac free, or get it on the Mac App Store.
What it costs to have an app do this
| RefreshYourMac | CleanMyMac | MacKeeper | |
|---|---|---|---|
| Pay once | $24.99 | €119.95 on MacPaw’s store; $89.99 for CleanMyMac X on the Mac App Store | subscription only |
| Yearly | $14.99 a year, first 7 days free | $39.99/yr; €19.91/yr for the cleaning-only Essential Trio | €71.40 for the first year, 1 Mac. Their page shows it against a €119.40 list price |
| Monthly | $1.99 a month | $9.99/mo | €10.95/mo |
| Account needed | No | Yes | Yes |
Before you pay anything, both versions give you 3 free scans. CleanMyMac and MacKeeper prices read from their own pages and the Mac App Store on 27 October 2026; the full comparison is at RefreshYourMac vs CleanMyMac and MacKeeper.
Frequently asked questions
What happens if I delete Xcode DerivedData?
The next project you open needs a full rebuild, which takes minutes on a large one, and Xcode re-indexes before jump-to-definition and autocomplete work properly again. No source, settings or signing identity is lost, because DerivedData is output, not input.
Does Xcode clean up DerivedData by itself?
No. A project you last opened two years ago, or have since deleted, still has its folder at full size. The folder grows with every project you open and never shrinks by itself, so clearing it is maintenance rather than a one-off.
Can I delete DerivedData while Xcode is building?
Do not. Removing a build tree mid-build does not just fail the build; it can leave Xcode confused about a target until it is restarted. Wait until nothing is building before clearing it.
What else in ~/Library/Developer takes up space?
Archives from every distribution build you ever made, device support folders for every iOS version you ever plugged in, and CoreSimulator caches. Simulator runtimes live elsewhere again and are usually the biggest of the lot.