Your Search Bar For Shrewd Tips

How Do I Clear Vscode Extension Cache?


If Visual Studio Code is slow to start, an extension is behaving strangely, or an update has not taken effect, clearing the VS Code extension cache may help. Cached files can become outdated or corrupted, but deleting the wrong folder can also remove extension settings, local data, or installed extensions. The safest approach is to close VS Code, remove only cache folders, and then reopen the editor.

This guide explains how to clear the VS Code cache on Windows, macOS, and Linux, how to handle extension-specific data, and what to try if you use VS Code Remote, WSL, or Insiders. It also shows which folders to leave alone so you can troubleshoot without unnecessarily resetting your development environment.

What Does the VS Code Extension Cache Do?

VS Code and its extensions use several kinds of cached data. The application cache can include temporary files, cached web resources, and compiled application data. Extensions may also store their own state, downloaded resources, or workspace-specific information. These files can speed up loading, but they may occasionally become stale or damaged.

Clearing cache folders is different from uninstalling extensions. A cache cleanup usually leaves your installed extensions and most settings intact. By contrast, deleting extension storage or the extensions folder may reset extension preferences, remove local extension data, or uninstall extensions entirely.

Because “extension cache” can refer to more than one location, start with the least disruptive option: close VS Code and clear its general cache folders. Only remove extension-specific data if a particular extension is still having a problem.

Before You Clear the VS Code Cache

Save your work and close every VS Code window before deleting files. The application can recreate cache folders when it starts, and removing files while VS Code is running may cause errors or leave some files locked. If you have important extension data, back up the relevant folder before changing it.

  • Save open files and close all VS Code windows.
  • Make sure VS Code has fully exited. Check Task Manager on Windows, Activity Monitor on macOS, or your system monitor on Linux if needed.
  • Do not delete your project folders or the entire VS Code user-data directory unless you intend to reset VS Code.
  • If you use VS Code Insiders, check its separate data directory rather than the Stable version’s directory.
  • If you use Portable Mode, look for the data folder beside the VS Code application instead of assuming the standard location applies.

How to Clear the VS Code Cache on Windows

On Windows, the standard VS Code user-data directory is usually %APPDATA%\Code. You can open it quickly by pressing Windows + R, entering %APPDATA%\Code, and pressing Enter. You can also paste that path into the address bar in File Explorer.

With VS Code closed, look for cache folders such as Cache, CachedData, and Code Cache. Depending on your VS Code version and usage, you may also see folders such as GPUCache or Service Worker\CacheStorage. Delete the cache folders you find, rather than deleting the entire Code directory.

When you reopen VS Code, it will rebuild necessary cache files. The first launch may take slightly longer while data is recreated. Your projects and installed extensions should remain in place if you have only removed the cache folders.

How to Clear the VS Code Cache on macOS

On macOS, VS Code’s standard user-data directory is ~/Library/Application Support/Code. The Library folder is hidden by default. In Finder, choose Go from the menu, select Go to Folder, and enter ~/Library/Application Support/Code.

After quitting VS Code, remove cache folders such as Cache, CachedData, and Code Cache, if present. You may also find folders related to GPU or service-worker caching. Remove only the cache-related folders you intend to clear; leave settings and user data folders alone unless you are troubleshooting a specific extension.

Open VS Code again after cleanup. It will rebuild its caches automatically. If you installed VS Code through a managed or custom setup, the user-data location may differ from the standard path.

How to Clear the VS Code Cache on Linux

On Linux, the standard user-data directory for the Stable release is usually ~/.config/Code. Open it in your file manager or use a terminal. For example, you can list its contents with ls ~/.config/Code.

Quit VS Code, then remove cache folders such as Cache, CachedData, and Code Cache if they exist. Some installations may also have GPUCache or service-worker cache data. You can remove an individual folder with a command such as rm -rf ~/.config/Code/Cache, but verify the path carefully before running a recursive delete command.

Linux distributions, package formats, and custom launch options can use different user-data locations. If the standard path does not contain your VS Code data, check whether you launch the editor with a custom --user-data-dir argument or use Portable Mode.

Clear a Specific Extension’s Stored Data

If clearing the general VS Code cache does not fix the issue, the extension may have saved problematic data in its own storage. VS Code keeps extension state in a folder commonly named User/globalStorage. Extensions can also store data for individual projects in User/workspaceStorage.

