What diskdiet cleans¶
For each source: where diskdiet looks, what it removes, and why that's safe. Everything removed from a cache is downloaded or rebuilt the next time a project needs it.
JavaScript¶
npm¶
- Where:
~/.npmon macOS and Linux,%LocalAppData%\npm-cacheon Windows, or whatevernpm config get cache(ornpm_config_cache) says. - Removes: cached packages and metadata written before the cutoff,
npxinstalls older than it, and old logs. Content still used by a newer entry is kept. - How: diskdiet reads npm's cache index (
_cacache/index-v5) to know when each entry was written, rewrites the index without old entries, then removes content no remaining entry points at.npm cache verifyreports a healthy cache afterwards.
Yarn¶
- Where: Yarn 1's cache (
~/Library/Caches/Yarn/v6,~/.cache/yarn/v6,%LocalAppData%\Yarn\Cache\v6, orYARN_CACHE_FOLDER) and Yarn 2+'s global cache (~/.yarn/berry/cache). - Removes: package folders and zips older than the cutoff.
pnpm¶
- Where: the store (
pnpm store path) and pnpm's metadata cache. - Removes: packages no project uses, by running
pnpm store prune(age doesn't apply), plus metadata older than the cutoff. - Why it works this way: projects'
node_moduleshard-link files from the store, so deleting store files a project uses would free nothing and break it. diskdiet's estimate counts only files with no other links.
Bun¶
- Where:
~/.bun/install/cache(orBUN_INSTALL_CACHE_DIR). - Removes: package folders older than the cutoff.
node_modules¶
- Where: projects under your home folder (or
--projects); hidden folders and~/Libraryare skipped. - Removes: the
node_modulesof projects where nothing at the top level has changed for the cutoff.npm install(orpnpm i,yarn,bun i) brings it back. - Keep one:
--keep ~/code/project/node_modules, or untick it in the app or VS Code.
Python¶
pip¶
- Where:
~/Library/Caches/pip,~/.cache/pip,%LocalAppData%\pip\Cache, orPIP_CACHE_DIR. - Removes: cached downloads and built wheels older than the cutoff.
uv¶
- Where:
uv cache dir(usually~/.cache/uv). - Removes: the whole cache with
uv cache clean, only with--all. uv's entries point at one another, so diskdiet doesn't remove them one by one.
Rust¶
Cargo¶
- Where:
~/.cargo(orCARGO_HOME):registry/cache,registry/src,git/checkouts,git/db. - Removes: downloaded
.cratefiles, unpacked sources and git checkouts older than the cutoff.
target folders¶
- Where: projects with a
Cargo.tomlorpom.xmlunder your home folder. A folder calledtargetanywhere else is never touched. - Removes:
targetof projects untouched for the cutoff;cargo buildormvn packagerecreates it.
Go¶
- Where:
go env GOCACHEandgo env GOMODCACHE. - Removes: build-cache entries not used for the cutoff (Go marks entries when it uses them, so age means last use), and module versions downloaded before it. Read-only module folders are handled.
Java¶
Gradle¶
- Where:
~/.gradle(orGRADLE_USER_HOME). - Removes: downloaded Gradle distributions (
wrapper/dists) and per-version caches and daemon logs older than the cutoff. Gradle's shared dependency cache is left to Gradle, which cleans it itself.
Maven¶
- Where:
~/.m2/repository. - Removes: artifact versions downloaded before the cutoff.
Browser testing¶
Playwright¶
- Where:
ms-playwrightin your cache folder (orPLAYWRIGHT_BROWSERS_PATH). - Removes: older browser revisions. The newest of each browser always stays, so your tests keep running.
Cypress¶
- Where: the Cypress cache (or
CYPRESS_CACHE_FOLDER). - Removes: older Cypress versions; the newest always stays.
Mobile¶
Android SDK¶
- Where:
ANDROID_HOME/ANDROID_SDK_ROOT, or Android Studio's default (~/Library/Android/sdk,~/Android/Sdk,%LocalAppData%\Android\Sdk). - Removes: system images no emulator uses (diskdiet reads every AVD's
config.ini), and NDK and build-tools versions other than the newest, when older than the cutoff. Emulators are never touched. See Android SDK.
CocoaPods¶
- Where: CocoaPods' download cache (
~/Library/Caches/CocoaPods). - Removes: pod versions not changed for the cutoff. Projects'
Podsfolders stay.
Swift Package Manager¶
- Where:
~/Library/Caches/org.swift.swiftpm. - Removes: cached repositories and binary artifacts older than the cutoff.
Apple¶
Xcode simulators (macOS)¶
- Where:
~/Library/Developer/CoreSimulator. - Removes: simulators for runtimes that are no longer installed (with Xcode's own
xcrun simctl delete unavailable, whatever their age) and simulator caches older than the cutoff. Simulators you can still run are never touched.
Xcode (macOS)¶
- Where:
~/Library/Developer/Xcode. - Removes:
DerivedData(build products) andiOS/watchOS/tvOS DeviceSupportfolders older than the cutoff. Archives are never touched.
Homebrew¶
- Where:
brew --cache(~/Library/Caches/Homebrew,~/.cache/Homebrew, orHOMEBREW_CACHE). - Removes: downloaded bottles and source archives older than the cutoff, and the
shortcuts to them. Installed software is never touched;
brewdownloads a bottle again if it needs one.
Docker¶
- Where: your current docker context (Docker Desktop, OrbStack, Colima, Rancher Desktop, Docker Engine).
- Removes: unused images, stopped containers and build cache older than the cutoff,
using Docker's own
prunecommands. Unused volumes only with--volumes. - See Docker details, including why Docker Desktop's disk may not shrink right away.
Missing a cache you'd like diskdiet to know? Suggest it.