Can I delete ~/Library/Developer/Xcode/DerivedData?
Safe to delete; it rebuilds itself. DerivedData holds build results and indexes that Xcode can recreate. Deleting it frees 5–40 GB on a typical developer Mac and loses nothing you wrote; the next build of each project takes a few minutes longer.
At a glance
| Owner app | Xcode |
|---|---|
| Typical size | 5–40 GB |
| Safe to delete? | Rebuilds itself |
| Comes back? | Yes, on the next build of each project |
| What you lose | Nothing you made. The next build of each project is slower once, and Swift packages stored here are downloaded again. |
| Where it is | ~/ |
What it is
When Xcode builds a project, it keeps the intermediate results in DerivedData so the next build can reuse them: compiled objects, the search index that powers code completion, a shared module cache, and build logs. If the project uses Swift packages, their downloaded sources can live here too.
Every project you ever opened leaves a folder, and Xcode does not remove it when you stop working on that project. That is why the folder grows for years, and why it is usually the largest single piece of space Xcode uses.
Because everything inside is derived from your source code, Xcode regenerates it on demand. Gigabroom treats it as “Rebuilds itself”: ticked by default, moved to the Trash, and recoverable until you empty it.
Delete it by hand
- Quit Xcode.
- In Finder, choose Go › Go to Folder… and paste
~/.Library/ Developer/ Xcode/ DerivedData - Select the folders inside, move them to the Trash, then empty the Trash.
rm -rf ~/Library/Developer/Xcode/DerivedDataWith Gigabroom
- Open Gigabroom and wait for the scan.
- In Clean Up, open Developer Tools. DerivedData is listed as Rebuilds itself.
- Click Clean Up. The folder goes to the Trash, and Put Back is available until you empty it.
Related folders
| Folder | Safe to delete? | Typical size |
|---|---|---|
~/ | Rebuilds itself | — |
~/ | Check first | — |
~/ | Check first | — |
~/ | Safe | — |
Questions
Can I delete it while Xcode is open?
You can, but Xcode may be writing to it. Quit Xcode first so the space is actually freed.
Why is it back after a day?
Because you built a project. Xcode creates one folder per project on its first build, and the folder grows with every build.
Does it hold my source code?
No. Your code lives in your project folders. DerivedData holds only build output, indexes and a module cache.
Can I delete only one project's folder?
Yes. Each project has its own folder, named after the project with a long suffix. Delete the one you want to rebuild from scratch and leave the others.
The folder is somewhere else on my Mac. Does this still apply?
Xcode lets you choose another location in Settings › Locations. The same advice applies to whichever folder is set there.
Last checked on macOS 27.0.1 · 2026-11-09
