CleanMate

All guides · macOS and Ubuntu · Updated

JetBrains and VS Code using too much disk space: old IDE versions, caches, old extensions and workspaceStorage on Mac and Ubuntu

Where IntelliJ IDEA, PyCharm, WebStorm, VS Code, Cursor and VSCodium keep gigabytes on a Mac and on Ubuntu, and how to remove what is safe by hand: old IDE version folders, indexes and caches, old extension versions and the workspaceStorage of deleted projects.

Download for macOS · Install on Ubuntu — free and open source

CleanMate on a Mac after a Smart Scan cleanup of old JetBrains IDE versions and VS Code extensions, showing the space freedCleanMate on a Mac after a Smart Scan cleanup of old JetBrains IDE versions and VS Code extensions, showing the space freed

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.

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:

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.

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.

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.

Skip the commands

CleanMate runs on both systems: pick yours.

Open source — star it on GitHub: CleanMate for macOS · CleanMate for Ubuntu

How CleanMate decides what is safe to remove →