npm cache clean --force # ~/.npm/_cacache rm -rf ~/.npm/_npx # npx one-off installs (this one is huge!) pnpm store prune # pnpm store pip cache purge # ~/.cache/pip yarn cache clean # yarn v1: ~/.cache/yarn
~/.npm/_npx deserves special mention: every npx some-tool leaves a full node_modules tree. AI-agent users hit tens of GB here.
du -sh ~/.npm ~/.cache/pnpm ~/.cache/pip
Don't want to touch the terminal? These do it safely (paid):
CleanMyMac (macOS) — free scan DaisyDisk (macOS) CCleaner (Win/Mac)Sponsored links. We only list tools we'd run ourselves.