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.

Updated 11 Oct 2026. Every figure here was measured on the developer's Mac, or on a test disk on it, and carries its date.

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

  1. Quit Xcode. It writes here while it runs.
  2. Check the location. Xcode › Settings › Locations shows the DerivedData path. The default is ~/Library/Developer/Xcode/DerivedData.
  3. Open it in Finder. Press ⇧⌘G (Go to Folder) and paste the path.
  4. Move it to the Trash. Take the whole folder, or just one project's subfolder: each is named after its project.
  5. Build once to check. Open a project and build (⌘B). Xcode makes the folder again.
  6. 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.

Quick answers

Is it safe to delete Xcode DerivedData?

For a normal project, yes. It holds build files and indexes Xcode makes again. Your source code, git history and project settings are not in it. The cost is a slower next build while Xcode recompiles and re-indexes.

Where is DerivedData on a Mac?

By default at ~/Library/Developer/Xcode/DerivedData. Xcode › Settings › Locations shows where yours is, in case it was moved.

What does Clean Build Folder do?

Product › Clean Build Folder (⇧⌘K) removes the current project's build products. It does not remove other projects' folders in DerivedData.

Hear when it launches.

One email when Spaceific launches, and a notice 24 hours before the founder licences open. Nothing else.

Three optional questions
Tools you use (pick any)
Free space now
Biggest storage problem

Send me one email when Spaceific launches, and a notice 24 hours before the founder licences open. Nothing else unless I tick it. Unsubscribe in one click. Privacy.