Is it safe to delete VS Code’s caches and old extensions?
- Yes, the caches, with VS Code quit. Folders like
Cache,CachedDataandGPUCachein~/Library/Application Support/Codehold files VS Code makes again. Old versions of extensions can go too, but remove extensions you don’t use from inside VS Code. - What it costs you: a slightly slower first start while VS Code rebuilds its caches. Your settings, extensions and workspaces stay as they are.
- Does it come back? Yes. The caches refill as you work, and each extension update adds a new version folder.
- SiftMac’s verdict: Rebuilds
1. What it is
Visual Studio Code is built on Electron, so like a browser it keeps caches to start and draw faster. They live in its user data folder, ~/Library/Application Support/Code, next to things that aren’t caches at all:
Cache,Code CacheandGPUCache: Electron’s web and graphics caches.CachedData: cached compiled code for VS Code itself.CachedExtensionVSIXs: cached copies of extension packages.User: your settings, keybindings, snippets and the saved state of every folder you’ve opened. Not a cache.
Extensions live somewhere else: Microsoft’s documentation names ~/.vscode/extensions as the per-user extensions folder on a Mac. Each installed extension has its own folder there, named after its publisher, name and version.
2. Where it is
~/Library/Application Support/Code
~/.vscode/extensions
To open the first in Finder, choose Go › Go to Folder (⇧⌘G) and paste the path. ~/.vscode is hidden; press ⇧⌘. in Finder to show hidden files. VS Code may also keep folders in ~/Library/Caches; they’re caches too.
3. How big it gets
Extensions that bundle a language server or download their own tools can be large, and the saved state in User grows with every folder you open. The caches refill as you use VS Code. To see what’s big on your Mac:
du -sh ~/Library/Application\ Support/Code/* ~/.vscode/extensions 2>/dev/null | sort -h
du -sh ~/.vscode/extensions/* | sort -h
4. How to delete it safely
Caches. Quit VS Code (⌘Q), then clear the cache folders and leave User and everything else alone:
rm -rf ~/Library/Application\ Support/Code/Cache/*
rm -rf ~/Library/Application\ Support/Code/"Code Cache"/*
rm -rf ~/Library/Application\ Support/Code/GPUCache/*
rm -rf ~/Library/Application\ Support/Code/CachedData/*
rm -rf ~/Library/Application\ Support/Code/CachedExtensionVSIXs/*
Extensions you don’t use. Uninstall them in VS Code: open the Extensions view (⇧⌘X), click the gear on the extension and choose Uninstall. Or from Terminal, with the code command:
code --list-extensions --show-versions
code --uninstall-extension <publisher.name>
Old versions of an extension. --show-versions prints the version of each extension VS Code has installed. A folder in ~/.vscode/extensions for the same extension with a different version is a copy it no longer uses, and can go to the Trash with VS Code quit. If you use profiles, list each one too (code --list-extensions --show-versions --profile <name>) before deleting anything.
5. What happens afterwards
- VS Code opens as before, with your settings, extensions and open folders. The first start rebuilds its caches, so it may be a little slower once.
- An uninstalled extension is gone from every window. Reinstall it from the Extensions view whenever you like.
- The caches and the extensions folder grow again with use and updates, so clearing them now and then is enough.
6. What not to delete
~/Library/Application Support/Code/User and ~/.vscode as a whole. Microsoft’s uninstall instructions delete ~/Library/Application Support/Code, ~/.vscode-shared and ~/.vscode to put VS Code back to how it was before you installed it, which is exactly what you’d lose. Cursor is built on VS Code and works the same way: see Cursor’s extensions and its update cache.
Questions
Will clearing VS Code’s cache delete my settings or extensions?
No, as long as you clear only the cache folders. Settings live in Code/User, extensions in ~/.vscode/extensions.
Is it safe to delete the whole ~/Library/Application Support/Code folder?
Only if you want to reset VS Code. Microsoft’s uninstall instructions delete it, along with ~/.vscode, to remove all user data.
Why do I have several versions of the same extension?
Each update installs into a new folder. The version VS Code uses is the one code --list-extensions --show-versions prints for your profile; folders for other versions are left from earlier updates.
How SiftMac handles it. Its App caches category lists VS Code’s folders in ~/Library/Caches and clears them only while VS Code is closed. It doesn’t touch ~/Library/Application Support/Code or your extensions; if you’ve removed VS Code itself, that folder is listed under Removed apps and waits on the Undo Shelf before it goes.
Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works