Topic clusters

How to clean developer files on macOS

Developer machines fill up with caches that can be rebuilt. The risk is removing the one you still need today. Preview, Trash, then reinstall.

A Mac that builds software accumulates copies: one node_modules per checkout, a shared npm cache, a Gradle cache, a Cargo registry, and Xcode DerivedData. Smart Clean in Disk Housekeeper is the feature aimed at that set.

The rule underneath every link on this page is the same. Read the path. Confirm the preview. Leave the removal in the Trash until a project you care about still builds or installs.

Separate the project folder from the cache

node_modules belongs to one project and is recreated from the lockfile. The npm cache is shared and stores tarballs. Deleting one does not delete the other. Gradle and Cargo have the same shape: a user-level cache, not your repository.

Xcode is a special case of the same idea

DerivedData is the build cache. The Xcode app is not. Removing DerivedData makes the next build slower and does not remove your source. Do not confirm a preview whose path is the application.

Offline work and the Trash

If the next resolve needs the network and you do not have it, do not clear the cache yet. If you do clear it, the Trash is the default, so you can put a folder back. Empty the Trash after you have proved the reinstall, not before.

Questions

Does Smart Clean know every package manager?

It is described as covering developer caches such as npm, Gradle, and Cargo, plus Xcode DerivedData and node_modules. If a tool is not in that list, do not assume it is included. Read the preview.

Will this break a project permanently?

Not if the lockfile or the source is intact and you can reinstall or rebuild. The Trash is there so you can undo before you empty it. A project without a lockfile is one to leave out of the clean.