Home › Guides

How to clean up Homebrew and CocoaPods caches

Updated November 24, 2026

Homebrew keeps every package it downloads plus old versions of upgraded tools, and CocoaPods caches every pod version you've installed. Both are safe to clean with their own commands.

Homebrew

See what would be removed Safe

brew cleanup -n

The -n flag is a dry run: it lists old versions and downloads without deleting anything.

Clean up

brew cleanup --prune=all

This removes old versions of installed formulae and casks and all cached downloads (a plain brew cleanup only removes downloads older than 120 days). Installed tools keep working. The cache lives in ~/Library/Caches/Homebrew; brew --cache prints its path.

Remove dependencies nothing uses anymore

brew autoremove

This uninstalls packages that were only installed as dependencies of something you've since removed. Check the list it prints; if you use one of those tools directly, reinstall it with brew install.

CocoaPods

Clear the pod cache Safe

pod cache list
pod cache clean --all

The cache is in ~/Library/Caches/CocoaPods. Pods are downloaded again the next time you run pod install.

Remove the old specs repo Safe on CocoaPods 1.8+

Older CocoaPods setups cloned the entire specs repository (several GB) into ~/.cocoapods/repos/master. Since CocoaPods 1.8 the default is the CDN, so that clone is usually dead weight:

pod repo list
pod repo remove master

Only remove it if pod repo list shows trunk (the CDN), or your Podfile doesn't reference the old git source.

Project Pods folders

Each project's Pods folder is regenerated by pod install, so it's safe to delete for projects you're not working on — unless your team commits Pods to Git.

How MacDejunk handles these

MacDejunk measures the Homebrew and CocoaPods caches, runs brew cleanup for you, and finds Pods folders inside your projects.

Do it in one click with MacDejunk

MacDejunk is a free Mac app that finds this junk (and the rest of what Xcode, Android, Node, Flutter and Homebrew leave behind), shows what's safe to delete, and frees the space. Everything stays on your Mac.

Download MacDejunk — free