devcrea

How to Completely Reset a VS Code Extension (Clear Data & Cache)

Uninstalling a VS Code extension leaves globalStorage data behind. This guide shows how to clear cache, workspace data, and use the CLI for a complete reset.

// The short answer

Uninstalling a VS Code extension does not remove its global storage, so reinstalling can restore the same broken state. Remove only that extension's folder from the platform-specific globalStorage directory, clear its cached data when necessary, and use code --uninstall-extension publisher.extension-name for the extension itself before reinstalling and testing without Settings Sync restoring the old state.

Full walkthrough, edge cases and why it works
In this guide · 9 sections
  1. 01Why Just Uninstalling an Extension Rarely Works
  2. 02Step 1: Turn Off Settings Sync First
  3. 03Step 2: Clear Out the Extension’s Folder in globalStorage
  4. 04Step 3: Check workspaceStorage for Project-Only Bugs
  5. 05Step 4: Trash the Extension Source Files
  6. 06An Alternative Route: Cleaning Up via the Code CLI
  7. 07Fixing Extensions on Remote SSH Connections
  8. 08Quick Reference: Common Extension Storage Folders
  9. 09How to Tell If the Reset Actually Worked

If you've ever hit "Uninstall" on a glitchy VS Code extension, reinstalled it, and found the exact same bug waiting for you, you aren’t crazy. Hitting that uninstall button doesn’t actually wipe everything; it leaves behind a quiet trail of cached states, temporary session files, and stale auth tokens tucked away inside your globalStorage folder. Manually clearing out these leftover folders is pretty much the only reliable way to force a real factory reset on a broken tool and stop Settings Sync from instantly bringing old bugs back from the dead.

  • Windows: %APPDATA%\Code\User\globalStorage
  • macOS: ~/Library/Application Support/Code/User/globalStorage
  • Linux: ~/.config/Code/User/globalStorage
  • VS Code Insiders: AppData\Local\Code - Insiders\User\globalStorage
  • CLI Command: code --uninstall-extension publisher.extension-name

Why Just Uninstalling an Extension Rarely Works

Here’s the catch: VS Code deliberately keeps an extension’s application logic separate from your actual personal data. When you click uninstall in the UI, the editor only deletes the core source code folder. Everything else - your custom preferences, cached workspace sessions, and saved login tokens - stays completely untouched right inside globalStorage. The moment you reinstall that extension, it simply links right back up to those exact same broken files.

To make things trickier, the extension host process hangs onto these files pretty aggressively. Running the Developer: Reload Window command works fine as a gentle soft restart, but whenever you’re dealing with stubborn, corrupt configuration files that refuse to go away, you have to do a proper hard wipe of the storage folders by hand.

Step 1: Turn Off Settings Sync First

Whatever you do, don't skip this part. VS Code is built to quietly sync your settings and extension setups directly to the cloud. If you clear out your local cache while sync is running in the background, VS Code will just assume you’re missing files and pull that identical corrupt config right back down to your machine.

Pop open your Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run Preferences: Settings Sync: Turn Off. When it prompts you, tell it to keep your data locally for the time being. This gives you a clean, isolated setup where you can safely trash the bad files. Once you finish the reset and verify the fix, turn sync back on and select the Replace Local option to overwrite the cloud copy with your fresh setup.

Step 2: Clear Out the Extension’s Folder in globalStorage

Every single extension you install gets its own dedicated sandbox folder inside globalStorage. Tossing this specific folder into the trash is what actually wipes away all of its saved preferences, cached states, and stubborn local settings.

To start, you need the extension's exact ID. Head to your Extensions tab, click on the one giving you grief, and look under the Identifier section in the details view. It always follows a pattern like publisher.extension-name.

Once you have that string, jump to your OS directory below and delete the folder matching that identifier name:

Windows: Hit Win + R, paste this in, and press Enter:

code1 line
%APPDATA%\Code\User\globalStorage

macOS: Open Finder, press Cmd + Shift + G, and drop in:

code1 line
~/Library/Application Support/Code/User/globalStorage

Linux: Open your file manager or terminal and head to:

Bash

code1 line
~/.config/Code/User/globalStorage

If you're on Linux and aren't entirely sure where your home folder resolves, you can always find the exact directory path directly via terminal.

Step 3: Check workspaceStorage for Project-Only Bugs

Ever had an extension work like a charm across five projects, only to completely fall apart in one specific repository? That usually means the bad data isn't global - it's localized inside the workspaceStorage directory, which sits right alongside your globalStorage folder.

Instead of clean names, VS Code labels these workspace folders with long, random alphanumeric hashes. If you click into them, you'll see a small workspace.json file inside each one that spells out the actual project path it tracks. Just open those up, find the one tied to your problematic project, and delete the entire hash folder once you spot it.

