The short answer
- 01
Safe to delete with no Gradle build or daemon running. ~/.gradle/caches holds downloaded dependencies, build caches and transformed artifacts.
- 02
Gradle writes it on every build, including builds Android Studio and IntelliJ run for you.
- 03
Gradle already trims it: about once a day it deletes release caches unused for 30 days and snapshot caches unused for 7.
- 04
The command: gradle --stop, then rm -rf ~/.gradle/caches. The next build downloads dependencies again.
- 05
~/.gradle/daemon holds only daemon registries and logs, and is safe to delete too.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is the ~/.gradle/caches folder?
It is Gradle's on-disk cache, inside the Gradle User Home. Gradle's docs say the Gradle User Home is ~/.gradle by default, set with the GRADLE_USER_HOME environment variable, and that caches holds the caches that speed up repeat builds.
Inside are downloaded modules and artifacts, transformed artifacts, the local build cache and per-version caches. Gradle User Home has other folders with different jobs:
daemon: registry and logs of the Gradle Daemon.wrapper/dists: Gradle distributions downloaded by project wrappers.jdks: JDKs downloaded by toolchain support.init.dandgradle.properties: your global scripts and settings.
What writes it and why does it grow?
Every Gradle build writes to it, whether you run ./gradlew yourself or Android Studio and IntelliJ run it for a sync.
- Per Gradle version: some caches are kept per Gradle version, so each wrapper version a project uses adds its own.
- Every dependency version: each version any project resolves is downloaded and kept.
- Automatic cleanup, with delays: Gradle runs cleanup about once every 24 hours when the daemon stops. It deletes release-version caches unused for 30 days, snapshot-version caches unused for 7 days, shared caches no Gradle version uses, and files in shared caches after 7 days (if recreatable locally) or 30 days (if downloaded).
How big does ~/.gradle/caches get?
It depends on your projects, dependencies and Gradle versions, so there is no normal size. Measure your own:
du -sh ~/.gradle/caches ~/.gradle/daemon ~/.gradle/wrapper/dists
Prints the size of each part. Removes nothing.
du -sh ~/.gradle/caches/* | sort -h
Lists what inside the caches is largest, including per-version folders for Gradle versions you no longer use.
Is it safe to delete ~/.gradle/caches?
Yes, with no build running. It holds downloads and build outputs Gradle can fetch or rebuild.
| What | Verdict | What you lose |
|---|---|---|
~/.gradle/caches | Safe | Downloaded dependencies and cached build outputs. The next build downloads and rebuilds. |
~/.gradle/daemon | Safe | Daemon registries and logs. Stop the daemons first. |
~/.gradle/wrapper/dists | Safe | Gradle distributions. Each wrapper downloads its version again. |
| Deleting during a build or before going offline | Careful | A running build can fail, and Gradle's docs say an --offline build fails when modules are not in the cache. |
gradle.properties, init.d | Never | Your global Gradle settings, which can include repository credentials. |
How do I delete ~/.gradle/caches?
Stop the daemons first, with Gradle's own command:
gradle --stop
Stops running daemons of that Gradle version. Run ./gradlew --stop inside a project to stop its wrapper version. Idle daemons also stop on their own after 3 hours.
rm -rf ~/.gradle/caches
Deletes the caches permanently, without the Trash. Gradle has no command that empties them; its automatic cleanup is the supported trim.
The manual way: quit Android Studio and IntelliJ, then in Finder press Shift+Cmd+G, go to ~/.gradle, and drag caches to the Trash. To change retention instead, Gradle reads cleanup settings from an init script in ~/.gradle/init.d (Gradle 8 and later).
What Hoardless does: its Gradle and Maven detector lists ~/.gradle/caches and ~/.gradle/daemon as Auto tier items and moves them to the Trash after you review the plan, logged in the undo log.
What comes back and when?
On the next build or IDE sync. Gradle downloads the dependencies each project resolves and rebuilds its caches for the Gradle version in use. Caches for Gradle versions no project uses stay gone.
The first build after clearing can take much longer and needs a network. Later builds are as fast as before.
JVM caches, sized and previewed
Hoardless lists ~/.gradle/caches and ~/.gradle/daemon (Auto tier) next to ~/.m2/repository and JetBrains caches, shows each size and moves what you approve to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Does Gradle clean ~/.gradle/caches by itself?
Yes. Gradle's docs say cleanup runs about once every 24 hours, removing release caches unused for 30 days, snapshot caches unused for 7 days, and files in shared caches after 7 or 30 days unused.
Will deleting ~/.gradle/caches break Android Studio?
No, but the next sync and build download every dependency again, which takes time and a network. Builds in offline mode fail until then.
What is ~/.gradle/daemon?
The registry and logs of the Gradle Daemon, one folder per Gradle version. Gradle deletes daemon logs older than 14 days on its own.
Is it safe to delete all of ~/.gradle?
Not blindly. ~/.gradle can hold gradle.properties with your settings or credentials, init.d scripts, and JDKs Gradle downloaded. Delete caches, daemon and wrapper/dists instead.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.