The short answer
- 01
Safe to delete with VS Code quit: Cache, CachedData, GPUCache and CachedExtensionVSIXs in ~/Library/Application Support/Code.
- 02
VS Code writes them as it runs: compiled code, web caches, GPU shader caches and downloaded extension packages.
- 03
You lose nothing permanent. The first launch afterwards can be slower while the caches refill.
- 04
Keep the User folder: User/settings.json and User/globalStorage/state.vscdb are your settings and editor state, not cache.
- 05
The command: quit VS Code, then rm -rf the four cache folders (see below). Permanent, skips the Trash.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What are the VS Code Cache and CachedData folders?
They are VS Code's own caches, inside its data folder at ~/Library/Application Support/Code. VS Code's docs confirm that folder: the user settings file sits at ~/Library/Application Support/Code/User/settings.json.
Next to User you find the cache folders:
CacheandCachedData: web caches and compiled code the editor keeps to start faster.GPUCache: the GPU shader cache.CachedExtensionVSIXs: downloaded extension packages, kept after an extension is installed or updated.
What writes it and why does it grow?
VS Code writes these folders while it runs and updates. Code caches build up as the editor and its extensions run, and extension packages pile up as extensions update. Nothing in the editor's interface empties them.
Two other folders under User also grow, and they are not caches:
User/workspaceStorage: one folder per workspace with state saved by the editor and extensions. Folders stay after you delete or move the project.User/globalStorage/state.vscdb.backup: a backup copy of the live global state database,state.vscdb.
How big does it get?
It varies with your extensions and how long VS Code has been installed. Measure it:
cd ~/Library/Application\ Support/Code && du -sh Cache CachedData GPUCache CachedExtensionVSIXs User/workspaceStorage 2>/dev/null
Prints the size of each folder that exists. Removes nothing.
Is it safe to delete VS Code's cache folders?
| What | Verdict | What you lose |
|---|---|---|
Cache, CachedData, GPUCache | Safe | Nothing permanent; VS Code rebuilds them. |
CachedExtensionVSIXs | Safe | Downloaded packages only. Installed extensions stay. |
state.vscdb.backup, with VS Code closed | Safe | A backup copy. VS Code writes a new one. |
workspaceStorage folders of deleted projects | Safe | State for a workspace that no longer exists. |
All of workspaceStorage | Careful | Workspace state and some extension data reset for live projects. |
User/globalStorage/state.vscdb | Never | Editor state and extension data. Not a cache. |
User/settings.json, keybindings.json, snippets | Never | Your configuration. |
How do I clear the VS Code cache?
VS Code has no built-in command that empties these folders, so quit VS Code fully (Code > Quit Visual Studio Code) and delete them by hand.
cd ~/Library/Application\ Support/Code && rm -rf Cache CachedData GPUCache CachedExtensionVSIXs
Deletes the four cache folders permanently, without the Trash. Leaves User alone.
The manual way: in Finder, press Shift+Cmd+G, go to ~/Library/Application Support/Code and drag the same four folders to the Trash.
What Hoardless does: its IDE caches detector lists Cache, CachedData and CachedExtensionVSIXs at the Auto tier, and its VS Code detector adds GPUCache (Auto). Only while VS Code is closed, it also lists state.vscdb.backup and the workspaceStorage folders whose workspace.json points at a local folder that no longer exists, both at the Confirm tier. It never lists the live state.vscdb, your settings, keybindings, snippets or extensions. Everything goes to the Trash after you review the plan, with an undo log.
What comes back and when?
The cache folders come back on the next launch and refill as you work, so the space returns slowly. Extension packages come back only as extensions update. Removed workspaceStorage folders of deleted projects never come back, because nothing opens those workspaces again.
VS Code caches without touching your setup
Hoardless lists VS Code's caches (Auto tier), the state backup and dead workspace state (Confirm, only while VS Code is closed), never the live state database, and moves what you pick to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Where are VS Code files stored on a Mac?
In ~/Library/Application Support/Code. VS Code's documentation puts the user settings file at ~/Library/Application Support/Code/User/settings.json. Extensions themselves are installed in ~/.vscode/extensions.
Will deleting CachedData remove my extensions?
No. CachedExtensionVSIXs holds downloaded extension packages, not installed extensions. Installed extensions are in ~/.vscode/extensions and stay.
What is workspaceStorage and can I delete it?
It holds per-workspace state saved by the editor and extensions. Deleting all of it resets that state. Folders for workspaces whose project folder no longer exists are the safe part.
Can I delete state.vscdb.backup?
Yes, while VS Code is closed. It is a backup copy of the global state database, and VS Code writes a new one. Never delete state.vscdb itself.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.