Step 4: Trash the Extension Source Files

As a final cleanup sweep, you'll want to get rid of the raw downloaded source files. VS Code keeps these in an entirely separate directory from the configuration data we just touched.

Windows:

code1 line
%USERPROFILE%\.vscode\extensions

macOS and Linux:

Bash

code1 line
~/.vscode/extensions

Look through the list for the folder carrying the publisher identifier you noted earlier, then delete it. Once that's gone, your machine is finally 100% clean of any traces of that extension.

An Alternative Route: Cleaning Up via the Code CLI

If you find yourself stuck working on headless machines, remote environments, or just prefer the terminal, you don't actually need the GUI to get rid of an extension. You can strip it straight from your command line:

Bash

code1 line
code --uninstall-extension publisher.extension-name

This trick is especially handy if a buggy extension is hard-crashing your editor on launch, or if you're managing VS Code on a remote Linux box without any desktop environment running.

Fixing Extensions on Remote SSH Connections

Keep in mind that working over a remote SSH connection changes the playing field. In those setups, the extension code and its cached states aren't running on your laptop - they live on the remote server itself.

To wipe them out, SSH into your server and make your way to this path:

Bash

code1 line
~/.vscode-server/extensions

Delete the corrupted extension folder directly on the machine, then reload your local VS Code window to trigger a fresh connection. By the way, if you're just starting to mess around with remote setups, installing WSL2 on Windows follows a very similar workflow for local Linux environments.

Quick Reference: Common Extension Storage Folders

To save you some digging through cryptic folder names, here are the exact folder identifiers for a few tools that frequently need a reset inside globalStorage:

  • Prettier: esbenp.prettier-vscode
  • ESLint: dbaeumer.vscode-eslint
  • GitLens: eamodio.gitlens
  • Python: ms-python.python

Nuking just the folder you need lets you reset that specific tool back to zero without touching the rest of your daily editor setup.

How to Tell If the Reset Actually Worked

Go back to the marketplace and install the extension again. If the wipe was genuinely successful, the extension will treat you like a brand-new user - you'll see its default welcome tab, initial setup wizards, or auth prompts pop up. If it silently loads right into your old setup without saying a word, some cached config file managed to survive somewhere. Double-check that Settings Sync didn't sneak in and turn itself back on, then give those globalStorage paths one more pass.

That initial "Welcome" or onboarding splash screen is your best indicator. If you don't see it, there's still stale cache hanging around.

Quick answers

Frequently asked questions

Does uninstalling a VS Code extension remove its settings?

No. Uninstalling only deletes the extension source code from the .vscode/extensions folder. The personal data, cached states, and authentication tokens stored in globalStorage and workspaceStorage are deliberately kept intact so your settings survive updates. To remove everything, you need to manually delete the matching folder inside globalStorage after uninstalling.

Where is the globalStorage folder in VS Code?

On Windows it is at %APPDATA%\Code\User\globalStorage. On macOS look in ~/Library/Application Support/Code/User/globalStorage. On Linux it is at ~/.config/Code/User/globalStorage. If you are using VS Code Insiders, replace 'Code' with 'Code - Insiders' in the Windows path. Each extension gets its own subfolder named after its publisher identifier.

Why does my VS Code extension keep coming back after I delete it?

Settings Sync is almost always the cause. VS Code syncs your installed extensions to the cloud and restores them automatically when it detects they are missing. Turn off Settings Sync before deleting any extension data, complete the cleanup, reinstall the extension fresh, then re-enable sync and choose Replace Local to push your clean state to the cloud.

How do I reset a VS Code extension without affecting my other extensions?

Navigate to your globalStorage directory and delete only the subfolder matching the specific extension's identifier, such as esbenp.prettier-vscode for Prettier. This is surgical and leaves every other extension's data untouched. If the issue is project-specific, check workspaceStorage for a hash folder containing a workspace.json that points to your affected project and delete that folder instead.

How do I uninstall a VS Code extension from the command line?

Run code --uninstall-extension publisher.extension-name in your terminal. This is the correct flag syntax with double dashes. Replace publisher.extension-name with the actual identifier you see in the extension's details panel, for example code --uninstall-extension esbenp.prettier-vscode. This method is especially useful on remote servers where the VS Code GUI is not available.

What is the difference between globalStorage and workspaceStorage in VS Code?

globalStorage holds extension data that applies across all projects, such as authentication tokens and general preferences. workspaceStorage holds data specific to a single project folder, like local indexes or project-specific history. When a bug appears in only one project, clear the workspaceStorage hash folder for that project. When the bug follows you everywhere, clear the globalStorage folder.

Something wrong or out of date?

Tools change fast. Tell the editor what no longer works.