A developer Mac setup that does not fill up every three months
Shared caches, an external drive for the right things, and four settings that stop the recurring cleanup entirely.
Cleaning a developer Mac every three months is a symptom of a setup problem rather than a discipline problem. Most of the recurring growth has a configuration answer, and the ones that do not are quick to automate.
The four settings worth changing once
- A shared plugin or package cache for anything that defaults to per project copies, starting with Terraform.
- Docker's disk on an external drive, which is usually the single largest file on the machine.
- Model and framework caches pointed elsewhere, via the environment variables in ML framework caches.
- Simulator runtimes limited to the platforms you actually target.
What belongs where
| Internal | External |
|---|---|
| Active project folders | Archived repositories |
| Build output and DerivedData | Container images and VMs |
| Package manager caches | Model weights and datasets |
| The repository you are in today | Old build artefacts and releases |
The split is about write frequency rather than size, which is the point made in what belongs on an external SSD: a folder written to thousands of times per build belongs on the fastest drive you have.
The quarterly command
find ~ -maxdepth 6 -type d \
\( -name node_modules -o -name target -o -name .next -o -name build \) \
-mtime +90 2>/dev/null -exec du -sh {} + | sort -h | tail -20Everything that prints is build output from a project untouched for three months. Removing it costs one rebuild if you return, and this single command is usually worth more than every other item on this page combined.
What to automate rather than remember
docker builder pruneweekly, filtered by age.- Simulator cleanup after each Xcode upgrade.
- A prune step in CI, per CI runner caches.
- A monthly measurement saved to a file, so growth is visible rather than sudden.
The measurement that tells you it is working
du -sh ~/.[a-z]* 2>/dev/null | sort -h | tail -10 > ~/Desktop/dev-space-$(date +%F).txtTwo of those a month apart show whether the setup is holding. If one folder is growing steadily, it is either missing a shared cache or missing a prune, and the guides for each toolchain cover both.
Common questions
How do I stop a developer Mac filling up?
Configure shared caches instead of per project copies, move Docker's disk and model caches to an external drive, limit simulator runtimes, and run a quarterly pass over build output older than 90 days.
What should go on an external drive for development?
Archived repositories, container images, virtual machines, model weights and datasets. Active projects, build output and package caches belong on the internal drive because they are written to constantly.
What is the single most useful cleanup command?
A find for build output directories older than 90 days across your home folder. Everything it prints belongs to a project you have not touched in three months and is regenerated by a build.
Is developer cleanup risky?
Less than any other category, because build output, dependency folders and caches are all regenerated. The only things to protect are source code, lock files and work that has not been pushed.