The parent User folder is inside the VS Code user-data directory. Its usual locations are %APPDATA%\Code\User on Windows, ~/Library/Application Support/Code/User on macOS, and ~/.config/Code/User on Linux.

Extension storage folders are often named using an extension’s publisher and identifier. If you identify the folder for the extension that is causing trouble, back it up and remove only that folder while VS Code is closed. On the next launch, the extension may recreate its stored data. Be aware that this can reset extension-specific preferences, authentication state, or other locally saved information.

The workspaceStorage folder contains data associated with opened workspaces. Deleting it can reset workspace-specific state, so do not remove the whole folder as a routine cache-clearing step. If the issue affects only one project, investigate the corresponding workspace entry carefully and make a backup first.

Clear the Extension Installation Cache Safely

Installed extensions are usually stored separately from the main application cache. The default extension directory is ~/.vscode/extensions on Linux and macOS, and commonly %USERPROFILE%\.vscode\extensions on Windows. Removing this folder is not a normal cache cleanup: it removes installed extension files and can require you to reinstall them.

If a single extension appears corrupted, use the Extensions view in VS Code to uninstall it, restart the editor, and install it again from the Marketplace. This is generally safer than manually deleting the entire extensions directory. If you need to inspect that directory, remove only the folder for the affected extension and make sure VS Code is closed first.

Do not assume every folder with “cache” in its name is safe to delete. Some extensions use their own folders for essential local data, such as downloaded language models, indexes, or authentication information. Check the extension’s documentation before removing unfamiliar data.

Use VS Code’s Built-In Troubleshooting Options

Before deleting extension data, try VS Code’s built-in options. The command Developer: Reload Window refreshes the current VS Code window and can resolve temporary interface or extension-loading problems without removing files.

You can also test whether an extension is responsible by launching VS Code with extensions disabled. In a terminal, run code --disable-extensions. If the problem disappears, re-enable extensions and disable them one at a time to identify the cause. The command may vary if the code command is not available in your terminal or if your installation uses a custom launcher.

For a clean diagnostic test, VS Code can also be started with a temporary user-data directory. This creates a separate environment without changing your usual settings or extension data. It is useful for determining whether the problem comes from your profile, but it is not a replacement for selectively clearing the cache in your regular profile.

VS Code Insiders, Portable Mode, and Remote Development

VS Code Insiders uses a separate profile from the Stable release. Its user-data directory is typically named Code - Insiders rather than Code. Clear cache folders in the profile for the version you are troubleshooting so you do not accidentally modify the other installation.

Portable Mode stores user data in a data folder located beside the VS Code application. If that folder exists, it may contain the active profile and cache. Close VS Code and inspect the portable data directory instead of deleting files from the standard user-data path.

With Remote - SSH, WSL, or development containers, extensions may run on a remote system rather than on your local computer. If a remote extension is malfunctioning, clearing only the local cache may not help. Use the Remote Explorer or the relevant remote terminal to identify where the extension is running, and follow the remote environment’s documentation before removing data. Avoid deleting unfamiliar directories on a remote machine.

What to Do If Clearing the Cache Does Not Work

If the same problem returns after clearing cache folders, the cause may be an extension bug, an incompatible update, a workspace setting, or a problem with VS Code itself. Update VS Code and the affected extension, then restart the editor. If the problem began immediately after an extension update, try installing a previous version through the extension’s options, if available.

Check the Output panel for extension error messages. Open the Command Palette and choose View: Toggle Output, then select the relevant extension or log channel from the Output panel’s dropdown. A useful error message can point to the extension or feature that needs attention, avoiding unnecessary deletion of profile data.

If you are still troubleshooting, back up your settings and extension list before making broader changes. You can export or copy important settings, and you can note installed extensions from the Extensions view. Resetting the entire profile should be a last resort, since it can remove customized settings, keybindings, snippets, extension state, and workspace history.

Conclusion: Clear Only the Cache You Need

To clear the VS Code extension cache, first close VS Code and remove the general cache folders from the correct user-data directory for your operating system. Reopen the editor and let it rebuild those files. If one extension remains broken, investigate that extension’s storage or reinstall it rather than deleting every extension folder.

Keep in mind that extension storage, workspace storage, and installed extension files are not the same as temporary cache. Back up data before changing those locations, and be especially careful with remote environments, Insiders, and Portable Mode. A targeted cleanup is safer, faster, and less likely to disrupt your VS Code setup.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →