Home › Clean developer files on Mac

Xcode, Docker, node_modules: cleaning developer files on Mac

Updated: October 29, 2026 · 8 min read

Quick answer

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 unavailable to 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 prune removes stopped containers, networks not used by any container, dangling images and unused build cache.
  • Add -a to 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 install brings them back from package.json and 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 why npm cache clean --force needs 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 cleanup clears what it no longer needs.
  • pip: pip cache dir shows where the cache is and pip cache purge removes everything in it.

Local AI models

  • Ollama keeps models in ~/.ollama/models. Run ollama list, then ollama rm model-name for 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_delete and _tmp folders inside the project folders you add in Settings;
  • shows plain notes in Space Lens for folders like DerivedData, CoreSimulator, node_modules, iOS DeviceSupport, .ollama and 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 handTidymint
SpeedOpen hidden folders one by one, type Terminal commandsOne scan, results grouped by size
The big pictureYou see one folder at a timeSpace Lens shows the whole drive and the heaviest folders
Understanding your MacCryptic folder names like Caches and DerivedDataPlain-language notes for common folders
No accidental deletesA wrong delete is gone for goodSafe items pre-selected, the rest left to you, always to the Trash first, with Undo
CostFree, but it takes timeFree 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 handTidymint
SpeedOpen hidden folders one by one, type Terminal commandsOne scan, results grouped by size
The big pictureYou see one folder at a timeSpace Lens shows the whole drive and the heaviest folders
Understanding your MacCryptic folder names like Caches and DerivedDataPlain-language notes for common folders
No accidental deletesA wrong delete is gone for goodSafe items pre-selected, the rest left to you, always to the Trash first, with Undo
CostFree, but it takes timeFree 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

Read next

↑ Back to top
Tidymint

Free, open-source Mac cleaner. Official site: tidymint.app, downloads only from GitHub.

Product

FeaturesHow it worksInstallChangelogReleasesSponsor

Guides

Install step by stepMac keeps filling upClear System DataAdobe taking up spaceFree up space on MacCleanMyMac alternativeReport a bug

Legal

Safety and transparencyPrivacyMIT Licensehello@tidymint.app