# Developer caches on macOS you can safely delete

Canonical page: https://shedi.app/guides/developer-caches-macos

Every developer cache on a Mac in one table: exact paths, typical sizes, whether it's safe, whether it comes back, and the official clean command.

By **Otabek Abdiraimov** Updated 28 Oct 2026 14 min read

**Short answer**

On a developer's Mac, most reclaimable space sits in a handful of rebuildable folders: Xcode DerivedData and simulator runtimes, Docker's disk image, `node_modules`, and package manager caches for npm, pnpm, Homebrew, Gradle, Cargo, Go and pip. All of the caches below are safe to clear in the sense that the tool rebuilds or re-downloads them, but use each tool's official clean command where one exists. Never delete the parent folders (`~/.gradle`, `~/.m2`, `~/.cargo`, `~/Library/Developer`) wholesale, because they also hold settings, credentials and installed tools.

For apps that clear these for you, see [the best Mac cleaners for developers in 2026](https://shedi.app/compare/best-mac-cleaner-for-developers).

## Check your Mac in one command

To see which of these caches are on your Mac, and how big they are, before you delete anything, run [diskreceipt](https://shedi.app/guides/diskreceipt). It's a free Terminal tool that prints every developer cache with its size, a safe, check or keep label and the command to clean it. It only reads.

Terminal

```
$ brew install abdiraimov-otabek/tap/diskreceipt
$ diskreceipt
```

## How to read this reference

Each table row is one cache, with:

- **Path**: the default location on macOS. If you've changed it with an environment variable or setting, the tool's "show path" command tells you where yours is.
- **Typical size**: a rough range to tell you whether it's worth looking at. These are estimates, not measurements; yours may be far smaller or larger. Measure with `du -sh `.
- **Safe?**: **Safe** means the tool can rebuild or re-download it with no loss. **Check first** means it's rebuildable but costs something real (a large download, a project setup step) or you might still be using it. **Your files** means it can hold data you can't get back.
- **Comes back?**: whether it refills on its own as you work.
- **Clean with**: the official command where one exists. Where none exists, moving the folder to the Trash with the tool closed is the safe fallback.

Rows marked **(not documented)** are paths I could confirm on a real Mac or from community sources but not in the tool's own documentation. Treat them with a little more care.

To measure everything in one go:

Terminal

```
$ du -sh ~/Library/Developer/Xcode/DerivedData ~/Library/Caches/* ~/.npm ~/.gradle/caches \
$   ~/.m2/repository ~/.cargo/registry ~/go/pkg/mod ~/.cache/* 2>/dev/null | sort -hr | head -25
```

## Apple: Xcode, simulators, Swift and iOS dependencies

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Xcode DerivedData | `~/Library/Developer/Xcode/DerivedData` | 1–30 GB | Safe | Yes, on next build | Quit Xcode, move to Trash; or Product > Clean Build Folder per project |
| Unavailable simulator devices | `~/Library/Developer/CoreSimulator/Devices` | 0.1–3 GB | Safe | No | `xcrun simctl delete unavailable` |
| Simulator runtimes | system-managed disk images (outside your home folder) | several GB each | Check first | Only if downloaded again | `xcrun simctl runtime delete `, or Xcode > Settings > Components |
| iOS / watchOS / tvOS DeviceSupport | `~/Library/Developer/Xcode/iOS DeviceSupport` (and `watchOS`, `tvOS` variants) | 2–5 GB per OS version | Safe for versions you don't debug | Yes, when that device is connected | Move old version folders to Trash |
| Xcode Archives | `~/Library/Developer/Xcode/Archives` | 0.1–2 GB per archive | Your files | No | Window > Organizer > Archives |
| SwiftUI Previews | `~/Library/Developer/Xcode/UserData/Previews` | 0.5–10 GB | Safe | Yes | Move to Trash with Xcode closed (not documented) |
| CoreSimulator caches | `~/Library/Developer/CoreSimulator/Caches` | 0.5–5 GB | Safe | Yes | Move to Trash with Simulator closed (not documented) |
| Swift Package Manager | `~/Library/Caches/org.swift.swiftpm` | 0.1–5 GB | Safe | Yes | `swift package purge-cache`, or File > Packages > Reset Package Caches in Xcode (path not documented) |
| SwiftPM build folders | `.build` inside each package | 0.1–5 GB each | Safe | Yes | `swift package clean` or `swift package reset` in the package |
| CocoaPods download cache | `~/Library/Caches/CocoaPods` | 0.1–5 GB | Safe | Yes | `pod cache clean --all` |
| CocoaPods project pods | `Pods/` inside each project | 0.1–2 GB each | Check first | Yes, with `pod install` | Move to Trash; only if `Podfile.lock` exists and `Pods/` isn't committed |
| Carthage | `~/Library/Caches/org.carthage.CarthageKit` | 0.1–5 GB | Safe | Yes | Move to Trash (not documented) |

Details and commands: [How to clear Xcode DerivedData and old simulators](https://shedi.app/guides/clear-xcode-deriveddata).

Check first

Simulator runtimes and Archives are the two Apple items that don't come back by themselves. A runtime is a multi-gigabyte download; an archive holds the debug symbols you need to read crash reports for that release.

`pod cache clean` refuses to clear everything without `--all`, by design. `swift package purge-cache` is listed in `swift package --help` as "Purge the global repository cache".

**Shedi checks the big ones for you in about 10 seconds** Xcode, Docker, node_modules and the npm, pnpm, Yarn, Homebrew, CocoaPods, SwiftPM, Cargo, Gradle, pip and Go caches, each explained. Docker and Homebrew are cleaned with their own commands.

[Get Shedi](https://shedi.app/#pricing)

## Homebrew

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Downloads cache | `~/Library/Caches/Homebrew` (check with `brew --cache`) | 0.1–5 GB | Safe | Yes | `brew cleanup` |
| Old installed versions | in the Homebrew prefix (`/opt/homebrew` on Apple silicon, `/usr/local` on Intel) | 0.1–5 GB | Safe | No, unless you reinstall them | `brew cleanup` |

Terminal

```
$ brew cleanup -n          # dry run: show what would be removed
$ brew cleanup             # remove old versions and downloads older than 120 days
$ brew cleanup --prune=all # remove all cached downloads, regardless of age
```

Homebrew already runs `brew cleanup` for the packages you install or upgrade, and for everything every 30 days, unless `HOMEBREW_NO_INSTALL_CLEANUP` is set. `brew cleanup -s` also scrubs downloads for the latest versions, but never the downloads of installed formulae or casks.

Why plain `brew cleanup` often frees nothing, and how to clear the whole cache: [Clear the Homebrew cache](https://shedi.app/guides/homebrew-cache-mac).

## JavaScript: npm, pnpm, Yarn, Bun

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| npm cache | `~/.npm/_cacache` | 0.5–5 GB | Safe | Yes | `npm cache verify` (garbage-collects), `npm cache clean --force` |
| npx packages | `~/.npm/_npx` | 0.1–3 GB | Safe | Yes, next time you `npx` | `npm cache npx rm` (npm 11) |
| pnpm store | `~/Library/pnpm/store` (check with `pnpm store path`) | 1–20 GB | Safe | Yes | `pnpm store prune` |
| Yarn 1 cache | shown by `yarn cache dir` | 0.5–5 GB | Safe | Yes | `yarn cache clean` |
| Yarn 2+ global cache | `~/.yarn/berry/cache` | 0.5–5 GB | Safe | Yes | `yarn cache clean --mirror` |
| Bun cache | `~/.bun/install/cache` | 0.2–3 GB | Safe | Yes | `bun pm cache rm` (run inside a project) |
| `node_modules` | inside each project | 0.1–1 GB each | Check first | Yes, with your install command | Move to Trash |

Details, including why deleting `node_modules` in a pnpm project frees less than `du` says: [Delete node_modules safely](https://shedi.app/guides/delete-node-modules).

## Python: pip, Poetry, uv

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| pip cache | `~/Library/Caches/pip` (check with `pip cache dir`) | 0.1–5 GB | Safe | Yes | `pip cache purge` |
| Poetry cache | `~/Library/Caches/pypoetry` | 0.1–5 GB | Safe | Yes | `poetry cache clear --all` (older versions: `poetry cache clear PyPI --all`) |
| Poetry virtualenvs | `~/Library/Caches/pypoetry/virtualenvs` | 0.1–2 GB each | Check first | Yes, with `poetry install` | `poetry env remove ` in the project |
| uv cache | `~/.cache/uv` (check with `uv cache dir`) | 0.5–20 GB | Safe | Yes | `uv cache prune` (unused entries) or `uv cache clean` (everything) |
| Project `.venv` folders | inside each project | 0.1–2 GB each | Check first | Yes, with your install command | Move to Trash |

Notes:

- uv on macOS uses `~/.cache/uv`, not `~/Library/Caches`. Its docs call `uv cache prune` "safe to run periodically"; `uv cache clean` empties the cache entirely. `uv cache size` shows how big it is.
- Poetry's virtualenvs live inside its cache folder by default, so clearing the whole Poetry folder by hand also removes every project's environment. Prefer `poetry cache clear`, which only touches cached packages.

Why a uv `.venv` and uv's cache overlap on disk, and how to find duplicate Pythons: [Python disk space on a Mac](https://shedi.app/guides/python-disk-space-mac).

## Local AI models: Ollama, Hugging Face, LM Studio

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Ollama models | `~/.ollama/models` (or `OLLAMA_MODELS`) | 2–10 GB per model | Check first | Yes, with `ollama pull` | `ollama list`, then `ollama rm ` |
| Hugging Face cache | `~/.cache/huggingface/hub` (or `HF_HOME`, `HF_HUB_CACHE`) | 1–50 GB | Check first | Yes, it downloads again when code loads it | `hf cache ls`, then `hf cache rm `; `hf cache prune` for old revisions |
| LM Studio models | `~/.lmstudio/models` (older: `~/.cache/lm-studio/models`) | 2–10 GB per model | Check first | Yes, from LM Studio's Discover tab | LM Studio's model list |

Notes:

- Ollama models share weight files, so delete them with `ollama rm`, never file by file in `blobs/`.
- Recent `huggingface_hub` versions keep large weights in a shared `blobs` folder and link to them from each model's folder, so deleting a model folder in Finder can leave the weights behind. `hf cache rm` removes both.

Details and every command: [Delete Ollama, Hugging Face and LM Studio models](https://shedi.app/guides/delete-ai-models-mac).

Claude Code, Codex and MCP servers keep their own chats, plugin versions and browser profiles: [Claude Code and Codex disk usage on a Mac](https://shedi.app/guides/ai-coding-tools-disk-space-mac).

## Rust: Cargo

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Registry downloads | `~/.cargo/registry/cache` | 0.1–3 GB | Safe | Yes | Move to Trash (no official command) |
| Extracted crate sources | `~/.cargo/registry/src` | 0.5–5 GB | Safe | Yes | Move to Trash (no official command) |
| Git dependencies | `~/.cargo/git/db`, `~/.cargo/git/checkouts` | 0.1–3 GB | Safe | Yes | Move to Trash (no official command) |
| Project build output | `target/` inside each project | 1–20 GB each | Safe | Yes, on next build | `cargo clean` in the project |

The Cargo Book says that "in theory, you can always remove any part of the cache and Cargo will do its best to restore sources", by re-extracting or re-downloading them. Leave `~/.cargo/bin` alone: that's where `cargo install` puts your tools, and on many setups the Rust toolchain itself is reached through it.

For cleaning every `target` folder at once, Cargo's automatic cache cleaning and the offline docs inside rustup toolchains, see [Rust disk space on a Mac](https://shedi.app/guides/rust-target-folder-disk-space-mac).

Per-project `target/` folders are often bigger than the global cache; they're Rust's equivalent of `node_modules` and DerivedData combined, so check them first.

## Go

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Build cache | `~/Library/Caches/go-build` (check with `go env GOCACHE`) | 0.5–10 GB | Safe | Yes | `go clean -cache` |
| Module cache | `~/go/pkg/mod` (check with `go env GOMODCACHE`) | 0.5–10 GB | Safe | Yes | `go clean -modcache` |
| Test and fuzz caches | inside the build cache | small | Safe | Yes | `go clean -testcache`, `go clean -fuzzcache` |

Go's docs describe the build cache's default as "a subdirectory named go-build in the standard user cache directory", which on macOS is `~/Library/Caches`. Use `go clean -modcache` rather than `rm -rf` or the Trash: Go makes module cache directories read-only by default, so a plain delete fails part-way.

## Java and Kotlin: Gradle and Maven

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Gradle caches | `~/.gradle/caches` | 1–20 GB | Safe | Yes | Let Gradle's automatic cleanup run, or stop daemons and move to Trash |
| Gradle wrapper distributions | `~/.gradle/wrapper/dists` | 0.1–3 GB | Safe | Yes, when a project needs that version | Gradle cleans unused ones after 30 days; or move old versions to Trash |
| Gradle daemon logs | `~/.gradle/daemon` | small to 1 GB | Safe | Yes | Cleaned after 14 days automatically |
| Maven local repository | `~/.m2/repository` | 0.5–10 GB | Safe | Yes | `mvn dependency:purge-local-repository` per project, or move the `repository` folder to Trash |

Gradle's documentation lists automatic cleanup periods: released wrapper distributions 30 days, snapshot distributions 7 days, downloaded resources 30 days, created resources 7 days, build cache entries 7 days, daemon logs 14 days. Cleanup "runs in the background when the Gradle daemon is stopped or shut down". If you delete `~/.gradle/caches` by hand, stop the daemons first:

Terminal

```
$ ./gradlew --stop      # or: gradle --stop
$ mv ~/.gradle/caches ~/.Trash/gradle-caches
```

Check first

Don't trash `~/.gradle` or `~/.m2` as a whole. `~/.gradle/gradle.properties` and `~/.m2/settings.xml` often hold repository credentials and signing settings that aren't stored anywhere else.

## Android

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Emulator system images | `~/Library/Android/sdk/system-images` | 1–4 GB each | Check first | Only if downloaded again | `sdkmanager --uninstall ""`, or Android Studio's SDK Manager |
| Emulator devices (AVDs) | `~/.android/avd/.avd` | 1–10 GB each | Your files | No | `avdmanager delete avd -n `, or Android Studio's Device Manager |
| Old SDK platforms and build-tools | `~/Library/Android/sdk/platforms`, `build-tools` | 0.1–1 GB each | Check first | Only if downloaded again | `sdkmanager --uninstall ""` |
| Gradle caches | see Gradle above | | | | |

`~/Library/Android/sdk` is Android Studio's default SDK location on macOS; Android Studio's SDK Manager shows where yours is. An AVD holds the emulator's data, including apps and anything you set up inside it, so treat it as yours.

## Editors and IDEs

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| JetBrains caches | `~/Library/Caches/JetBrains/` | 0.5–10 GB per IDE version | Safe | Yes, after re-indexing | File > Invalidate Caches in the IDE; Help > Delete Leftover IDE Directories for old versions |
| JetBrains logs | `~/Library/Logs/JetBrains/` | small | Safe | Yes | Move to Trash |
| VS Code caches | `~/Library/Application Support/Code/Cache`, `CachedData`, `Code Cache`, `GPUCache` | 0.1–1 GB | Safe | Yes | Quit VS Code, move to Trash (not documented) |
| VS Code extension downloads | `~/Library/Application Support/Code/CachedExtensionVSIXs` | 0.1–1 GB | Safe | Yes | Quit VS Code, move to Trash (not documented) |
| Cursor caches | same folder names under `~/Library/Application Support/Cursor` | 0.1–1 GB | Safe | Yes | Quit Cursor, move to Trash (not documented) |

JetBrains documents that installing a new major version of an IDE "automatically deletes the caches and logs directories for older versions of the IDE that have not been updated in the last 180 days", while the configuration and plugins directories "will remain forever, unless you remove them manually".

Check first

For VS Code and Cursor, clear only the cache folders named above. The same parent folder holds `User` (your settings, keybindings and snippets), `Backups` (unsaved files) and workspace storage. Your installed extensions are in `~/.vscode/extensions` and `~/.cursor/extensions`; those aren't a cache.

## Containers and browsers for testing

| Cache | Path | Typical size | Safe? | Comes back? | Clean with |
| --- | --- | --- | --- | --- | --- |
| Docker images, containers, build cache | inside `~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw` | 5–60 GB | Check first | Yes, when pulled or rebuilt | `docker system df`, then `docker image prune -a`, `docker container prune`, `docker builder prune` |
| Docker volumes | inside the same disk image | varies | Your files | No | `docker volume rm ` after checking |
| Playwright browsers | `~/Library/Caches/ms-playwright` | 0.5–2 GB | Safe | Yes, with `npx playwright install` | `npx playwright uninstall --all` |
| Puppeteer browsers | `~/.cache/puppeteer` | 0.2–2 GB | Safe | Yes, on next install | `npx @puppeteer/browsers clear` |
| Electron downloads | `~/Library/Caches/electron` | 0.1–1 GB | Safe | Yes | Move to Trash |
| electron-builder downloads | `~/Library/Caches/electron-builder` | 0.1–1 GB | Safe | Yes | Move to Trash (not documented) |

Docker details: [Reclaim disk space from Docker on a Mac](https://shedi.app/guides/docker-disk-space-mac). Playwright's docs show each browser taking "a few hundred megabytes", and Playwright already removes browser versions no installed Playwright needs any more. `npx playwright uninstall` removes the browsers of the current installation; `--all` removes those of every installation.

## What not to delete

- **Parent folders.** `~/Library/Developer`, `~/.gradle`, `~/.m2`, `~/.cargo`, `~/.android`, `~/Library/Application Support/Code`. Each mixes caches with settings, credentials, tools or your data.
- **Docker's Docker.raw** from Finder: it holds volumes too.
- **Anything in /System or /Library** to chase a cache. None of the caches above require it, and the ones that live there (like simulator runtimes) have their own commands.
- **Caches of a running tool.** Quit the IDE, stop the Gradle daemon, stop Docker builds first.

For the non-developer side of a full disk (Photos, iOS backups, Downloads, System Data), see [How to free up space on a Mac without losing anything](https://shedi.app/guides/free-up-space-on-mac).

## A five-minute routine

Terminal

```
# Apple
$ mv ~/Library/Developer/Xcode/DerivedData ~/.Trash/
$ xcrun simctl delete unavailable

# Package managers
$ brew cleanup
$ npm cache verify
$ pnpm store prune
$ go clean -cache
$ pip cache purge

# Docker
$ docker system df
$ docker builder prune
```

Run what applies to you, then measure again. I built Shedi because I was running some version of this list by hand every few weeks; it does the same with an explanation per item and everything that can go to the Trash going there first. If you'd rather keep doing it yourself, this page will stay updated.

## Sources

- [Apple Developer: Downloading and installing additional Xcode components](https://developer.apple.com/documentation/xcode/downloading-and-installing-additional-xcode-components)
- [Homebrew: brew cleanup (man brew)](https://docs.brew.sh/Manpage)
- [npm Docs: npm cache](https://docs.npmjs.com/cli/v11/commands/npm-cache)
- [pnpm Docs: pnpm store](https://pnpm.io/cli/store) and [store settings](https://pnpm.io/settings/store)
- [Yarn Docs: yarn cache clean](https://yarnpkg.com/cli/cache/clean)
- [Bun Docs: global cache](https://bun.com/docs/pm/global-cache)
- [pip Docs: pip cache](https://pip.pypa.io/en/stable/cli/pip_cache/)
- [Poetry Docs: configuration (cache-dir)](https://python-poetry.org/docs/configuration/) and [CLI (cache clear)](https://python-poetry.org/docs/cli/#cache)
- [uv Docs: caching](https://docs.astral.sh/uv/concepts/cache/)
- [The Cargo Book: Cargo home](https://doc.rust-lang.org/cargo/guide/cargo-home.html)
- [Go: cmd/go (go clean, build cache)](https://pkg.go.dev/cmd/go)
- [Gradle User Manual: Gradle directories](https://docs.gradle.org/current/userguide/directory_layout.html)
- [Maven Dependency Plugin: purge-local-repository](https://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html)
- [Android Developers: avdmanager](https://developer.android.com/tools/avdmanager), [sdkmanager](https://developer.android.com/tools/sdkmanager), [emulator command line](https://developer.android.com/studio/run/emulator-commandline)
- [JetBrains: Directories used by the IDE](https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html)
- [VS Code Docs: Uninstall (data folder locations)](https://code.visualstudio.com/docs/setup/uninstall)
- [Docker Docs: Prune unused Docker objects](https://docs.docker.com/engine/manage-resources/pruning/)
- [Playwright Docs: Browsers](https://playwright.dev/docs/browsers)
- [Puppeteer Docs: Configuration](https://pptr.dev/guides/configuration) and [@puppeteer/browsers](https://pptr.dev/browsers-api)
- [Electron Docs: Installation (cache)](https://www.electronjs.org/docs/latest/tutorial/installation)

## Questions

### Which developer caches are safe to delete on a Mac?

Download caches for package managers (npm, pnpm, Yarn, Bun, Homebrew, CocoaPods, SwiftPM, Cargo, Go, Gradle, Maven, pip, Poetry, uv) and build outputs such as Xcode DerivedData are safe: the tool downloads or rebuilds them when needed. Prefer each tool's own clean command, because it knows what's in use.

### What's the safest way to clear a developer cache?

Use the tool's own command (for example brew cleanup, go clean -modcache or pnpm store prune) or move the folder to the Trash with the tool closed. Avoid deleting whole parent folders like ~/.gradle, ~/.m2 or ~/.cargo, which also hold settings, credentials or installed binaries.

### Will clearing developer caches slow me down?

Only once. The next install or build re-downloads or rebuilds what it needs, which costs time and bandwidth, and after that everything is as fast as before.

### Do these caches come back after I delete them?

Yes, nearly all of them refill as you keep working, so clearing them is maintenance rather than a permanent fix. The exceptions are things like simulator runtimes, Android system images and old IDE versions' folders, which only come back if you download them again.

### Why use the tool's command instead of rm -rf?

Some caches have rules a plain delete ignores: Go's module cache is read-only, so rm fails part-way; pnpm's store is shared by hard links; Homebrew keeps downloads for installed versions. The official commands handle those cases and are what the tool's authors test.

## Keep reading

[GuidePython disk space on a Mac: pip cache, uv cache and.venv folders Where pip and uv keep their caches on a Mac, what pip cache purge and uv cache clean really free, why a uv.venv looks bigger than it is, and extra Pythons.](https://shedi.app/guides/python-disk-space-mac)[GuideClaude Code and Codex disk usage on a Mac: what's safe to delete What fills ~/.claude, ~/.codex and the MCP caches on a Mac, which parts clean themselves up, and how to free the rest without losing chats you still need.](https://shedi.app/guides/ai-coding-tools-disk-space-mac)[GuideClear Xcode DerivedData, simulators and old runtimes What Xcode's DerivedData, simulators, runtimes, DeviceSupport and Archives are, which are safe to delete, and the exact commands to reclaim the space.](https://shedi.app/guides/clear-xcode-deriveddata)
