macOS cleanup guides / Xcode build data

Xcode Derived Data on Mac: locate it, clean it and rebuild

Repeated builds from Xcode or an AI coding workflow can grow Derived Data. It normally contains generated build products, indexes and other working files. Removing selected generated data can free space, but the next build may need time, network access and fresh disk space.

Check the location and the project before removing anything

The default is ~/Library/Developer/Xcode/DerivedData. Xcode can use a custom location. Keep source repositories and Archives; neither is a substitute for rebuildable data.

Follow the manual Xcode steps

AgentClean does not currently support Xcode Derived Data cleanup. Use Xcode and Finder for the steps below; review other supported AI tools separately.

Find Derived Data

Manual Xcode maintenance · AgentClean does not clean Derived Data

01 / Where does Xcode store Derived Data?

Where does Xcode store Derived Data?

Open Xcode → Settings → Locations and inspect Derived Data. Use the arrow beside the configured location to open it in Finder. Workspace or project settings and build scripts can override that path; check them if the directory size does not match your builds.

For the default path, use Finder’s Go to Folder with ~/Library/Developer/Xcode/DerivedData. The ~ refers to your home folder. A folder can be absent when Xcode has not built a project or uses another location.

02 / Separate generated data from valuable development files

Separate generated data from valuable development files

Separate generated data from valuable development files
LocationTypical contentsWhat to do
~/Library/Developer/Xcode/DerivedDataBuild products, indexes, logs and sometimes resolved package checkouts.Select only obsolete generated data. Allow time and network access to rebuild.
~/Library/Developer/Xcode/ArchivesArchived builds and associated debug symbols.Keep releases and dSYMs needed for distribution or crash symbolication.
~/Library/Developer/CoreSimulatorSimulator devices, runtimes and their app data.Manage separately in Xcode; do not treat it as Derived Data.
Source projectCode, assets, project files and uncommitted work.Keep a verified backup or commit before cleaning nearby folders.

03 / Measure without deleting

Measure without deleting

Check the default directory and its volume
du -sh "$HOME/Library/Developer/Xcode/DerivedData"
df -h "$HOME"

These commands only read sizes. A custom Derived Data folder must be measured at its actual path. A missing-folder error is not a reason to create or delete anything. Compare free space on the volume that holds the chosen folder; a custom external location may use a different volume.

04 / Remove selected Derived Data after closing Xcode

Remove selected Derived Data after closing Xcode

  1. Save and commit or back up your work. Finish builds, tests and AI tasks that use Xcode, then quit Xcode and the related build processes.
  2. Open the verified Derived Data location in Finder. Identify the project’s generated folder; if you cannot associate it with a project, leave it alone.
  3. Move only the selected obsolete generated folder to Trash. Do not move the source project, Archives or the whole Library/Developer directory.
  4. Reopen Xcode and build the project to check that dependencies and indexes can be recreated. Trash still occupies space until emptied; review its contents before doing so.
Clean Build Folder is narrower

Product → Clean Build Folder removes build products for the current context. It does not necessarily remove the entire Derived Data directory, all indexes or data for other projects. Use it for build troubleshooting without assuming it frees the whole directory’s size.

05 / Rebuild and check the same volume

Rebuild and check the same volume

The first build and indexing pass may be slower. Package dependencies may download again. If the disk is too full to rebuild, first move known large personal files to another volume and verify the copies. Do not erase release archives to make a rebuild fit.

Emptying reviewed Trash may release space; APFS snapshots and open files can delay the visible change. Derived Data grows again with normal builds. Recheck actual free space rather than promising a fixed number of gigabytes.

References and next steps

Scan and review in one place

Review AI tool storage separately

Use Xcode and Finder for Derived Data. AgentClean can help inspect caches and other cleanup candidates for separately supported AI tools.

Xcode Derived Data is outside the current AgentClean cleanup scope. For supported tools, scan and review for free; permanent cleanup requires an active subscription.

View supported tools · Check the supported list before choosing a cleanup tool.

Frequently asked questions

A few more things to check

Is it safe to delete Xcode Derived Data?

Selected generated data can normally be recreated after Xcode and builds are stopped. Confirm the actual location, preserve your source files and allow for rebuilding and dependency downloads. Do not confuse Derived Data with Archives or simulator data.

Why is Derived Data so large?

Multiple projects, configurations, indexes and build products can accumulate. AI-assisted coding may trigger more builds, but the directory’s contents and size depend on the actual workflow.

Does Clean Build Folder remove all Derived Data?

No. It addresses build products for the current context and may leave indexes and other projects’ data. Inspect the configured folder to understand what remains.

Can AgentClean clean Xcode Derived Data?

Not currently. This guide describes manual Xcode and Finder operations. AgentClean can separately scan the AI tools listed on its supported-tools page.