Disk Housekeeper

Clean npm, Gradle, and Cargo caches

These caches exist so the next build does not re-download the world. Remove them only when you can afford the next download.

A developer cache is a copy of something a tool can fetch again: the npm cache, the Gradle cache, and Cargo's downloaded crates. Disk Housekeeper groups them under Smart Clean, together with Xcode DerivedData and node_modules.

They are safe to remove in the narrow sense that the tool can recreate them. They are expensive to remove if you are offline or in a hurry.

Steps

  1. Decide whether the next download is acceptable

    Clearing a cache does not delete your source. It does mean the next npm install, Gradle resolve, or cargo fetch may hit the network and take longer.

  2. Open the preview and separate the three

    npm, Gradle, and Cargo live in different directories. The preview should show you which tool the folder belongs to. Remove one family if you only need one family's space.

  3. Send them to the Trash

    Default behavior is the Trash, after the preview. You can restore a cache folder if a build immediately complains and you would rather not re-download yet.

  4. Read the savings history later

    The history is the record of what this clean returned. Compare it with the menu bar readout. If the readout barely changed, the Trash may still be holding the files.

Before you start

  • Do this on a connection you are willing to use. A full Cargo registry or Gradle cache can be a large download the next time.
  • node_modules is not the npm cache. DerivedData is not the Gradle cache. Uncheck what you did not intend.

Questions

Where do these caches usually live?

Often under the user Library or the home directory: an npm cache path, ~/.gradle/caches, and ~/.cargo. A custom configuration can move them. Use the path in the preview.

Does Smart Clean include all three?

Smart Clean covers developer caches such as npm, Gradle, and Cargo, plus Xcode DerivedData and node_modules. The preview is the list for your machine.