CleanDevMac
Finds the developer caches, build output and leftover app data filling your Mac's disk, and deletes only what you confirm.
Install
curl -sSL https://github.com/cleandevmac/cdm/releases/latest/download/cdm | bash
CleanDevMac, cdm on the command line, scans a Mac for what development quietly leaves behind. It shows you each item and its size, then removes only what you approve. There’s nothing to install: the script runs straight from the pipe and leaves nothing on the machine when it exits. Add -s -- -n to the command for a dry run that deletes nothing.
It started as part of setup-zsh and grew into its own project.
Lightspot, my Spotlight replacement, runs cdm’s cache scan and its repo scan inside its search panel, with cdm’s own rules and safety checks: type cdm. See Clean Dev Mac in Lightspot.
What it cleans
- Build and package caches: Xcode DerivedData, Go, npm, pnpm, Yarn, Gradle, Maven, Cargo, pip, uv, the Homebrew and PlatformIO download caches and more
- Electron and browser caches for VS Code, Slack, Chrome, Brave, Edge, Arc, Firefox and others
- Project junk such as
node_modules,distandtarget, but only when the repository itself git-ignores it (opt-in with-p) - Docker and Podman leftovers, plus the cache each Docker buildx builder keeps in its own volume, which
docker system prunenever frees. A stopped builder is started for the clean and stopped again (opt-in; named volumes are never deleted) - Support files, caches and preferences from apps you’ve already deleted
When a restart would free more than the disk has left, cdm says so under its disk line: swap, the temp folders macOS empties at boot, and deleted files that apps still hold open. No cleaner can delete these as files. cdm names the apps holding deleted files, since quitting them frees that part without a restart. What a restart frees on a full Mac explains where this came from.
Safety
- Nothing is deleted without an itemised confirmation.
- Caches are removed for good because they rebuild themselves. Orphaned app data and git-ignored files go to the Trash instead.
~/Documents,~/Desktop,~/Downloads,~/Pictures,~/.sshand iCloud Drive are never touched, whatever the rules say..envfiles are never offered for deletion.- No telemetry. The only network request fetches its own cleaning rules.
Support
Found a bug or have an idea? Open an issue on GitHub.