JetBrains Caches on Mac (IntelliJ, WebStorm, PyCharm)
JetBrains IDEs like IntelliJ IDEA, WebStorm, and PyCharm keep several multi-gigabyte directories on a Mac, and only some of them are safe to clear. Caches and indexes rebuild on the next launch; configuration, plugins, and project data do not. The difference is what keeps a cleanup from turning into lost settings or a broken project.
This page is the JetBrains-specific companion to the general dev-caches guide. It
uses "Mole" only for Mole for Mac at mole.fit and its own mo command line tool,
and it does not quote per-IDE gigabyte figures, because they vary too much to be
useful; you measure on your own machine.
What JetBrains stores, and what is not just cache
A JetBrains install is several directories with very different recovery costs. Treating them as one folder is where cleanups go wrong.
| Layer | What it holds | Rebuildable? |
|---|---|---|
| Caches | Compiled search data and temporary work files | Yes, on next launch |
| Indexes | The project index the IDE builds to navigate code | Yes, by re-indexing |
| Logs | Diagnostic text for troubleshooting | No, but disposable once you are done troubleshooting |
| Config and settings | Keymaps, code style, preferences | No; this is your setup |
| Plugins | Installed plugins and their data | Partly; reinstalling loses local plugin state |
| Project data | .idea folders and Local History |
No; this is project and personal work |
Caches and indexes rebuild themselves. Logs do not come back, but you can discard them once you are done troubleshooting. The last three are your setup and your work, and they are not cache no matter which folder they sit in.
Prefer the IDE's own tools
Before deleting any folder, use the IDE's built-in path. File › Invalidate Caches clears the caches and indexes and offers to restart, which is the supported way to fix a stale index without touching settings. Confirm the exact menu wording in your current IntelliJ, WebStorm, or PyCharm version, since menu labels shift between releases.
Old versions are usually where most of the space sits. Each major IDE version keeps its own set of folders, and upgrading leaves the previous set behind. Help › Delete Leftover IDE Directories… looks for settings, cache, and log directories from previous IDE versions and lets you choose which to delete; versions that are still installed start unselected. Current IntelliJ Platform builds also run part of this cleanup on their own about a week after an upgrade: for versions unused for 180 days, they delete the system folder (caches, indexes, and that version's Local History) and the logs, and keep settings and plugins.
Quit the IDE before you review any folder by hand, so you are not deleting files the running process still holds open.
Finding the system directory on Mac
JetBrains documents its directory locations per version, and the exact
product-and-version subfolder differs on every machine, so locate yours through
the IDE (Help › Show Log in Finder opens the log folder) rather than pasting a
stale absolute path. On current versions the parent folders on macOS are
~/Library/Caches/JetBrains and ~/Library/Application Support/JetBrains, with
logs under ~/Library/Logs/JetBrains.
Measure the parents to see where the space actually goes before removing anything:
du -sh ~/Library/Caches/JetBrains ~/Library/Application\ Support/JetBrains ~/Library/Logs/JetBrains
That tells you how much is in the system directory, the configuration directory, and the logs. A "No such file or directory" line only means that folder does not exist on this Mac. The system directory also contains Local History, so its total is not all disposable cache. Application Support holds settings and plugins.
A safe order
- Measure the JetBrains parent folders so you know where the space is.
- Run File › Invalidate Caches, leave its optional Local History removal unchecked, and restart the IDE.
- Measure again once re-indexing finishes. The index is rebuilt, so part of the space comes back.
- For old versions, use Help › Delete Leftover IDE Directories… instead of deleting folders by hand; remove old logs only once you are done troubleshooting.
- Never delete
.ideaor Local History casually; that is project and personal work.
The overlap with package managers and stray node_modules folders belongs to a
different guide: how to clear developer caches on
Mac covers npm, Cargo, pip, and Gradle, and
how to clean up Xcode covers DerivedData if you
also build with Apple's toolchain. An IDE is not a JDK, so removing a runtime is a
separate task in uninstall Java on Mac.
When a disk map helps
Once you know the JetBrains folders are large, a disk map is useful for seeing
which product and version takes the space. Mole's Analyze view shows large
directories with their paths and sizes; scanning is free without a license, and
you decide what to remove. Mole's Clean deliberately leaves
~/Library/Caches/JetBrains, ~/Library/Application Support/JetBrains, and
~/Library/Caches/com.jetbrains.toolbox alone, because they hold Local History
and settings next to the caches, so the IDE's own tools remain the way to clear
them. When you uninstall a JetBrains IDE in Mole, its version-named folders are
listed but not selected, and the same protection keeps the ones under Caches and
Application Support in place; check and remove those yourself if you no longer
need that IDE's settings or Local History.
That is a different job from mo purge, which sweeps project build output and
dependency folders rather than IDE caches, as covered in purge on Mac
explained. For what Mole reviews versus what it
refuses to touch, see is Mole safe.
Further reading
- How to clear developer caches on Mac: the
package-manager and
node_modulesside. - Which Mac caches are safe to delete: the general regenerable-versus-not rule.
- Is Mole safe: what a review-before-delete tool will and will not remove.
FAQ
Will clearing caches delete my projects?
The default Invalidate Caches action does not delete your project files or Local History. Local History lives inside the IDE's system directory, though, and the dialog has a separate option that deletes it. Leave that option unchecked.
Invalidate Caches or deleting the system directory?
Invalidate Caches is the supported path: it clears caches and indexes on restart without removing settings or plugins, and keeps Local History unless you select its removal option. Deleting the whole system directory by hand can erase Local History. Settings and plugins normally live in Application Support, not that system directory.
Multiple IDEs or Toolbox: one cleanup or per product?
Each product and version keeps its own subfolder, so caches accumulate per product and per version. Clear them per product through each IDE, use Help › Delete Leftover IDE Directories… for versions you no longer run, and measure the JetBrains parent folders to see which install is actually large before removing anything.