If Visual Studio Code is slow, showing stale files, or behaving strangely on your Mac, clearing its cache can help. VS Code stores temporary data for features such as its user interface, extensions, and web-based content. Removing those temporary files is generally safe, but deleting the wrong folder can also erase settings, snippets, extensions, or workspace state. This guide explains how to clear the VS Code cache on macOS, what to keep, and how to troubleshoot problems safely.
What Does Clearing the VS Code Cache Do?
A cache is temporary data an app saves so it can load content more quickly next time. VS Code may cache interface resources, extension information, and other data used during normal operation. If cached files become outdated or damaged, clearing them may resolve issues such as a blank panel, stale interface elements, or a feature that does not refresh properly.
Clearing the cache is not the same as resetting VS Code. Cache folders are usually safe to remove because the editor can recreate them. Other folders in VS Code’s application support directory hold important user data, including settings, keybindings, extensions, and saved workspace information. Avoid deleting the entire VS Code data folder unless you intend to reset the editor and have backed up what you need.
Before You Clear the Cache
Save your work and close VS Code first. The editor may recreate or be actively using cache files while it is open, so removing them at that time can cause errors or leave some files behind. Quit the app using Code > Quit Visual Studio Code, or press Command-Q.
If you want extra protection, make a copy of the folders you plan to change. You can also try the simpler troubleshooting options first: reload the window, update VS Code, or restart your Mac. If a specific extension is causing the problem, disabling that extension may be more useful than clearing every cache.
Clear the VS Code Cache Using Finder
Finder provides a straightforward way to locate and remove the cache folders without typing Terminal commands. The Library folder inside your home directory is hidden by default, but Finder’s Go to Folder feature can open it directly.
- Quit Visual Studio Code completely.
- Open Finder and choose Go > Go to Folder from the menu bar, or press Shift-Command-G.
- Enter
~/Library/Application Support/Codeand press Return. - Locate the cache folders listed below. Move only the folders you intend to clear to the Trash.
- Open VS Code again and check whether the issue is resolved.
For the standard stable release of VS Code, commonly removable cache folders include Cache, CachedData, Code Cache, and GPUCache. Depending on your version and usage, you may not see every folder. Do not worry if a particular folder is missing.
Some versions also have temporary service-worker data under Service Worker/CacheStorage. You can remove that cache data if you are troubleshooting content that appears stale, but leave other files in the Service Worker directory alone unless you know what they do. When in doubt, start with the main cache folders and reopen VS Code before removing anything else.
Clear the Cache with Terminal
If you prefer Terminal, you can remove specific cache directories with a command. First quit VS Code. Then open Terminal from Applications > Utilities or search for it with Spotlight. The following command removes the common cache folders for the stable VS Code app:
rm -rf "$HOME/Library/Application Support/Code/Cache" \
"$HOME/Library/Application Support/Code/CachedData" \
"$HOME/Library/Application Support/Code/Code Cache" \
"$HOME/Library/Application Support/Code/GPUCache"
Terminal deletion is immediate and typically does not move files to the Trash. Check the paths carefully before running the command. Do not remove the whole Code directory as a shortcut: that directory includes data that may not be a cache. If you would rather review the folders first, use Finder or list the directory contents with ls "$HOME/Library/Application Support/Code".
After running the command, start VS Code again. The editor will recreate cache files as needed. The first launch may take a little longer while it rebuilds temporary data.
Clear VS Code Insiders Cache on a Mac
If you use the Insiders build, its data is kept separately from the stable release. The usual macOS location is ~/Library/Application Support/Code - Insiders. Follow the same Finder steps, but open that folder instead and remove only the cache directories you want to clear.
For Terminal, the equivalent command is:
rm -rf "$HOME/Library/Application Support/Code - Insiders/Cache" \
"$HOME/Library/Application Support/Code - Insiders/CachedData" \
"$HOME/Library/Application Support/Code - Insiders/Code Cache" \
"$HOME/Library/Application Support/Code - Insiders/GPUCache"
Use the folder that matches the version you are troubleshooting. Clearing the stable app’s cache will not necessarily fix a problem that occurs only in Insiders, and vice versa.
Folders You Should Not Delete by Accident
The folder ~/Library/Application Support/Code/User contains user-level data such as settings, keybindings, and snippets. Deleting it can make VS Code appear as though it has been freshly installed. The extensions folder stores installed extensions, so removing it means you may need to install them again.
The workspaceStorage folder contains information associated with individual workspaces. Removing it may reset some workspace-specific state, such as certain editor or extension records. It is not a general cache folder to delete casually. Likewise, avoid deleting the entire ~/Library/Application Support/Code folder unless your goal is a full reset and you have backed up important data.
Also keep your project folders separate from VS Code’s cache. Your source code is normally stored wherever you chose to save it, not in the application cache directory. However, always confirm the path before deleting anything, especially when using Terminal.
What If Clearing the Cache Does Not Fix the Problem?
Cache clearing helps with certain stale or corrupted temporary files, but it will not solve every VS Code issue. Try these steps to narrow down the cause:
- Reload the window: Open the Command Palette with Shift-Command-P, search for Developer: Reload Window, and run it.
- Update VS Code: Choose Code > Check for Updates, if available, and install the latest version.
- Test without extensions: Open the Command Palette and run Developer: Reload With Extensions Disabled. If the problem disappears, re-enable extensions one at a time to identify the cause.
- Check a new window or project: If the issue appears only in one workspace, it may relate to that project’s settings or workspace state rather than the global cache.
- Review logs: Use View > Output or the relevant extension’s output channel to look for errors.
If you still have trouble, note exactly what is happening and when it began. A recent extension install, update, or workspace setting may provide a better clue than deleting more data.
How to Reset VS Code Completely
A full reset is different from clearing the cache and should be a last resort. It can remove settings, snippets, extensions, and workspace-specific information. Before resetting, back up anything you want to keep. You can copy the relevant folders to a safe location or use VS Code Settings Sync if it is enabled and configured for your account.
For a clean start, quit VS Code and inspect ~/Library/Application Support/Code. Rather than deleting the whole directory immediately, consider renaming it to something like Code-backup. VS Code can then create a fresh data directory when you reopen it. If the fresh setup fixes the problem, restore only the files you need from the backup. If it does not, quit VS Code and move the original directory back.
Renaming or removing the application support folder resets more than cached files, so do not use this method when you only want to clear temporary data. Keep the stable and Insiders folders distinct if you use both versions.
Frequently Asked Questions
Will clearing the VS Code cache delete my code? No, not if you remove only the cache folders in the VS Code application support directory. Your project files are normally stored elsewhere. Still, verify the folder path before deleting anything.
Will I have to reinstall my extensions? Not when you remove only folders such as Cache or GPUCache. Deleting the extensions folder, however, removes installed extensions.
Why can’t I find the Library folder? The user Library is hidden in Finder by default. Use Go > Go to Folder and enter ~/Library/Application Support/Code to open the correct location directly.
How often should I clear the cache? There is no need to clear it on a schedule. Do so when troubleshooting a specific problem, since VS Code can manage its temporary files during normal use.
Conclusion
To clear the VS Code cache on Mac, quit the editor and remove its specific cache folders from ~/Library/Application Support/Code, or use the matching Code - Insiders folder if you use the preview build. Start with folders such as Cache, CachedData, Code Cache, and GPUCache. Avoid deleting user settings, extensions, workspace storage, or the entire application support folder unless you intend to reset VS Code. Restart the editor afterward and check whether the original issue has been resolved.
Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.