DEV Community

Ahmad Mukhtar
Ahmad Mukhtar

Posted on Originally published at deskworthy.app

How to clean a developer Mac without breaking anything

A developer Mac fills up in places macOS lumps together as "System Data". Most of it is safe
to remove. Some of it looks like junk and is not. The question for every folder is the same:
what happens if it is gone? There are three answers.

  • It rebuilds itself. The tool makes it again when needed. You lose time, not data.
  • It downloads again. Safe, but the next install or build needs the network and waits.
  • It is yours. Nothing makes it again. Look before you remove it.

Xcode

What Where If it is gone
Build data ~/Library/Developer/Xcode/DerivedData Rebuilds itself on the next build
Device support ~/Library/Developer/Xcode/iOS DeviceSupport Downloads again when you connect that device
Simulator caches ~/Library/Developer/CoreSimulator/Caches Rebuilds itself
Archives ~/Library/Developer/Xcode/Archives Yours. The builds you shipped, with their debug symbols

Simulators for iOS versions you removed are dead weight. Remove only those:

xcrun simctl delete unavailable
Enter fullscreen mode Exit fullscreen mode

Docker

Docker keeps images, stopped containers, build cache and volumes. The first three come back;
volumes are databases and do not.

docker container prune   # stopped containers
docker image prune       # images no container or tag uses
docker builder prune     # build cache
Enter fullscreen mode Exit fullscreen mode

Never run docker system prune --volumes unless you are sure no volume holds data you need.

node_modules and other project dependencies

node_modules, .venv and similar folders are downloaded again by npm install,
pnpm install or pip install. Removing them from projects you have not touched in months is
the biggest safe win on most JavaScript machines. Leave the ones in projects you are working on
this week, or your next run waits for a full install.

Build output beside a project file (target next to Cargo.toml, dist or build next to
package.json) rebuilds itself. A folder named build with no project file beside it may be
someone's documents.

Package manager caches

All of these download again:

brew cleanup             # old Homebrew downloads and versions
npm cache clean --force  # npm's download cache
pnpm store prune         # packages no project uses any more
Enter fullscreen mode Exit fullscreen mode

Cargo's ~/.cargo/registry/cache, Gradle's ~/.gradle/caches and uv's ~/.cache/uv work the
same way.

AI coding tools

AI tools leave three kinds of things behind, and they are not equally safe.

  • Scratch and cache folders rebuild themselves. Remove a finished session's, never a running one's.
  • Local models (Ollama, LM Studio, Hugging Face) download again, but each one is gigabytes. Remove the ones you stopped using, not the one you use daily.
  • Worktrees are full copies of a repository. One can go only when git status inside it is clean and every commit is pushed or merged. Remove it with git worktree remove so git forgets it too.
  • Session transcripts are yours: they are what lets you resume a conversation. Claude Code deletes old ones by itself after 30 days by default (the cleanupPeriodDays setting). Keep any memory folder next to them; that is what the tool remembers about your projects.

Doing it with an app

Kempt and DiskAtlas sort Xcode data, dependencies, package caches and AI tool folders by the
same three answers (Docker they leave to Docker). They list every item by name and path before
anything moves and send what you choose to the Trash, so any of it can go back. Dependencies
are never ticked for you, a worktree is offered only when git says it is clean and pushed, and
a running AI session is never offered.

First published on deskworthy.app. I make Kempt and DiskAtlas.

Top comments (0)