Xcode and Apple developer
| Folder | Safe to delete? | What it is |
|---|---|---|
~/Library/Developer/Xcode/DerivedData | Safe | Yes, safe to delete. Xcode DerivedData holds indexes, logs and build products that Xcode rebuilds from your source. Where it is and how to clear it. |
~/Library/Developer/Xcode/Archives | Careful | Careful: Xcode Archives hold builds and dSYM files of apps you shipped. Apple says to keep the archive of every build you distribute. Old test archives can go. |
~/Library/Developer/Xcode/iOS DeviceSupport | Safe | Yes, safe to delete. ~/Library/Developer/Xcode/iOS DeviceSupport holds symbols Xcode copied from each iPhone or iPad you connected. Xcode copies them again. |
~/Library/Developer/Xcode/watchOS DeviceSupport | Safe | Yes, safe to delete. watchOS DeviceSupport holds Apple Watch system symbols for debugging and crash reports. Xcode can download them again without the watch. |
~/Library/Developer/CoreSimulator/Devices | Careful | Careful: ~/Library/Developer/CoreSimulator/Devices holds each simulator's apps and data. Delete devices with xcrun simctl, not Finder. Their data is lost. |
~/Library/Developer/CoreSimulator/Caches | Safe | Yes, safe to delete. CoreSimulator Caches holds data the Simulator builds from its runtimes, such as the dyld shared cache. It rebuilds, and no apps live here. |
App caches and system
| Folder | Safe to delete? | What it is |
|---|---|---|
~/Library/Caches | Safe | Yes, one app at a time. Apple says ~/Library/Caches holds data that can be regenerated. Quit the app, clear its folder, and check sizes first with du -sh. |
/Library/Caches | Careful | Careful: /Library/Caches is the system-owned cache folder for every user account. Clear single folders only, never the whole folder. What writes it. |
~/Library/Logs | Safe | Yes, old logs are safe to delete. ~/Library/Logs holds app logs and crash reports you can read in Console. Also covers /Library/Logs and DiagnosticReports. |
~/Library/Containers | Careful | Careful: never delete ~/Library/Containers. Each folder is a sandboxed app's private data and settings. Remove a container only for an app you already removed. |
~/Library/Group Containers | Careful | Careful: ~/Library/Group Containers holds data shared by one developer's apps, and macOS never removes it after you uninstall. Delete only for apps you removed. |
~/Library/Application Support | Careful | Careful: never delete ~/Library/Application Support. It holds app data such as browser profiles. Only cache subfolders and removed apps' folders are safe. |
~/Library/Saved Application State | Safe | Yes, safe to delete. ~/Library/Saved Application State stores the windows each app reopens with. Apps just open without their previous windows. How to clear it. |
~/Library/HTTPStorages | Careful | Careful: HTTPStorages holds each app's cookies and HTTP storage, so deleting it can sign apps out. Safe to clear for apps you removed. Here is how to check it. |
~/Library/WebKit | Careful | Careful: ~/Library/WebKit holds web view data per app: cookies, local storage, IndexedDB and caches. Deleting it signs apps out. Here is what is safe to remove. |
~/Library/Application Support/MobileSync/Backup | Careful | Careful: MobileSync/Backup holds your iPhone and iPad backups. Delete old ones in Finder's Manage Backups. Apple says a deleted backup cannot be recovered. |
Docker
| Folder | Safe to delete? | What it is |
|---|---|---|
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw | Careful | No, do not delete Docker.raw by hand: it holds every Docker image, container and volume. Shrink it with docker system prune and Docker Desktop's own settings. |
JavaScript
| Folder | Safe to delete? | What it is |
|---|---|---|
~/.npm/_cacache | Safe | Yes, safe to delete. Clear the npm cache in ~/.npm/_cacache with npm cache clean --force. npm never prunes it, so it only grows. Projects do not depend on it. |
~/Library/pnpm/store | Safe | Yes, clear it with pnpm store prune, which removes only unreferenced packages. The store is hard-linked into node_modules, so deleting it frees less. |
~/Library/Caches/Yarn | Safe | Yes, safe to delete. ~/Library/Caches/Yarn is the Yarn 1 cache. Clear it with yarn cache clean. Yarn 2 and later keep a separate cache in ~/.yarn/berry. |
~/.bun/install/cache | Safe | Yes, safe to delete. Bun's global package cache in ~/.bun/install/cache (or BUN_INSTALL_CACHE_DIR) clears with bun pm cache rm, and packages download again. |
<project>/node_modules | Safe | Yes, safe to delete in your own projects that have a lockfile. node_modules holds installed dependencies. Reinstall with npm ci or pnpm install. |
Other build tools
| Folder | Safe to delete? | What it is |
|---|---|---|
~/Library/Caches/Homebrew | Safe | Yes, safe to delete. ~/Library/Caches/Homebrew holds downloaded bottles and source archives. brew cleanup -s --prune=all trims it the supported way. |
~/.cargo/registry | Safe | Yes, safe to delete. ~/.cargo/registry holds downloaded crates and ~/.cargo/git holds git dependencies. Cargo downloads both again on the next build. |
~/go/pkg/mod | Safe | Yes, safe to delete. Clear ~/go/pkg/mod with go clean -modcache, because rm -rf fails: Go makes the files read-only. Modules download again on the next build. |
~/.gradle/caches | Safe | Yes, safe to delete with no Gradle build or daemon running. ~/.gradle/caches holds downloaded dependencies and build caches, and Gradle fetches them again. |
~/.m2/repository | Careful | Careful: ~/.m2/repository holds downloaded artifacts and anything you built with mvn install. Downloads come back. Artifacts you only installed locally do not. |
Editors and IDEs
| Folder | Safe to delete? | What it is |
|---|---|---|
~/Library/Caches/JetBrains | Safe | Yes, safe to delete. ~/Library/Caches/JetBrains holds caches and local history per IDE version. Folders for old IntelliJ, PyCharm or WebStorm versions can go. |
~/Library/Application Support/Code/CachedData | Safe | Yes, safe to delete with VS Code quit. Cache, CachedData, GPUCache and CachedExtensionVSIXs in ~/Library/Application Support/Code can all be cleared. |
~/Library/Application Support/Cursor | Careful | Careful: never delete ~/Library/Application Support/Cursor or its state.vscdb. Only the cache folders inside are safe to clear. Here is which ones. |
AI models and agents
| Folder | Safe to delete? | What it is |
|---|---|---|
~/.ollama/models | Careful | Careful: ~/.ollama/models holds every model Ollama pulled. Remove models with ollama rm, not by deleting blob files, because models share layers. |
~/.cache/huggingface | Careful | Careful: ~/.cache/huggingface holds models and datasets you can download again, plus your Hub token. Clean it with hf cache rm and hf cache prune, not rm -rf. |
~/.lmstudio/models | Careful | LM Studio keeps models in ~/.lmstudio/models, one folder per publisher and model. Delete models you no longer use and keep the rest of ~/.lmstudio. |
~/.claude | Careful | Careful: ~/.claude mixes settings and plugins with transcripts, file history and logs. Delete only the data you can name, and see what claude purge does. |
~/.codex | Careful | Careful: ~/.codex holds Codex config, sign-in, sessions and logs. Old sessions and logs can go. Keep config.toml and auth.json or Codex signs you out. |
/private/tmp/claude-<uid> | Careful | Careful: /private/tmp/claude-501 holds Claude Code's task output and scratchpads. Finished sessions' folders can go. Keep any a running session uses. |
~/Library/Caches/claude-cli-nodejs | Safe | Yes, safe to delete. ~/Library/Caches/claude-cli-nodejs holds Claude Code's MCP server logs per project. Old logs can go and Claude Code writes new ones. |
~/.codex/archived_sessions | Careful | Careful, but old ones can go. ~/.codex/archived_sessions holds archived Codex chats as rollout-*.jsonl files and is never pruned. You lose only those chats. |
~/Library/Application Support/Cursor/snapshots | Careful | Careful: quit Cursor first. The snapshots folder holds .pack files, and one version wrote 30 GB in minutes. Nothing you wrote is in it, but it can come back. |
~/.gemini/tmp | Careful | Careful: despite the name, ~/.gemini/tmp holds Gemini CLI chats you can resume, plus logs and checkpoints. Old chats can go. Settings live elsewhere. |
~/.docker/models | Careful | Careful: ~/.docker/models holds models Docker Model Runner pulled. Remove them with docker model rm, not by deleting files. docker system prune skips them. |