Help · Mac storage
How to clear developer caches on a Mac.
Every package manager keeps a cache of what it has downloaded, so installs are faster next time. Most never shrink on their own. Clearing them is safe: things download again when needed, at the cost of a slower next install. Always use the tool's own command; some caches are read-only or self-indexing, and deleting their folders by hand can confuse the tool.
To see which are big, check the paths below in Finder (Go › Go to Folder…) with Get Info, or run du -sh on them in Terminal.
Commands, tool by tool
- Homebrew (
~/Library/Caches/Homebrew):brew cleanupremoves old versions and downloads older than 120 days.brew cleanup --prune=allremoves all old downloads. Add-nto preview first. - npm (
~/.npm):npm cache clean --force. npm's cache heals itself, so this is only for reclaiming space.npm cache verifytidies it without emptying it. - pnpm (
~/Library/pnpm/store):pnpm store pruneremoves packages no project uses. pnpm says it's safe to run now and then. - Yarn:
yarn cache clean. In Yarn 2 and later, add--allto include the shared cache in~/.yarn/berry. - pip (
~/Library/Caches/pip):pip cache purge.pip cache dirshows where it is. - uv (
~/.cache/uv):uv cache pruneremoves unused entries;uv cache cleanempties it. uv asks you never to edit its cache by hand. - CocoaPods:
pod cache clean --all. - Gradle (
~/.gradle): Gradle cleans unused cache entries itself after about 30 days.gradle --stopstops background daemons that hold memory. - Cargo (
~/.cargo): recent versions clean the global cache automatically (downloads unused for 3 months). Cargo's docs say any part of its cache can be removed and it will be restored.cargo cleanin a project removes that project'stargetfolder, often the biggest part. - Go (
~/Library/Caches/go-buildand~/go/pkg/mod):go clean -cacheandgo clean -modcache. Use these rather than deleting: the module cache is read-only.
For Xcode's DerivedData, simulators and device support, see clearing Xcode's cache. For Docker, see Docker disk space.
Don't forget project folders
Old projects' node_modules, target, .build and Pods folders can be bigger than any cache. They're rebuilt by an install or build, so for projects you're not working on, they can go.
Find every developer cache, and run the right command.
Pangalin Space Manager finds package caches (npm, pip, Homebrew, Yarn, pnpm, Gradle, Maven, CocoaPods, Cargo, Go, uv and more) with their sizes. It refuses to clear any that hold package files by hand, and points you to the right Janitor, which runs that tool's own clean-up command (including go clean -modcache for Go modules), after a confirmation that says plainly the tool deletes permanently. Janitors need a licence, because the space they free can't be measured in advance.
Free to scan · first 5 GB freed free, then $25 a year · 14-day full refund · Notarised by Apple