SiftMac
Guide · 25 October 2026

Xcode DerivedData, node_modules and Docker: what’s safe to delete on a developer’s Mac

By Mohit Nippanikar, who makes SiftMac

A developer’s Mac fills up differently. Every project brings its own packages and build output, Xcode keeps build data and simulators for years, and Docker grows one big disk image. Almost all of it comes back with one install or build, which makes it the easiest space to get back, as long as you clear it in projects you’re not working on today.

The short version

Step 1: see where it went

This lists the usual suspects with their sizes, biggest last. Folders you don’t have are skipped:

du -sh ~/Library/Developer/Xcode/{DerivedData,Archives,"iOS DeviceSupport"} \
  ~/Library/Developer/CoreSimulator ~/.npm ~/.gradle ~/.cargo ~/.cache/uv \
  ~/Library/Caches/{Homebrew,pip,CocoaPods,Yarn} ~/.android \
  2>/dev/null | sort -h

And every node_modules in your projects folder (change ~/Projects to wherever you keep code):

find ~/Projects -name node_modules -type d -prune -exec du -sh {} + 2>/dev/null | sort -h

Xcode

FolderWhat it isSafe to clear?
~/Library/Developer/Xcode/DerivedDataBuild output, indexes and logs, one folder per project.Rebuilds With Xcode quit. The next build of each project takes longer.
~/Library/Developer/Xcode/iOS DeviceSupportDebug symbols copied from every iOS version you’ve connected, often several GB each.Rebuilds Old versions. Xcode copies them again when you plug in a device.
~/Library/Developer/Xcode/ArchivesBuilds you exported or uploaded, with their debug symbols (dSYMs).You decide Keep archives of versions people still run: you need them to read crash reports.
~/Library/Developer/CoreSimulator/DevicesEvery simulator, with the apps and data in it.You decide Remove with simctl, below, not in Finder.
~/Library/Developer/CoreSimulator/CachesSimulator caches.Safe

Clear DerivedData with Xcode quit:

rm -rf ~/Library/Developer/Xcode/DerivedData/*

Simulators belong to Xcode, so remove them the way Xcode does. The first command removes simulators for iOS versions that are no longer installed; the next two list the simulator runtimes, which are several GB each, and delete one you don’t need:

xcrun simctl delete unavailable
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-id>

Runtimes can also be removed in Xcode › Settings › Components (Platforms in older versions).

Node.js: node_modules and package caches

A node_modules folder is everything npm install downloaded for one project, and a few hundred MB each adds up fast across old projects. In any project you’re not working on, it’s safe to delete: npm install (or yarn, pnpm install) brings it back from the lockfile.

To pick them one by one from a list with sizes, run npx npkill in your projects folder. To remove them all in one folder tree without asking, which is only wise for old projects:

find ~/Projects/old -name node_modules -type d -prune -exec rm -rf {} +

The package managers’ own caches are also safe; they download again as needed:

npm cache clean --force
yarn cache clean
pnpm store prune

Python

Docker

Docker Desktop keeps every image, container, volume and build cache inside one disk image, Docker.raw, in ~/Library/Containers/com.docker.docker. Never delete that file. Ask Docker what it can give back, then free it:

docker system df
docker system prune
docker builder prune

docker system prune removes stopped containers, unused networks, dangling images and build cache, and asks first. docker image prune -a also removes images no container uses, which then download again on the next pull. Volumes are left alone unless you add --volumes; they hold databases and other data, so leave them unless you’re sure. Docker.raw is a sparse file: Finder shows its maximum size, du -h shows what it really uses. To cap it, lower the disk limit in Docker Desktop’s Settings › Resources.

Homebrew, Gradle, Android, Rust, Go and CocoaPods

ToolWhereHow to clear
Homebrew~/Library/Caches/Homebrew and old versionsbrew cleanup, then brew autoremove for dependencies nothing needs
Gradle~/.gradle/cachesgradle --stop, then delete the folder. The next build downloads again.
Android~/.android/avd, plus SDK imagesDelete emulators you don’t use in Android Studio’s Device Manager, and old system images in its SDK Manager
Rusteach project’s target folder, ~/.cargo/registrycargo clean in old projects
Gomodule cachego clean -modcache
CocoaPods~/Library/Caches/CocoaPods, each project’s Podspod cache clean --all; pod install brings Pods back
Fluttereach project’s build folderflutter clean in old projects

What to keep

Or let SiftMac find the stale ones. It lists build folders and packages only in projects you haven’t changed for a month or more (you choose 1, 3 or 6 months), and only when the file that rebuilds them is there: package.json, requirements.txt, Cargo.toml and the like. Anything a running program is using is skipped. Xcode DerivedData, old device support and simulators are included, simulators are removed through simctl, and Docker is opt-in, freed with Docker’s own prune commands. Volumes are never touched.

Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works