The short answer
- 01
Safe to delete. ~/Library/Developer/Xcode/DerivedData holds project indexes, logs and build products, and Xcode rebuilds all of it.
- 02
Xcode writes it every time it builds or indexes a project, one folder per project, and it never prunes old ones.
- 03
You lose build time: the next build of each project is a full build and indexing runs again.
- 04
The command: quit Xcode, then rm -rf ~/Library/Developer/Xcode/DerivedData/* (permanent, skips the Trash).
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is the DerivedData folder?
DerivedData is Xcode's build and index cache, at ~/Library/Developer/Xcode/DerivedData by default. Apple's Xcode help says derived data consists of project indexes, logs, and build products including intermediate build files.
Each project or workspace gets its own subfolder, named after the project plus a hash. A shared ModuleCache.noindex folder holds precompiled modules used across builds. None of it is source code.
What writes it and why does it grow?
Xcode writes it on every build and every indexing pass. Opening a project starts indexing, so a project you only opened once still leaves a folder behind.
- One folder per project: every project you ever built keeps its folder, including deleted or renamed ones, because Xcode does not remove old folders.
- One build per configuration and destination: Debug and Release, simulator and device builds sit side by side under
Build/Products. - The index grows with the code: each project folder keeps its own source index, which is rebuilt as you edit.
The location is set in Xcode > Settings > Locations. If someone changed Derived Data to a custom path, the folder lives there instead.
How big does DerivedData get?
It depends entirely on how many projects you build and how large they are, so there is no normal size. Measure your own:
du -sh ~/Library/Developer/Xcode/DerivedData
Prints the total. Removes nothing.
du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -h
Lists each project's folder, largest last, so you can spot projects you no longer work on.
Is it safe to delete DerivedData?
Apple's own words: the folder can be re-created at any time from your source files.
| What | Verdict | What you lose |
|---|---|---|
Everything inside DerivedData | Safe | Build products and indexes. Each project's next build is a full build. |
| One project's subfolder | Safe | That project's build and index only. |
ModuleCache.noindex | Safe | Precompiled modules; they rebuild on the next build. |
| Deleting while Xcode is building | Careful | The running build fails or Xcode shows stale errors. Quit Xcode first. |
Your project folder and .xcodeproj | Never | Your code. These are not in DerivedData and are not a cache. |
How do I delete DerivedData?
For one project, use Xcode: Product > Clean Build Folder (Shift+Cmd+K) clears that project's build products.
For everything, quit Xcode and use Terminal:
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Deletes every project's derived data at once, permanently, without the Trash. Xcode recreates the folders when you next open a project.
The manual way: in Xcode > Settings > Locations, click the arrow next to the Derived Data path to open it in Finder, quit Xcode, and drag the subfolders to the Trash.
What Hoardless does: its Xcode detector lists this folder at the Auto tier with its size, and moves it to the Trash after you review the plan. The move is logged in the undo log. The full walkthrough is in the guide to clearing Xcode DerivedData.
What comes back and when?
Only the projects you open again. Opening a project starts indexing at once, and the first build recreates its build products. Projects you never open stay gone, so the space they used is freed for good.
Expect the first build of a large project to take as long as a clean build, and code completion to be slow until indexing finishes.
See DerivedData beside every other Xcode folder
Hoardless sizes DerivedData (Auto tier), DeviceSupport (Auto), Archives (Confirm) and simulator devices (Confirm) under ~/Library/Developer, previews the plan, and moves folders to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Will deleting DerivedData delete my project?
No. Your source, .xcodeproj and .xcworkspace files live in your project folder. DerivedData holds only what Xcode generated from them.
Is it OK to delete DerivedData while Xcode is open?
Quit Xcode first. An open Xcode keeps writing indexes and build files into the folder and can show stale errors until it restarts.
Why did DerivedData come back right away?
Xcode recreates a project's folder as soon as you open or build that project. That is expected; it only refills for projects you still use.
Does Product > Clean Build Folder empty DerivedData?
No. It clears the build products of the current project only. Other projects' folders and the shared module cache stay.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.