DEV Community

VS Code and Cursor keep old copies of your extensions: where editors hide gigabytes on a Mac

If you use VS Code, Cursor, Windsurf or another VS Code fork on a Mac, a few gigabytes can build up in places the editor never shows you.

Most of it is safe to clear, and some of it the editor would have cleared itself if it had restarted.

1. Old copies of every extension you updated

When an extension updates, the editor installs the new version into a new folder next to the old one. It doesn't delete the old folder right away. It writes the old folder's name into a file called .obsolete in the extensions folder, and deletes everything listed there the next time it starts.

That works if you quit your editor often. If you leave it open for a week, or you have a second editor you rarely open, the old copies stay.

AI extensions make this worse: they update often and many ship native binaries, so each copy can be hundreds of megabytes. On one Mac I looked at, four old copies of a single AI extension added up to 2.8 GB, all marked in .obsolete a week earlier and still on disk.

Each editor keeps its extensions in its own folder:

Editor Extensions folder
VS Code ~/.vscode/extensions
VS Code Insiders ~/.vscode-insiders/extensions
Cursor ~/.cursor/extensions
Windsurf ~/.windsurf/extensions
VSCodium ~/.vscode-oss/extensions

See what's waiting to be deleted, and the biggest folders:

cat ~/.vscode/extensions/.obsolete
du -sh ~/.vscode/extensions/* | sort -h | tail -15

.obsolete is a small JSON object like {"publisher.extension-1.2.3": true}. Every key set to true is a folder the editor has already given up on.

The simplest fix is to quit the editor completely (Cmd-Q, not just closing windows) and open it again. It removes what's listed on its way up.

If you'd rather do it by hand, quit the editor first, then delete only the folders it marked. macOS 15 and later include jq:

cd ~/.vscode/extensions && jq -r 'to_entries[] | select(.value == true) | .key' .obsolete | while read -r d; do case "$d" in ""|.*|*/*) continue ;; esac # only plain folder names
[ -d "$d" ] && rm -rf -- "$d"
done

Change the folder for Cursor or another fork. Don't delete extension folders that aren't listed: those are the versions you're using.

2. Caches in Application Support

Each editor also keeps Chromium and Electron caches under ~/Library/Application Support/, in a folder named after the app: Code for VS Code, Code - Insiders, Cursor, and so on.

Inside it, these are caches the editor rebuilds as you work:

  • Cache, Code Cache and GPUCache: the usual Chromium caches
  • CachedData: compiled JavaScript for faster startup
  • CachedExtensionVSIXs: downloaded extension packages
  • logs: old log files

With the editor quit, you can delete those folders. The next launch is a little slower while it rebuilds them.

Leave the rest of that folder alone. User holds your settings, keybindings and snippets, and User/workspaceStorage holds per-project state that some extensions rely on, such as chat history.

3. Update downloads

VS Code and many Electron apps update through a helper called ShipIt, which downloads the new version into ~/Library/Caches/<app id>.ShipIt, for example ~/Library/Caches/com.microsoft.VSCode.ShipIt.

Once the update is installed, what's left there is a leftover. If the editor isn't in the middle of updating, it's safe to delete. Slack, among others, does the same thing.

du -sh ~/Library/Caches/*.ShipIt 2>/dev/null

4. Editors you already removed

Dragging an editor to the Trash removes the app, not its data. If you tried Cursor, Windsurf or VS Code Insiders and moved on, check for their dot folders in your home folder and their folders in Application Support:

du -sh ~/.cursor ~/.windsurf ~/.vscode-insiders ~/.vscode-oss 2>/dev/null
du -sh ~/Library/Application\ Support/{Cursor,Windsurf,"Code - Insiders",VSCodium} 2>/dev/null

Anything there that belongs to an editor you no longer have installed can go, extensions and all. Keep the User folder if you think you might come back and want your settings.

In short

Quit and reopen your editors now and then so they clear their own old extensions, clear the caches with the editor closed, and check for leftovers from editors you stopped using.

Disclosure: I make Diskwise, a Mac menu bar app that finds these for you, including old extension copies that are marked in .obsolete while the editor is closed. It's a free scan to see what it finds. The commands above work without it.

This post was written with Claude.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.