Home › Clean developer files on Mac
Xcode, Docker, node_modules: cleaning developer files on Mac
On a developer Mac, the biggest space users are usually Xcode build data and simulators, Docker images and build cache, node_modules in old projects, package caches (npm, Homebrew, pip) and local AI models. Most of it can be rebuilt or downloaded again. Measure first, clear what you can rebuild, and keep anything that is the only copy of your work, such as Xcode archives you shipped.
Measure before you delete
Open Terminal and check the usual suspects. Each line prints a size, or nothing if the folder doesn't exist:
du -sh ~/Library/Developer/Xcode/DerivedData du -sh ~/Library/Developer/CoreSimulator du -sh ~/.npm ~/Library/Caches/Homebrew ~/.ollama docker system df
Write the numbers down. It keeps the clean-up focused on what is actually big on your Mac.
Xcode
- DerivedData (
~/Library/Developer/Xcode/DerivedData): build products and indexes. Everything in it is safe to delete; the next build takes longer because Xcode starts from scratch. You can remove one project's folder instead of all of it. - Unavailable simulators: run
xcrun simctl delete unavailableto remove simulators for runtimes you no longer have. - iOS DeviceSupport (
~/Library/Developer/Xcode/iOS DeviceSupport): debug symbols for each iPhone or iOS version you have connected. Old versions can go, but Xcode copies them again only from a device still running that version, and you need them to read crash reports from it. - Archives (
~/Library/Developer/Xcode/Archives): see What to keep.
Docker
docker system df shows how much space images, containers, volumes and build cache use. Then:
docker system pruneremoves stopped containers, networks not used by any container, dangling images and unused build cache.- Add
-ato also remove every image not used by a container. You will download them again next time. - Volumes are kept unless you add
--volumes. Volumes often hold database data, so check before you add it.
node_modules and npm
- node_modules in projects you no longer work on can be deleted.
npm installbrings them back frompackage.jsonand the lock file. - The npm cache lives in
~/.npm. npm's own docs say clearing it is usually unnecessary because the cache is self-healing, which is whynpm cache clean --forceneeds the force flag. Clear it only to get the space back.
Homebrew and pip
- Homebrew removes old versions when you upgrade and runs extra cleanup every 30 days. Its download cache is usually
~/Library/Caches/Homebrew;brew cleanupclears what it no longer needs. - pip:
pip cache dirshows where the cache is andpip cache purgeremoves everything in it.
Local AI models
- Ollama keeps models in
~/.ollama/models. Runollama list, thenollama rm model-namefor the ones you don't use. - Hugging Face downloads go to
~/.cache/huggingface.
A single model can be several gigabytes, so on an AI workstation this is often the biggest single win.
What to keep
- Xcode archives of builds you shipped. They are what you need to read crash reports from that version. Delete only archives of builds you never released.
- Docker volumes with data you care about.
- Anything you can't rebuild: local databases, generated datasets, model fine-tunes.
Where Tidymint helps
Tidymint is a free, open-source Mac cleaner. For developers it:
- lists the npm cache and your user caches (including Homebrew and pip) in Clean Now, grouped and explained before you press Clean;
- clears
_to_deleteand_tmpfolders inside the project folders you add in Settings; - shows plain notes in Space Lens for folders like DerivedData, CoreSimulator, node_modules, iOS DeviceSupport,
.ollamaand Hugging Face, so you know what a big bubble is before you act; - checks your project folders before removing duplicate files a script still uses.
It does not run docker or xcrun commands for you. Everything you select always goes to the Trash first.
Doing it by hand vs. Tidymint
| By hand | Tidymint | |
|---|---|---|
| Speed | Open hidden folders one by one, type Terminal commands | One scan, results grouped by size |
| The big picture | You see one folder at a time | Space Lens shows the whole drive and the heaviest folders |
| Understanding your Mac | Cryptic folder names like Caches and DerivedData | Plain-language notes for common folders |
| No accidental deletes | A wrong delete is gone for good | Safe items pre-selected, the rest left to you, always to the Trash first, with Undo |
| Cost | Free, but it takes time | Free and open source |
Clean your Mac for free
Tidymint is free and open source. Everything always goes to the Trash first, so you stay in control.
FAQ
Is it safe to delete DerivedData?
Yes. Xcode rebuilds it. Your next build takes longer, and deleting it is also a common fix for odd build errors.
Does docker system prune delete my volumes?
No. Volumes are kept unless you add --volumes. By default it removes stopped containers, unused networks, dangling images and unused build cache.
Can I delete node_modules?
Yes, in projects you are not working on. Running npm install in the project brings the folder back.
Should I clear the npm cache?
Only to reclaim space. npm's documentation says the cache is self-healing, so clearing it rarely fixes anything.
Does Tidymint delete Xcode or Docker data?
Only what you choose. Clean Now lists Xcode build data (DerivedData) per project, never pre-selected. System Data lists Xcode build files, simulator caches and old device support files, none pre-selected. Xcode archives are never offered: keep them for crash reports. Tidymint does not run Docker or Xcode commands, and everything goes to the Trash first.
Doing it by hand vs. Tidymint
| By hand | Tidymint | |
|---|---|---|
| Speed | Open hidden folders one by one, type Terminal commands | One scan, results grouped by size |
| The big picture | You see one folder at a time | Space Lens shows the whole drive and the heaviest folders |
| Understanding your Mac | Cryptic folder names like Caches and DerivedData | Plain-language notes for common folders |
| No accidental deletes | A wrong delete is gone for good | Safe items pre-selected, the rest left to you, always to the Trash first, with Undo |
| Cost | Free, but it takes time | Free and open source |
Clean your Mac for free
Tidymint is free and open source. Everything always goes to the Trash first, so you stay in control.
Sources
- Docker docs: docker system prune
- Docker docs: Prune unused objects
- npm docs: npm cache
- Homebrew FAQ
- pip docs: pip cache
- Ollama FAQ: where models are stored
- Apple Developer: Acquiring operating system symbol information
- Apple Developer: Building your app to include debugging information
- Kodeco: Understanding and managing Xcode space