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
| Location | Typical contents | What to do |
|---|---|---|
~/Library/Developer/Xcode/DerivedData | Build products, indexes, logs and sometimes resolved package checkouts. | Select only obsolete generated data. Allow time and network access to rebuild. |
~/Library/Developer/Xcode/Archives | Archived builds and associated debug symbols. | Keep releases and dSYMs needed for distribution or crash symbolication. |
~/Library/Developer/CoreSimulator | Simulator devices, runtimes and their app data. | Manage separately in Xcode; do not treat it as Derived Data. |
| Source project | Code, assets, project files and uncommitted work. | Keep a verified backup or commit before cleaning nearby folders. |
03 / Measure without deleting
Measure without deleting
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
- 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.
- 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.
- Move only the selected obsolete generated folder to Trash. Do not move the source project, Archives or the whole Library/Developer directory.
- 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.
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.
Stay tuned
AgentClean is currently available only for Mac. Other platforms aren’t available yet. Visit this site on a Mac to download.
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.