Where a Developer's Mac Disk Space Goes, and How to Get It Back Safely

Where a Developer’s Mac Disk Space Goes, and How to Get It Back Safely
Ask an engineering team what slows them down and a full disk rarely makes the list, until the morning a build fails with an error that has nothing to do with the code. A Mac used for app, web or backend work accumulates storage in places most people never open: build products, symbol files, simulator devices, package caches, container images and dozens of forgotten dependency folders. None of it is malicious, and most of it is reproducible, which is exactly why it piles up unnoticed.
This guide walks through the usual suspects, explains why the numbers
from du and Finder can mislead on a modern Mac, separates what is safe
to delete from what costs a rebuild, and shows how
dux, a disk usage app for macOS, approaches the
same problem from the command line and the desktop.
The Usual Places Developer Disk Space Goes
Xcode and Apple Platform Tooling
For anyone building for Apple platforms, the Developer folder inside the user Library is usually the largest single consumer. A few locations do most of the damage:
- DerivedData at
~/Library/Developer/Xcode/DerivedDataholds build products, intermediate files, indexes and logs, one folder per project. Xcode adds to it on every build and does not prune projects that were opened once and abandoned. - Archives at
~/Library/Developer/Xcode/Archiveskeep every build made with Product > Archive, including the debug symbols (dSYM files) that crash reports are symbolicated with. - Device support files in
~/Library/Developer/Xcode/iOS DeviceSupport(with siblings for watchOS and visionOS) are copied from each physical device you connect, one set per OS version. Every OS update on every test device adds another set. - Simulator devices live in
~/Library/Developer/CoreSimulator/Devices, each with its own installed apps and data. After an Xcode upgrade, devices for runtimes that are no longer installed stay behind as “unavailable”. - Simulator runtimes are large disk images that macOS manages
outside the home folder. They should be removed through Xcode’s
settings or
xcrun simctl runtime, never by deleting files in Finder.
Taken together, these folders commonly reach tens of gigabytes on a Mac that has seen a few Xcode releases.
Package Manager Caches
Every package manager keeps a local copy of what it downloads. On a
typical polyglot machine that means ~/.npm, Yarn’s cache, the pnpm
store, ~/Library/Caches/Homebrew, ~/Library/Caches/pip,
~/Library/Caches/CocoaPods, ~/.gradle/caches, ~/.m2/repository,
~/.cargo/registry and ~/go/pkg/mod. Each one is small on its own
schedule and large in aggregate. Machine learning work adds downloaded
models under ~/.cache/huggingface and ~/.cache/torch.
Project Folders: node_modules and Friends
Dependency folders are tied to the project, not shared. Ten JavaScript
projects mean ten node_modules folders, each with its own copy of the
toolchain. The same pattern applies to target in Rust projects, Pods
in iOS projects, .venv in Python projects and build caches such as
.next, .nuxt, .turbo and .parcel-cache. Projects end, but their
folders stay.
Containers
Docker Desktop stores every image, container, volume and build cache
inside a single disk image under ~/Library/Containers/com.docker.docker.
From the outside it looks like one enormous file, so neither Finder nor a
generic disk tool can say what is inside. Docker’s own docker system df
can.
Why du and Finder Numbers Mislead on APFS
The classic first move is du -sh on a suspicious folder. It is a good
habit, but on APFS the result answers a slightly different question than
“how much space would I get back?”
File size and space on disk are not the same thing. A file’s length in bytes can differ from the blocks it occupies. Sparse files are the clearest example: Docker’s disk image has a maximum size that Finder may report, while the space actually written to it is often much smaller.
Clones share storage. When a file is duplicated on APFS, the copy is a clone that shares blocks with the original until one of them changes. Tools that walk the file tree see two full files and count both. Deleting a clone frees almost nothing, even though the folder looked large.
Hard links have the same effect. Several names can point at one copy of the data. Removing one name frees no space. Tools like pnpm rely on this deliberately, which makes individual project folders look bigger than they are.
Snapshots hold on to deleted data. Local APFS snapshots keep files on disk until the snapshot itself goes, which is why deleting a large file does not always change the free space figure right away.
Permissions hide folders. Without Full Disk Access, Terminal cannot
read some protected folders, so a du total on ~/Library is a minimum
rather than the truth.
The practical lesson: a large number tells you where to look, not how much a deletion will actually free.
What Is Safe to Delete, and What Costs You
The useful distinction is not “safe or unsafe” but “what does it cost to get back?”
Safe, with a small rebuild cost:
- DerivedData. Everything in it is regenerated; the price is a slower first build and some indexing time. Quit Xcode first.
- Device support files for OS versions you no longer debug on. Xcode copies them again the next time a device with that version connects.
- Package caches for npm, Yarn, pnpm, Homebrew, pip, CocoaPods, SwiftPM,
Cargo and Go. Nothing in a cache is the only copy; the cost is network
time. Prefer each tool’s own command (
brew cleanup,pnpm store prune,go clean -modcache) over deleting folders by hand. - Web build caches of idle projects, which the next build recreates.
Worth a review first:
- Old Xcode archives. Keep the ones for releases still in use, because their symbols are what make crash reports readable.
- Unavailable simulators.
xcrun simctl delete unavailableremoves only devices whose runtime is gone, but it cannot be undone. node_modulesand similar folders in idle projects. A lockfile brings them back with one install, but that needs time and a connection.- Gradle, Maven and downloaded ML models. They return, after a slow first build or a long download.
Handle inside the tool only:
- Docker data. Prune through Docker, one type at a time, and look at volumes before removing any, since a volume may hold a local database that exists nowhere else.
- Simulator runtimes, through Xcode’s settings or
xcrun simctl runtime.
How dux Approaches the Problem
dux (short for Disk Usage eXtended) is a macOS app
built around the question that comes after du: of these gigabytes,
which rebuild on their own, which are clones that free nothing, and what
happens if they go?
Ranked by the Space Truly Freed
Rather than listing folders by apparent size, the app ranks suggested cleanups by the space each one would really release. Clones count once, hard links are explained instead of promised as free space, and online-only cloud files are never counted as reclaimable. A clone that looks like several gigabytes but shares most of its blocks is reported at its private size.
Safety Levels and Review
Every suggestion carries a safety level: safe, review or risky. Items in the review and risky groups are never preselected, and risky groups each need their own explicit confirmation. Before anything moves, a review sheet lists what will happen item by item. Files go to the Trash or become APFS clones; the app does not empty the Trash for you, so emptying it stays a deliberate step.
When a system tool does the job better than moving files, as with
xcrun simctl delete unavailable or brew cleanup --prune=all, the app
shows the exact command and states whether it can be undone before
running anything. Those tool commands run only in the direct download,
not in the sandboxed Mac App Store build. Docker’s disk image is shown
with its size but never touched. The
developer page lists the rules for
Xcode, package caches, idle project folders and more, each with its
safety level.
Undo
An Activity log records every cleanup, and Undo puts items back where they were as long as they are still in the Trash. The privacy and safety page spells out the two kinds of action that cannot be undone: tool commands and removed cloud downloads.
The dux Command Line
For people who live in Terminal, dux ships a command line tool with the direct download, installed from the app’s Settings. The simplest command lists ranked cleanups for a folder and changes nothing:
~ % dux suggest ~/Library/Developer --top 3
3 suggestions, up to 54.4 GB reclaimable
Size Safety Rule Title
38.2 GB safe xcode.derived-data Xcode build files
9.4 GB safe xcode.device-support Xcode device support files
6.8 GB review xcode.archives Old Xcode archives
The Rule column matters for automation. Rule IDs feed into a cleanup policy, a small JSON file that a team can keep in a repository and apply with a dry run first:
{
"schemaVersion": 1,
"rules": ["xcode.derived-data", "npm.cache"],
"maxSafety": "safe",
"roots": ["~"],
"minimumBytes": 104857600
}
dux clean --policy team.json --dry-run
Without --dry-run, the tool asks for confirmation in a terminal and
refuses to act unattended unless --yes is passed. Exit codes are
documented (for example, 3 means blocked by policy and 4 means the
feature is not in your plan), which makes the command predictable in
scripts.
Plans are straightforward. The app is free, including suggestions,
review, undo and the command line’s text output. Pro (€9.99 per year or
€29.99 once, for up to five Macs) adds JSON and CSV output, cleanup
policies and bulk cleanup of build folders across projects. Business adds
fleet reporting through dux report for Intune and Jamf. Details are on
the pricing page. The app requires macOS 15
or later.
A Routine a Team Can Adopt
Disk hygiene works best as a light, shared habit rather than a panic response:
- After every major Xcode update, clear DerivedData and remove unavailable simulators.
- Once a month, run a read-only check such as
dux suggest ~ordocker system df, and act on the two or three largest items. - Once a quarter, review archives, device support folders for old OS versions and the dependency folders of projects nobody has touched.
- Prefer gentle commands (
brew cleanup,pnpm store prune,docker builder prune) over full cache wipes, so the next build stays fast. - Write the rules down. A shared cleanup policy limited to safe rules
and always run with
--dry-runfirst gives everyone the same definition of “safe to clear”.
The Takeaway
Most of the space on a developer’s Mac is not lost, it is parked: caches
and build output that come back on demand, mixed with a few things that
do not, such as release archives and Docker volumes. The work is telling
the two apart and measuring what a deletion really frees on APFS. du
remains a fine first look. For the next step, the
Xcode cleanup guide on usedux.app
covers each folder in detail, and dux turns that knowledge into a ranked,
reviewable list with an undo button at the end.
About the Author

Aaliyah Thompson
Financial Technology Analyst
Fintech writer and former investment analyst with deep understanding of digital finance and market dynamics. Aaliyah brings a unique perspective on the intersection of technology and finance.