---
title: "Clear Xcode DerivedData · MacMelon"
description: "How to remove Xcode DerivedData with Disk Housekeeper: what the folder is, why the next build is slower, and why the Trash is the default."
url: "https://macmelon.com/use-cases/clear-xcode-deriveddata"
---

# Clear Xcode DerivedData

DerivedData is Xcode's build cache. Smart Clean can include it. Preview the path, then let it go to the Trash.

[DerivedData](https://macmelon.com/glossary/deriveddata) is where Xcode keeps indexes, module caches, and intermediate build products. It is often large, and it is recreatable. The next build after a removal is slower because Xcode has to make it again.

[Disk Housekeeper](https://macmelon.com/apps/disk-housekeeper) Smart Clean can include Xcode DerivedData along with other developer caches. The clean still previews, and the default destination is still the Trash.

## Steps

1.  ### Quit the build you care about

    Do not remove DerivedData while you are waiting on a compile. Finish or stop the build first. Your source trees are not inside DerivedData, but the open project will rebuild.

2.  ### Find DerivedData in the preview

    The usual location is ~/Library/Developer/Xcode/DerivedData. Read the path in the preview. If you have more than one Xcode project, the folder holds more than one subdirectory.

3.  ### Remove it to the Trash

    Confirm the preview, and leave the files in the Trash. If a project misbehaves, you can put the folder back before you empty the Trash. After you are satisfied, empty the Trash to take the space back.

4.  ### Expect a longer next build

    That cost is the trade. Indexes and module caches come back as you work. If you need the space more than you need the warm build, this is the right clean. If you do not, skip this item in the preview.

## Before you start

-   Do not delete the Xcode application itself. DerivedData is the cache, not the IDE. See [Xcode](https://macmelon.com/glossary/xcode).
-   A custom DerivedData location in Xcode's settings will not match the default path. Trust the preview's path over a remembered one.

## Questions

Will my source code be deleted?

DerivedData holds build products and indexes, not your repository. Still read the preview. The Trash is the default so a mistake is recoverable until you empty it.

Does Disk Housekeeper delete APFS snapshots as part of this?

No. Snapshot deletion is not one of the cleaners described for Disk Housekeeper.

## Apps

[Make room for what matters. Clear clutter with confidence. ### Disk Housekeeper](https://macmelon.com/apps/disk-housekeeper)

## Related guides

[### How to clean developer files on macOS](https://macmelon.com/guides/how-to-clean-developer-files-on-macos)

## Related use cases

[### Free up space on a MacBook](https://macmelon.com/use-cases/free-up-space-on-a-macbook)[### Clean npm, Gradle, and Cargo caches](https://macmelon.com/use-cases/clean-developer-caches)

## Related terms

[Xcode's build cache: indexes, module caches, and intermediate products that the next build can recreate. ### DerivedData](https://macmelon.com/glossary/deriveddata)[Apple's integrated development environment for building apps on Apple platforms. ### Xcode](https://macmelon.com/glossary/xcode)[A required look at the files a clean will touch, before anything is removed. ### Preview before cleaning](https://macmelon.com/glossary/preview-before-cleaning)[The holding area macOS uses for files you have deleted but not yet erased. ### Trash](https://macmelon.com/glossary/trash)[Disk Housekeeper's cleaner for developer caches and node\_modules, behind a preview. ### Smart Clean](https://macmelon.com/glossary/smart-clean)

## Related notes

[node\_modules is recreatable from a lockfile, and it is also easy to remove the wrong copy. A preview and the Trash are the difference. ### Deleting node\_modules without regretting it](https://macmelon.com/blog/deleting-node-modules-without-regrets)
