Developer cleanup

Clear node_modules, Xcode and build caches in one go.

Developer Macs fill up with files that tools rebuild on demand: node_modules in every old project, build folders, Xcode DerivedData, simulator caches, Android SDK images and package manager caches. DiskMate finds all of them across your scan, adds them up and lists them under Safe to clear.

Pay once, keep it forever. No subscription, no account.

Storage
136.4 GBfree of 494.38 GB on Macintosh HD

358 GB used. This scan measured 295.0 GB of it in 1,284,902 files.

Developer 96.2 GBVideo 58.4 GBApps 41.7 GBImage 33.9 GBCache & Log 24.1 GBArchive 18.6 GB
Safe to clear
27.4 GB

in 9 places. Apps rebuild these when they need them.

Caches & logs11.8 GB
node_modules8.2 GB
Xcode5.1 GB
Package caches2.3 GB
Worth a look
14.6 GB

in 14 places. Real files you may still want.

Disk images6.2 GB
Large media5.9 GB
Old downloads2.5 GB

Example scan. Names and sizes are illustrative.

What it finds

node_modules

Every node_modules folder in every project you scanned, each with its size. npm install brings them back.

Build output

.next, .nuxt, .turbo, .parcel-cache, .svelte-kit, .angular, __pycache__, .pytest_cache, .mypy_cache and DerivedData, wherever they are.

Project build folders

target, build, dist, out and .build, but only when they sit next to a project file such as package.json, Cargo.toml, pom.xml, build.gradle, pyproject.toml, Package.swift, go.mod, CMakeLists.txt or a Makefile. A folder you happened to name build is left alone.

Xcode

DerivedData, iOS, watchOS and macOS DeviceSupport, and CoreSimulator caches in ~/Library/Developer.

Android

SDK system images, emulator images in ~/.android/avd and ~/.android/cache.

Package caches

~/.npm/_cacache, ~/.pnpm-store, ~/.yarn/berry/cache, ~/.cargo/registry, ~/.m2/repository, ~/.gradle/caches, ~/.cache/pip and ~/.bun/install/cache.

How it works

  1. 1Scan your code folder

    Point DiskMate at ~/Developer, ~/Projects or your whole home folder. Fixed locations like Xcode and package caches are checked on their own.

  2. 2See the totals

    Cleanup shows each category with its size and item count. Open any one to see every folder it found, project by project.

  3. 3Clear what you're done with

    Tick the categories or individual folders and press Clean. They move to the Trash, and your tools rebuild them next time.

Changed your mind? Every step can be undone.

Open the Trash, select what you want and choose Put Back. It returns to the exact folder it came from. Only emptying the Trash deletes for good, and DiskMate labels that button clearly.

TrashPut Back Original folder

Nothing disappears by surprise

  • Your source code, .git folders and project files are never listed.
  • Build folders with common names only count when a project file sits next to them.
  • Cache folders like DerivedData are emptied, not removed, so tools find them where they expect.
  • Everything goes to the Trash first. Restore a folder if a build needs it before you can re-run it.

Prefer to do it by hand?

Each tool has its own clean-up command: npm cache clean --force, pnpm store prune, yarn cache clean, xcrun simctl delete unavailable, docker system prune. For node_modules, you have to find them first.

This lists every node_modules folder under a folder with its size, without deleting anything:

Terminal
$ find ~/Developer -name node_modules -type d -prune -exec du -sh {} + | sort -h
Read-only. Change ~/Developer to wherever you keep your projects.

Questions

Is it safe to delete node_modules?+

Yes. node_modules only holds downloaded dependencies. Running npm install (or pnpm or yarn) in the project downloads them again from your lockfile. Delete them in projects you're not working on right now.

Is it safe to delete Xcode DerivedData?+

Yes. DerivedData holds build output and indexes. Xcode rebuilds it on your next build, which will take a little longer the first time.

What about ~/.m2, Gradle and Cargo caches?+

These are download caches for Maven, Gradle and Cargo. Clearing them is safe; the next build downloads what it needs again, so it will be slower once and needs a network connection.

Does DiskMate find node_modules in every project?+

Yes, in every project inside the folder you scan. Scan your home folder to catch projects anywhere, and each node_modules folder is listed with its size.

Will it touch my source code or git history?+

No. DiskMate only lists dependency folders, build output and caches. Source files, project files and .git folders are never listed for cleanup.

Every tool, one window, one price.
DiskMate is a disk space analyzer, cleaner, duplicate finder and app uninstaller in one Mac app. Everything you remove goes to the Trash first. $5 once, no subscription.
Get DiskMate for $5Pay once · No subscription · Works offline

More in DiskMate