In short
- Safe to delete: Xcode's DerivedData, and the npm, Yarn, pip, uv and Homebrew caches. The tools rebuild them.
- Don't delete Docker's folder or pnpm's store. Use
docker system pruneandpnpm store prune. ~/.gradleand~/.m2also hold settings that can contain passwords and signing keys. Those do not come back.- Old projects keep their
node_modulesand build folders. Across many projects they add up.
Where the space goes
StorageJanitor started as this exact problem. On the Mac it was first built for, System Data showed 127 GB. The largest folders turned out to be Yarn's cache at 45 GB, npm's cache at 21 GB, Docker's disk at 19 GB, and the Puppeteer and uv caches at about 16 GB together. About 66 GB came back.
macOS's storage screen names none of those folders. Most of that space was counted as System Data.
Safe to delete: the tool rebuilds it
These hold copies a tool can download or build again.
- Xcode build filesXcode recreates them on your next build.Safe to delete
- Package manager cachesnpm, Yarn, pip and uv download packages again when a project needs them.Safe to delete
- Homebrew downloadsKept only to reinstall faster.Safe to delete
Most of these tools have a command of their own that does the same job:
| Tool | Command | What it removes |
|---|---|---|
| npm | npm cache clean --force | Every package in npm's cache |
| Yarn | yarn cache clean | Every package in Yarn's cache |
| pip | pip cache purge | Every package pip downloaded |
| uv | uv cache clean | Every package in uv's cache |
| Homebrew | brew cleanup | Old versions and outdated downloads |
| Go | go clean -cache | The build cache |
Check first: deleting the folder costs you something
These look like caches, and several are very large. Deleting the folder itself loses work, breaks a tool, or frees far less than its size suggests. Each has a safer way.
- Docker's diskYour containers, images and volumes live here.Check first
- Simulators and Xcode archivesRemove them from inside Xcode.Check first
- AI models and test browsersThey come back, but can take a long time to download.Check first
- Toolchains and IDE cachesRemoving them can break a tool or lose settings.Check first
Build folders inside your projects
Every project keeps its own copy of what it installed or built: node_modules, a Rust or Java target folder, a Python environment. Across many projects they add up, and old projects keep theirs forever.
StorageJanitor finds them by their shape, wherever the project lives. Build output a tool recreates, such as Rust, Java and Swift build folders, is Safe to delete. node_modules, Python environments, CocoaPods and Terraform folders are Check first, so they are moved to the Trash.
See the size before you remove anything
To measure one folder in Terminal:
du -sh ~/Library/Developer/Xcode/DerivedData
To see what Docker is using:
docker system df
StorageJanitor measures all of these in one scan, lists them under Developer with their sizes, and shows the exact list before anything is removed.

- Photos & videos 52.3 GB
- Documents 28.6 GB
- Applications 21.4 GB
- App data 22.6 GB
- App caches 13.1 GB
- System files 9.4 GB
- Logs 1.3 GB
Questions people ask
Is it safe to delete Xcode's DerivedData?
Yes. DerivedData holds build files, and Xcode recreates them on your next build. The first build afterwards is slower.
Is it safe to delete node_modules?
Yes, if the project still has its package.json and lockfile: your package manager installs everything again. StorageJanitor marks node_modules Check first and moves it to the Trash, because reinstalling needs a connection and time.
How do I free up Docker disk space on a Mac?
Run docker system df to see what is using it, then docker system prune to remove stopped containers, unused networks, dangling images and unused build cache. Don't delete Docker's folder in ~/Library/Containers: that removes every container, every image and the data in your volumes.
Can I delete the ~/.npm folder?
Delete the cache inside it, not the folder. ~/.npm/_cacache holds packages npm downloaded before, and npm fetches them again the next time a project asks for them. npm cache clean --force does the same thing.
Is it safe to delete ~/.gradle or ~/.m2?
Not without looking. The downloaded packages come back on the next build, but your Gradle and Maven settings are in those folders too. They can hold signing keys and repository passwords, and those do not come back.