Where your Mac's storage actually goes when you're a developer
My Mac said 47 GB of "System Data" and gave me no way to see what it was. When I dug in, Xcode alone was using 36.8 GB, and 18 projects I hadn't touched in months were holding 14 GB of node_modules. None of it was photo
My Mac said 47 GB of "System Data" and gave me no way to see what it was. When I dug in, Xcode alone was using 36.8 GB, and 18 projects I hadn't touched in months were holding 14 GB of node_modules.
None of it was photos or downloads. It was developer leftovers that macOS doesn't label, and most of it can be rebuilt with one command. Here's where it hides and how to clear it safely.
First, measure
Run this in Terminal to see the usual suspects, smallest to largest:
du -sh ~/Library/Developer/* ~/.npm ~/.cache ~/.gradle ~/.cargo ~/.ollama 2>/dev/null | sort -h
If some folders are missing, give Terminal Full Disk Access in System Settings β Privacy & Security.
The rule for everything below: delete what can be rebuilt, keep what can't. And quit the related app before deleting its files.
- Xcode (often the biggest)
DerivedData holds build products and indexes. It's safe to delete; Xcode rebuilds it on the next build, which will be slower once.
rm -rf ~/Library/Developer/Xcode/DerivedData/*
Unavailable simulators are devices for runtimes you no longer have:
xcrun simctl delete unavailable
Simulator runtimes are several GB each. List them, then delete the iOS versions you don't test on:
xcrun simctl runtime list
xcrun simctl runtime delete <runtime-identifier>
You can also do this in Xcode β Settings β Components (called Platforms in older versions).
iOS DeviceSupport (~/Library/Developer/Xcode/iOS DeviceSupport) has a folder per iOS version you've connected a device with. Old versions are safe to delete; Xcode copies them again when that device reconnects.
Archives (~/Library/Developer/Xcode/Archives): be careful. They contain the dSYMs you need to read crash reports from builds you shipped. Only delete archives for builds that are no longer in users' hands.
- Docker
See what Docker is using:
docker system df
Then clean up in order of risk:
docker builder prune # build cache: safe
docker image prune -a # images not used by any container
docker container prune # stopped containers
docker system prune -a --volumes does all of this and also deletes unused volumes. That includes local database data, so only run it if you know what's in your volumes.
Why Docker.raw looks huge: Docker Desktop's disk image is a sparse file. Finder and ls show its maximum size; du shows what it really uses:
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
After pruning, Docker hands the freed space back to macOS, though it can take a few minutes. You can also lower the limit in Docker Desktop β Settings β Resources.
- node_modules in old projects
List every node_modules under your projects folder by size (change ~/code to wherever yours are):
find ~/code -name node_modules -type d -prune -exec du -sh {} + | sort -h
For an interactive version, npx npkill lets you browse and delete them.
It's safe for any project with a lockfile: npm ci (or pnpm install, yarn) brings it back exactly. The same goes for .next, dist, build and Rust's target/ (cargo clean) in projects you're not working on.
- Package manager caches
Every tool keeps its own download cache, and all of these re-download on demand. Medium has no tables, so this goes in one code block:
npm npm cache clean --force
pnpm pnpm store prune
Yarn v1 yarn cache clean
Yarn v2+ yarn cache clean --all
Bun bun pm cache rm
Homebrew brew cleanup --prune=all
pip pip cache purge
uv uv cache clean
conda conda clean --all
Gradle rm -rf ~/.gradle/caches
- Local AI models
A single model is anywhere from 4 GB to 40+ GB, and it's easy to forget which ones you tried.
Ollama keeps models in ~/.ollama/models:
ollama list
ollama rm <model-name>
Hugging Face caches downloads in ~/.cache/huggingface/hub:
huggingface-cli scan-cache
huggingface-cli delete-cache
Newer versions of the CLI are called hf.
- Editors and AI coding agents
VS Code and Cursor keep per-project state in workspaceStorage, which grows with every folder you've ever opened:
~/Library/Application Support/Code/User/workspaceStorage
~/Library/Application Support/Cursor/User/workspaceStorage
Quit the editor first. Deleting these resets per-project UI state, not your settings or extensions.
AI coding agents save full transcripts. Claude Code keeps them in ~/.claude/projects and removes old sessions after cleanupPeriodDays (30 by default). Codex CLI keeps them in ~/.codex/sessions.
Before deleting these, it's worth searching them for API keys you've pasted into a session. They're plain text, and they sit in your home folder.
- Time Machine local snapshots tmutil listlocalsnapshots /
macOS removes these on its own when it needs the space, so you usually don't need to touch them. If an installer refuses to run, sudo tmutil deletelocalsnapshots removes one.
What I'd do first
DerivedData and unavailable simulators.
docker builder prune.
node_modules in projects you haven't opened in a month.
brew cleanup --prune=all and your package manager's cache.
For me, that alone got back most of the 47 GB.
Disclosure: I build SpaceWise, a Mac and Windows app that finds these folders and checks lockfiles and git activity before cleaning. Everything above works without it.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.