- macOS only
- pure bash
- MIT
- zero telemetry
Your Mac is mostly
build cache now.
cdm is short for CleanDevMac — the name you type, and the name of the tool. It is a bash CLI that hunts down developer junk on macOS: DerivedData, node_modules, Go and Cargo caches, Electron blobs, dead app leftovers. It shows you every path and every byte before it touches anything.
curl -sSL https://github.com/cleandevmac/cdm/releases/latest/download/cdm | bash
Dry run — deletes nothing
curl -sSL https://github.com/cleandevmac/cdm/releases/latest/download/cdm | bash -s -- -n
It’s the recommended first run, and the flag most people never stop using.
Every account on this Mac — needs sudo
curl -sSL https://github.com/cleandevmac/cdm/releases/latest/download/cdm | sudo bash
One account after another, each scanned and cleaned by its own user, never by root,
with the same review and the same y. Add -s -- --user NAME to pick accounts.
Read it first — downloads, doesn’t run
curl -fsSL -O https://github.com/cleandevmac/cdm/releases/latest/download/cdm
less cdm && bash cdm -n
Piping a stranger’s script into your shell is a fair thing to refuse. So don’t:
cdm is one bash file, about 3,600 lines, with no dependencies — you can read
the whole thing before you run it, and -n means the first run it does
is a rehearsal. Read the source on GitHub ↗
- Developer caches & build artifacts 14.2 GB
- Project junk, grouped per repo 9.4 GB
- Docker / Podman 6.1 GB
- Electron, browser & app caches 2.8 GB
- Orphaned app data 386 MB
Illustrative scan — the sizes above are an example, not a promise. On a working developer’s
Mac a dry run usually surfaces anywhere from a few hundred MB to many GB. Run
-n to find out what yours holds. Categories are sorted biggest-first, exactly
as the real TUI sorts them.
what cdm finds
Five groups. Each one is a set of rules, and each rule knows whether its target is regenerable — which is what earns it a permanent delete — or irreplaceable enough to go to the Trash instead.
Developer caches & build artifacts
Deleted- Xcode DerivedData
- iOS DeviceSupport
- Go build & module cache
- npm
- npx
- pnpm
- yarn
- Turbo
- Vite
- webpack
- Parcel
- ESLint
- Gradle
- Maven
- sbt / Ivy
- Cargo
- pip
- uv
- poetry
- ruff
- mypy
- Ruby / Bundler
- Bun
- Deno
- CocoaPods
- SwiftPM
- Composer
- Bazel
- Zig
- kubectl
- AWS
- gcloud
- Azure
- wrangler
- Docker buildx
- JetBrains
- Zed language servers
- Playwright
- Homebrew download cache
- PlatformIO download cache
- sccache
- Android Studio
- emulator snapshots
- unused Android system images
- clang module cache
- Node compile cache
The safe, regenerable ones are pre-selected. The ones that cost real time or
bandwidth to rebuild — the Maven repository, Playwright browsers, Android
system images — start unchecked. You opt in, not out. In this group an Android image is
only listed when no AVD on your Mac boots from it; one that only long-idle AVDs
boot gets its own row in the next group, which names them. Clang’s module cache and
Node’s compile cache live in your own temp folders under
/private/var/folders — the one place outside your home folder cdm reaches.
Installed SDKs that download again
Opt-in- PlatformIO platforms & toolchains
- Android NDK
- CMake
- SDK sources
- older build-tools & platforms
- idle AVDs’ system images
- extra Rust toolchains
- Rust offline docs
Every row starts unchecked and says how it comes back — the next pio run,
Gradle, or Android Studio’s SDK Manager. An emulator image is offered only when
no AVD that boots it has run in 60 days, and the row names those AVDs. A Rust
toolchain other than your default and stable is removed with
rustup toolchain uninstall, never rm, and the row names any repo
that pins it. Each toolchain’s offline docs (rust-docs, ~0.9 GB apiece) go
the same way, through rustup component remove. sdkmanager, adb, the emulator and PlatformIO’s own
pio are never offered.
Old Claude Code transcripts
To Trash- sessions untouched for 30 days
- subagent transcripts
- tool outputs
Unchecked, and only ever to the Trash. Running sessions, auto memory and your
settings are never touched. Claude Code ages out its own history after 30 days, except
sessions from Claude Desktop and Cowork, which it keeps at any age; cdm prints the key
that changes that — "desktopSessionCleanupPeriodDays": 30 in
~/.claude/settings.json — and never edits the file itself.
Electron, browser & app caches
Deleted- Electron disk cache
- GPU cache
- code cache
- VS Code
- VS Code agent SDK
- Claude
- webview partitions
- Slack
- EasyEDA
- Chrome
- Brave
- Edge
- Vivaldi
- Arc
- Firefox
- leftover Chrome copies
- Sentry
- Crashlytics
- Sparkle
- app-updater payloads
- Claude Cowork VM image
- older Claude Code builds
- Chrome on-device AI models
- aerial wallpapers
Chromium and Firefox caches are handled per profile, so a work profile and a personal profile are separate rows. Crash-reporter and telemetry SDK caches are swept out with them. At every launch Chrome copies its own app into your temp folder and deletes the copy on a clean exit; a crashed or killed browser — under a test script, say — leaves it behind, and cdm clears those, never one a running browser may use. Opt-in: Claude desktop’s ~10 GB Cowork VM image (your VM session data is kept) and the Claude Code builds older than the one it runs, Chrome’s on-device AI models, and the aerial wallpaper videos macOS downloads into every account.
Project junk, per repo
Opt-in- node_modules
- dist
- build
- target
- __pycache__
- git-ignored files
One git repo, one row. Not a pile of anonymous folder paths — so you clean the three projects you finished in 2023 and leave the one you’re mid-branch on. An interactive run always scans your repos, and every row starts unchecked; -y skips them unless you add -p, and never cleans them. Build directories are deleted; other git-ignored files go to the Trash.
Docker / Podman
Opt-in- stopped containers
- unused images
- build cache
- buildx builder caches
Runs system prune -af, and only if you ask for it. Before that, each buildx builder’s cache — which system prune never reaches — is emptied with buildx prune -af; a stopped builder is started for it and stopped again. Named volumes are never deleted — your local Postgres survives.
Orphaned app data
To Trash- Application Support
- Caches
- Preferences
- VS Code
- Cursor
- Zed
- JetBrains IDEs
- Android Studio
- Docker Desktop
- OrbStack
- Postman
- Slack
- ~50 dev apps
Leftovers whose owning app is gone. The installed-app list is read from
LaunchServices, so a prefPane, a plugin or a driver is never mistaken for an
orphan, and an app in the Trash counts as gone. Folders an app keeps under its own name,
like VS Code’s ~/.vscode, come from orphans.json. Folders a
command-line tool also uses (~/.docker, ~/.android, …) and
Docker Desktop’s VM disk get a separate (optional) row, hidden while a command that
uses them is still on your PATH. Everything here goes to the Trash — if cdm guessed
wrong, you put it back.
what cdm will never do
Nothing is deleted without an itemized confirmation.
Not a count. Not a category name. The actual paths, the actual sizes, and which of the three fates each one is headed for — printed on your screen, waiting on a y. A cleanup tool is a program you invite to destroy your own data. That deserves an argument, not a feature list.
Three things can happen to a file. You always know which.
Deleted permanently
Get it back?No — that’s the point. They regenerate.
- Caches — npm, Go, Cargo, pip, Gradle, clang modules, Homebrew downloads
- Build output — DerivedData, dist, target, node_modules
- Leftover Chrome copies — what a crashed or killed browser leaves in your temp folder
- Docker — stopped containers, unused images, build caches (buildx builders’ too)
- Installed SDK pieces, if you tick them — PlatformIO toolchains, older Android build-tools, idle emulator images, extra Rust toolchains and Rust’s offline docs (both removed by rustup): downloaded again when a build needs them
These are deleted permanently, and that is the entire point: they regenerate. Putting 14 GB of DerivedData in the Trash frees nothing.
Moved to the Trash
Get it back?Yes. Open the Trash, put it back.
- Orphaned app data — Application Support, Caches, Preferences, and the folders an app keeps under its own name
- Git-ignored files — the ones that aren’t named build directories
- Old Claude Code transcripts — sessions untouched for 30 days, if you tick them
Anything cdm had to infer was junk goes to the Trash instead of the void. Inference can be wrong. Restore is one ⌘Z away.
Never touched
Get it back?It never left. Protected regardless of any rule, including your own.
- ~/Documents
- ~/Desktop
- ~/Downloads
- ~/Pictures
- ~/.ssh
- iCloud Drive
- App sandboxes, and Apple- or system-owned data — except an uninstalled Docker Desktop’s container, which holds its VM disk and is offered only in an unchecked (optional) row
- Docker named volumes — never deleted; your local Postgres survives
- Anything outside your home folder but what a rule names inside your own temp folders — never another account’s, never the folders themselves
No rule can reach these — not one you wrote, not one you pulled in with
--patterns. The list is enforced below the rules, not by them.
- Zero telemetry. cdm makes no network calls at all, except fetching its own rule JSON. There is no analytics, no phone-home, no opt-out to hunt for, because there is nothing to opt out of. The one thing that reaches outward is
bon the prompt after a clean, which hands the donate link to your browser — nothing is ever sent. - --dry-run shows what could be freed and deletes nothing. It’s the recommended first run, and the flag most people never stop using.
- It is not clever. No heuristics guess at your intent. A path is cleaned because a rule you can open and read says so, or it is not cleaned at all.
- Riskier items start unchecked. Maven repo, Playwright browsers, crash logs, installed SDK pieces, old Claude Code transcripts, project folders, orphaned data and its (optional) rows — all off until you say otherwise.
- Every run is logged to
~/.cleandevmac/clean.log. What ran, what went, what it weighed. - Under sudo, root deletes nothing. Root only stages a copy of cdm and its rules in
/private/tmp, then runs it as each account in turn. Each account’s clean is logged in its ownclean.log, and its Trash items go to its own Trash.
keys, flags, and the log
The interactive run is the whole product: a list you drive with one hand. Categories sorted biggest-first, safe regenerable caches pre-selected, everything else waiting on you. It opens with what your disk looks like — total, used, free — and closes with what it looks like now.
Keys
- ↑ ↓ · j k
- Move the cursor
- space
- Toggle the category under the cursor
- a · s · n
- Select all · only the safe ones · none
- enter
- Show the exact paths and sizes behind a category
- c
- Clean — prints the itemized plan, confirm with y
- q
- Quit, having changed nothing
Then, once a clean has run
- r
- Scan again, and see what is left
- b
- Open the donate link in your browser — b as in buy me a coffee
- q
- Quit — the default, and what every other key does
Flags
- -n
- Dry run — surfaces what could be freed, deletes nothing
- --dry-run
- The same thing, spelled out
- -p
- With -y, also scan your git repos and list their junk — -y never cleans it. Interactive runs always scan them
- --user
- With sudo: only this account. Repeat it for more; leave it out for every account
- --patterns
- Point cdm at your own rules — a directory or a URL
2026-07-15 09:41:02 scan 5 categories · 32.9 GB found
2026-07-15 09:41:44 confirm 2 categories · 17.0 GB · plan accepted
2026-07-15 09:41:44 delete ~/Library/Developer/Xcode/DerivedData · 6.4 GB
2026-07-15 09:41:51 trash ~/Library/Application Support/Postman · 168 MB
2026-07-15 09:42:03 done 17.0 GB reclaimed · 0 errors
Every run, appended. If cdm removed it, there is a line saying so.
ls rules/
There is no hidden list. Every category cdm knows about is described by a JSON rule file. Add a target, drop one you don’t like, or fork the set entirely — no code changes.
- index.jsonthe manifest
- dev-caches.jsondev caches
- app-caches.jsonapp caches
- containers.jsondocker
- project-junk.jsonrepos
- orphans.jsonorphans
dev-caches.json — one rule, unedited{
"icon": "🔨",
"name": "Xcode derived data & device support",
"method": "rm",
"default": true,
"desc": "Xcode build cache, device-support & documentation
cache — rebuilt on next build.",
"paths": [
"~/Library/Developer/Xcode/DerivedData",
"~/Library/Developer/Xcode/iOS DeviceSupport",
…
]
}
method decides the fate — rm for things that regenerate,
trash for things you might want back. default decides whether it
arrives pre-selected, and desc is the why the tool prints next to it.
An optional procs list names the apps that rewrite those caches while running, so
cdm can tell you to quit them first. A few rules set a kind and let the script work
out what they offer: android-images drops any system image an AVD still uses,
older-versions keeps the newest of each family, rust-toolchains
and rust-docs remove through rustup, code-sign-clones keeps any
copy a running browser may use, and claude-transcripts only ever moves to the
Trash. They take their globs from images or candidates, never
paths, so a cdm too old to know the kind offers nothing. A path may start
with @cache/, @temp/ or @boot-temp/ instead of
~/ — your own temp folders under /private/var/folders.
Nothing in a rule file can reach the protected paths. Point cdm at your own set with
--patterns <dir-or-url> and it will use yours instead.