How to clear the VS Code cache on a Mac
By Vishva Variya · Updated · 3 min read
Short answer
Quit VS Code, open ~/Library/Application Support/Code and move the Cache, CachedData and CachedExtensionVSIXs folders to the Trash. Leave the User folder, which holds your settings, keybindings and snippets. VS Code recreates the cache folders the next time it opens.
Where is the VS Code cache on a Mac?
~/Library/Application Support/Code/Cache~/Library/Application Support/Code/CachedData~/Library/Application Support/Code/CachedExtensionVSIXs
Safe to clear. Temporary files stored by Visual Studio Code. Safe to delete and will be recreated when you open VS Code again.
How do I delete the VS Code cache by hand?
- 1Quit VS Code (Code > Quit Visual Studio Code, or Command-Q).
- 2In Finder choose Go > Go to Folder and enter ~/Library/Application Support/Code.
- 3Move the Cache, CachedData and CachedExtensionVSIXs folders to the Trash.
- 4Leave the User folder alone: it holds settings.json, keybindings and snippets.
- 5Reopen VS Code; it recreates the cache folders.
What happens when you clear it?
Removing only the cache subfolders doesn't touch settings or extensions; VS Code recreates them (catalog). By contrast, VS Code's docs say deleting the whole user data folder ($HOME/Library/Application Support/Code) plus ~/.vscode-shared and ~/.vscode returns you to the state before you installed VS Code and resets your settings.
Clearing it with Peekaboo
Peekaboo’s App Caches page lists “VS Code Cache” with its size and the note above, alongside every other cache it finds. It won’t offer a folder the app is still running from, and the cleanup goes to the Trash, so ⌥⌘Z puts it back.
- 1Open App Caches.⇧⌘E
- 2Find VS Code Cache, check its size, and move it to the Trash.
Questions
Where does VS Code keep its data on a Mac?
- VS Code's docs give $HOME/Library/Application Support/Code as the user data folder on macOS. Your user settings are in $HOME/Library/Application Support/Code/User/settings.json.
Will deleting the whole Code folder reset VS Code?
- Yes. VS Code's uninstall guide says deleting $HOME/Library/Application Support/Code, ~/.vscode-shared and ~/.vscode removes all user data and returns you to the state before you installed it. To clear only the cache, delete just Cache, CachedData and CachedExtensionVSIXs.
Does VS Code have a Clear Cache command?
- VS Code's docs don't document a built-in command that clears its cache. Quit the app and delete the cache folders by hand.