Delete Xcode DerivedData, safely
DerivedData is Xcode's build and index output. It is safe to remove for a normal project, and it grows back. Here's how to remove it so you can undo it, and what it costs.
What it is
Build files and search indexes Xcode creates while compiling and browsing your projects. Xcode's own build tool describes this location as where “build products and other derived data” go (xcodebuild -help).
It grows with every project you open and changes with every build. On the developer's Mac it could free at least 1.07 GB on 9 Oct 2026.
What happens if you remove it
Source code, git history and project settings are not stored here, so a normal project loses nothing you cannot rebuild. The effect is that the next build of each affected project is slower while Xcode recompiles and re-indexes. If a project uses a custom build script that writes its own output into DerivedData, that output is removed too.
One more cost: Swift packages your projects use are kept there too, under each project's SourcePackages folder. Xcode fetches them again on the next build, so you need a network connection.
Remove it so you can undo it
- Quit Xcode. It writes here while it runs.
- Check the location. Xcode › Settings › Locations shows the DerivedData path. The default is
~/Library/Developer/Xcode/DerivedData. - Open it in Finder. Press ⇧⌘G (Go to Folder) and paste the path.
- Move it to the Trash. Take the whole folder, or just one project's subfolder: each is named after its project.
- Build once to check. Open a project and build (⌘B). Xcode makes the folder again.
- Empty the Trash when you are happy. Only then is the space freed.
From Terminal, this moves the folder to the Trash, so it can still be put back:
osascript -e "tell application \"Finder\" to delete POSIX file \"$HOME/Library/Developer/Xcode/DerivedData\""Many guides use rm -rf instead. It works, but it cannot be undone, and a typo in the path is permanent. The Trash costs you nothing extra.
Just one project
With the project open: Product › Clean Build Folder (⇧⌘K). It removes that project's build products and leaves the rest alone.
If no space comes back
Empty the Trash first. Still nothing? A Time Machine local snapshot may be holding the files. On 11 Oct 2026, after a backup, all the developer's DerivedData could promise was what Xcode had written since the backup began: 38.7 MB. Why, and what to do.
How to get it back
Open the project in Xcode and build it (Product › Build, ⌘B). Xcode makes DerivedData again on its own. If you moved it to the Trash and want it back sooner, use Put Back in Finder.