1. Know the three folders
JetBrains’ documentation lists where IntelliJ IDEA keeps its files on macOS, and PyCharm, WebStorm and the other IDEs follow the same pattern with their own product names. Configuration and plugins go in ~/Library/Application Support/JetBrains, caches in ~/Library/Caches/JetBrains, and logs in ~/Library/Logs/JetBrains, each in a subfolder named after the product and version, such as IntelliJIdea2026.2.
Every major version gets a new set of folders. That is why a Mac that has run several releases can hold caches for IDE versions that are no longer installed. Plugins sit in a plugins subfolder of the configuration folder, so they move and age with it. Measure each location to see where the space is.
du -sh ~/Library/Caches/JetBrains/* | sort -h
du -sh ~/Library/Logs/JetBrains/*
du -sh "$HOME/Library/Application Support/JetBrains/"*2. Invalidate caches for the IDE you use
In the IDE, choose File → Invalidate Caches. The dialog offers optional extras: clearing the file system cache and Local History, clearing VCS Log caches and indexes, and deleting the embedded browser’s cache and cookies. If the menu item is hard to find, Find Action, Command-Shift-A in the default macOS keymap, locates it by name. Click Invalidate and Restart. The caches are removed when the IDE restarts, and it indexes your projects again when you open them.
Local History is not deleted unless you tick that option. Invalidate Caches is mainly a fix for broken indexing or odd editor behaviour; for space alone the saving is modest, because the current version rebuilds its indexes straight away.
3. Remove leftovers from old versions
JetBrains’ documentation says that when you install a new major version, the IDE automatically deletes the caches and logs folders of older versions that have not been updated in the last 180 days. Configuration and plugin folders are kept. To review leftovers yourself, choose Help → Delete Leftover IDE Directories.
If you prefer Finder, quit the IDE and move the Caches and Logs subfolders for versions you no longer have installed to the Trash. Be more careful with the matching Application Support folders: a new version imports settings from the previous one, so keep at least the latest older set until you are happy with the upgrade.
4. Toolbox App: previous versions and downloads
If you install IDEs through the Toolbox App, it keeps the previous version of each tool by design so you can roll back instantly. In Toolbox settings, the Tools section has a toggle called Keep previous versions of tools to enable instant rollback, with an option to remove the previous versions to save space. Removing them means you can no longer roll back instantly, so wait until the new version has worked for a while.
The same section offers Clean up leftover tool directories and Clear download cache, each showing how much space it would free. The leftover view groups directories by the tool that created them and sorts them by modification date. On macOS, Toolbox installs the IDEs themselves in ~/Applications.
What not to remove
The cache folder for the version you use also holds Local History, the IDE’s own record of recent changes to your files, which is separate from git. Deleting that folder by hand removes it, and deleting it while the IDE is running can leave indexes in a broken state. If a disk scanner groups this folder with other application caches, remember what it contains and use the IDE’s commands instead.
Application Support holds your settings, keymaps and installed plugins, so treat it as configuration rather than cache. Android Studio stores its files under a Google folder instead of JetBrains; the Android Studio guide covers those.
Common questions
Does Invalidate Caches free up a lot of disk space in JetBrains IDEs?
Not much on its own. It is mainly a fix for broken indexing or odd editor behavior, and since the current version rebuilds its indexes right after restarting, the space it actually saves is modest.
Why do I have JetBrains cache folders for versions I no longer use?
Every major version creates its own set of cache, config and log folders named after that version, so a Mac that has run several releases can end up holding folders for versions that aren't installed anymore.
Does JetBrains clean up old version folders automatically?
Partly. Installing a new major version auto-deletes caches and logs of older versions untouched for 180 days, but keeps configuration and plugin folders, which you review yourself with Help then Delete Leftover IDE Directories.
Is it safe to delete a JetBrains IDE's current cache folder by hand?
No. It also holds Local History, the IDE's own record of recent file changes separate from git, and deleting it while the IDE is running can leave its indexes in a broken state.
References & further reading
These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.