An IDE upgrade is an install, not a replacement. JetBrains starts the new version with a new settings, cache and log folder and leaves the old ones, so five years of updates leave five copies of the same caches. VS Code keeps every old version of an extension for a while, and a project you deleted still has its saved state in workspaceStorage. None of it shows up in the app’s own settings, and together it is often 5 to 20 GB.
Measure first. Close the IDE or editor before you delete anything below.
# Mac
du -sh ~/Library/{Application\ Support,Caches,Logs}/JetBrains ~/Library/Application\ Support/Code ~/.vscode 2>/dev/null
# Ubuntu
du -sh ~/.config/JetBrains ~/.local/share/JetBrains ~/.cache/JetBrains ~/.config/Code ~/.vscode 2>/dev/null
JetBrains: one folder per IDE version
Every JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, CLion and the rest) names its folders <Product><year>.<n>, for example IntelliJIdea2025.1 or PyCharm2025.2. Android Studio does the same under Google, as AndroidStudio2025.1.
- Mac:
~/Library/Application Support/JetBrains/,~/Library/Caches/JetBrains/and~/Library/Logs/JetBrains/. - Ubuntu:
~/.config/JetBrains/(settings),~/.local/share/JetBrains/(plugins and data) and~/.cache/JetBrains/(caches and logs). - A Snap or Flatpak build keeps them in
~/snap/<package>/...or~/.var/app/<application id>/....
List the versions and sizes:
ls ~/Library/Caches/JetBrains # Mac
ls ~/.cache/JetBrains # Ubuntu
du -sh ~/Library/Caches/JetBrains/* # Mac, sizes per version
du -sh ~/.cache/JetBrains/* # Ubuntu
A folder of an older version of a product you still use is almost always safe to delete: the IDE copied your settings and plugins into the new version the first time it started. Check that before you delete. Open the newest version, look at your keymap, theme and plugins, then remove the older folders of that product in all three places.
Two things are not versions, so leave them: the Toolbox folder (the JetBrains Toolbox app and the IDE builds it installs) and folders without a year such as IntelliJServer. Toolbox installs IDE builds under Toolbox/apps; remove an old build from the Toolbox window, not by hand.
What you lose by deleting an old version’s folders:
- The settings and plugins of that version. If you ever go back to it, it starts as a fresh install.
- Its caches and indexes. They rebuild, so the first open of a project is slower.
- Local History for that version. It lives in the cache folder and is the only record of unsaved changes, so keep it if you rely on it.
Do not delete the folders of the version you run. To make a misbehaving index start over, use File > Invalidate Caches… inside the IDE instead of deleting its folder.
VS Code and its forks: old extension versions
VS Code, VS Code Insiders, VSCodium, Cursor and Windsurf install extensions into a hidden folder in your home:
| Editor | Extensions folder |
|---|---|
| VS Code | ~/.vscode/extensions |
| VS Code Insiders | ~/.vscode-insiders/extensions |
| VSCodium | ~/.vscode-oss/extensions |
| Cursor | ~/.cursor/extensions |
| Windsurf | ~/.windsurf/extensions |
Each folder is named <publisher>.<name>-<version>, for example ms-python.python-2025.4.0. When an extension updates, the editor installs the new folder and marks the old one in a .obsolete file, to be removed later. In practice the older folders can stay for a long time, and large extensions (language servers, Python, C/C++, remote tools) take hundreds of MB per version.
du -sh ~/.vscode/extensions/* | sort -h | tail -15
ls ~/.vscode/extensions | sort
An old version is a folder with a lower version number than another folder of the same <publisher>.<name>. Keep the highest one, and any folder named in extensions.json in the same directory, which is the list of what the editor will load. Never delete extensions.json or .obsolete. Quit the editor first. To remove an extension completely, use code --uninstall-extension <publisher>.<name> (or the Extensions view) instead of deleting a folder.
VS Code: workspaceStorage of deleted projects
For every folder you open, the editor makes a folder named by a hash in workspaceStorage. It holds that project’s saved state: open tabs, a search index, the workspace database state.vscdb and, in recent versions, the project’s chat sessions. Nothing removes it when you delete the project.
- Mac:
~/Library/Application Support/Code/User/workspaceStorage(replaceCodewithCode - Insiders,VSCodium,CursororWindsurf). - Ubuntu:
~/.config/Code/User/workspaceStorage(likewiseCode - Insiders,VSCodium,Cursor,Windsurf). Snap keeps it in~/snap/code/<revision>/.config/Code/, Flatpak in~/.var/app/com.visualstudio.code/config/Code/.
Each hash folder has a workspace.json that says which project it belongs to. This script lists the folders whose project no longer exists, with their size. It deletes nothing:
cd ~/Library/Application\ Support/Code/User/workspaceStorage # Ubuntu: ~/.config/Code/User/workspaceStorage
for d in */; do
uri=$(sed -n 's/.*"folder": *"file:\/\/\([^"]*\)".*/\1/p' "$d/workspace.json" 2>/dev/null)
[ -n "$uri" ] || continue
path=$(printf '%b' "$(printf '%s' "$uri" | sed 's/%/\\x/g')")
[ -e "$path" ] || { du -sh "$d"; echo " was: $path"; }
done
Run it with bash. Before you delete anything it lists, check the projects: a project on an external drive that is not plugged in, or on a network share, also looks “missing”. Remote projects (vscode-remote://) and workspaces without a folder entry do not show up in this list, which is right: leave them. Deleting a hash folder loses that project’s saved tabs, search history and chat sessions in the editor, but never the project’s files.
Leave User/globalStorage, User/History and User/settings.json: they hold your sign-ins, the local history of edited files and your settings.
Other editor caches
~/Library/Application Support/Code/ (Mac) and ~/.config/Code/ (Ubuntu) also hold Cache, CachedData (compiled code of older editor versions) and CachedExtensionVSIXs (downloaded extension packages). They are rebuilt on demand and are safe to delete while the editor is closed.
How CleanMate does it
CleanMate lists these items in Developer Junk of Smart Scan, with their sizes, on a Mac (all macOS features) and on Ubuntu (all Ubuntu features). Nothing is removed until you confirm, and none of the three items is ticked for you.
- Old IDE versions: the settings, caches and logs of JetBrains IDE and Android Studio versions that have a newer version of the same product, never the newest and never folders without a version such as
IntelliJServer. Each version can be ticked on its own, and the folders go to the Trash, so Undo puts them back. It is skipped while the IDE runs. Ubuntu also reads the Snap and Flatpak builds. Mac: CleanMate 1.5 or later. Ubuntu: 2.1.0 or later. - Old versions of code editor extensions: for VS Code, VS Code Insiders, VSCodium, Cursor and Windsurf (on Ubuntu also the Flatpak builds), one row per extension and editor. The version the editor uses and every folder
extensions.jsonnames are never listed. These are deleted rather than trashed, since the marketplace installs them again, and the item is skipped while the editor runs. Mac: 1.5 or later. Ubuntu: 2.1.0 or later. - Editor data of deleted projects: the
workspaceStoragefolders whose project path no longer exists, one row per project, moved to the Trash. It keeps remote projects, relative paths, folders it cannot read, projects on a drive that is not mounted and anything in your Never-clean list, and never touchesglobalStorage,Historyor your settings. Mac: 1.5 or later. Ubuntu: 2.1.0 or later.
Automatic cleaning leaves the IDE and editor items alone on Ubuntu. If the disk is still full, see Android Studio using too much disk space, Docker using too much disk space and virtual machines and dev infrastructure tools. For the rest of a developer machine, see Free up disk space on a Mac as a developer or on Ubuntu, and old Node, Python, Ruby, Rust and Go versions.
FAQ
Is it safe to delete old JetBrains version folders? Yes, for versions older than the one you run, once the new version has your settings and plugins. You lose that version’s own settings, the indexes (they rebuild) and its Local History.
Why is the JetBrains cache folder so large? It keeps an index of every project you opened with that IDE version, plus logs and Local History, and a new copy starts with each new version.
Can I delete VS Code’s extensions folder? Not the whole folder: you would lose every extension. Remove only older versions of an extension that has a newer folder, or use the Extensions view.
Does deleting workspaceStorage delete my project? No. It holds the editor’s saved state for the project (tabs, search index, chat sessions), not the project’s files.

