Yes. ~/Library/Developer/Xcode/DerivedData holds intermediate build files and indexes that Xcode recreates automatically. Deleting it loses nothing you wrote; the next build of each project just takes a little longer. Quit Xcode first so it isn’t writing to the folder.
The five questions
Temporary files Xcode creates every time you build an app.
Xcode keeps them for every project you've ever built, even ones you deleted long ago.
Yes. Xcode recreates them automatically.
Your next build of each project takes a little longer.
Yes, for the projects you keep building.
How big it gets: 5–80 GB on developer Macs. It keeps folders for projects you deleted long ago.
Where it lives: ~/Library/Developer/Xcode/DerivedData
Clean one project or all of them
Each folder inside DerivedData is named after a project followed by a hash. Removing a single folder resets just that project. Removing them all is fine too. Sort the folder by Date Modified in Finder and projects you haven't built in months are easy to spot.
Keeping it small
Xcode never prunes DerivedData on its own. Clearing it every few months, or whenever you switch Xcode versions, keeps it from quietly growing past 50 GB.
Do it yourself
Quit Xcode, then delete the DerivedData folder in Finder (Go > Go to Folder > ~/Library/Developer/Xcode/DerivedData).
rm -rf ~/Library/Developer/Xcode/DerivedData/*With Tidy Mac: Xcode build files
Tidy Mac’s Clean screen lists each project folder in DerivedData with its size, as Safe to clear and preselected. It won’t touch them while Xcode is open. Whatever Tidy Mac removes goes to the Trash first, and History lets you undo it.

See your own xcode build files in seconds
See every part of your storage explained, and clear junk to the Trash with Undo. $9.99 $29 once, 2 Macs.
Frequently asked questions
Is it safe to delete xcode build files on a Mac?
Yes. Xcode recreates them automatically.
Why are my xcode build files so big?
Xcode keeps them for every project you've ever built, even ones you deleted long ago.
What happens after I remove xcode build files?
Your next build of each project takes a little longer.
Will xcode build files come back?
Yes, for the projects you keep building.
How do I clean xcode build files manually?
Quit Xcode, then delete the DerivedData folder in Finder (Go > Go to Folder > ~/Library/Developer/Xcode/DerivedData).