ThisCalculator

Everyday

Free Disk Space Used by VS Code Workspace and Extension Caches

Updated · Standard formula, shown below

Free Disk Space Used by VS Code Workspace and Extension Caches

Visual Studio Code stores workspace data and extension caches that can quietly consume several gigabytes over time. This guide shows you how to locate and safely delete those caches to reclaim disk space without breaking your settings or installed extensions.

What You’ll Need

  • Access to your user profile folder (usually C:\Users\<YourName> on Windows, /Users/<YourName> on macOS, or /home/<YourName> on Linux).
  • VS Code closed during the cleanup to avoid file locks.
  • Administrator rights if the cache folders are in protected locations (rare, but possible on some systems).

Step-by-Step

  1. Close VS Code completely. Make sure no window is open, and check the system tray (Windows) or menu bar (macOS) for any lingering VS Code processes. Use Task Manager (Windows) or Activity Monitor (macOS) to end them if needed.
  2. Open your user profile folder. Press Win+R (Windows) and type %USERPROFILE%, or in Finder press Cmd+Shift+G and type ~ (macOS). On Linux, open your file manager and go to /home/<YourName>.
  3. Navigate to the VS Code folder. Look for a folder named .vscode (note the leading dot). If you don’t see it, enable hidden files: in Windows File Explorer, click View > Hidden items; on macOS, press Cmd+Shift+. in the Open dialog; on Linux, press Ctrl+H in most file managers.
  4. Clear the workspace storage cache. Inside .vscode, open the User folder, then workspaceStorage. This folder contains subfolders for each workspace you’ve opened. You can delete the entire workspaceStorage folder—VS Code will recreate it the next time you open a workspace. If you want to keep some, delete only the subfolders that are large or belong to projects you no longer use.
  5. Clear the extension caches. Go back to the .vscode folder and open the extensions folder. This holds installed extensions, but also their caches. Do not delete the entire extensions folder—that would uninstall every extension. Instead, look for subfolders named .cache, cache, or tmp inside each extension folder. Delete those subfolders. Also, check the extensions folder for any .obsolete files—these are leftovers from updates and can be deleted.
  6. Clear the global cache folder. In the .vscode folder, you may see a Cache or CachedData folder. These are safe to delete entirely. They store temporary data for the editor itself.
  7. Check the Code Cache folder (Windows only). On Windows, there is also a Code Cache folder inside .vscode. This holds cached JavaScript and can grow large. Delete its contents (the files inside, not the folder itself).
  8. Empty the Recycle Bin or Trash. After deleting, empty your recycle bin (Windows) or trash (macOS/Linux) to actually free the space.
  9. Restart VS Code. Open a workspace and verify that your settings, keybindings, and extensions still work. You may see a brief re-indexing or re-downloading of some caches, which is normal.

Common Mistakes

  • Deleting the entire extensions folder. This removes all extensions, and you’ll have to reinstall them manually. Only delete cache subfolders inside each extension.
  • Deleting the User folder. That folder contains your settings.json, keybindings, and snippets. Deleting it resets your configuration.
  • Deleting while VS Code is running. Files may be locked, and deletion will fail or cause corruption. Always close VS Code first.
  • Ignoring the workspaceStorage folder. This is often the biggest culprit, especially if you open many projects frequently.

Tips

  • Use the built-in “Developer: Open Cache Folderâ€� command. In VS Code, press Ctrl+Shift+P (or Cmd+Shift+P on macOS), type “Open Cache Folderâ€�, and press Enter. This opens the exact cache location for your installation, which might be slightly different from the .vscode folder (e.g., on macOS it’s ~/Library/Caches/com.microsoft.VSCode).
  • Check the size of each folder before deleting. On Windows, right-click a folder and select Properties; on macOS, press Cmd+I; on Linux, use du -sh in the terminal. This helps you target the largest caches.
  • Use the “Clear Editor Historyâ€� command. In VS Code, run Clear Editor History from the Command Palette. This removes the list of recently opened files, which also clears some associated cache data.
  • Consider disabling telemetry. VS Code collects usage data that is stored in caches. Disabling telemetry in settings ("telemetry.telemetryLevel": "off") reduces future cache growth.

Troubleshooting

  • VS Code won’t start after cleanup. If the editor fails to open, you may have deleted a critical file. Reinstall VS Code (it will preserve your settings) or restore from a backup if you made one. Usually, deleting only cache folders is safe, but if you accidentally removed settings.json, you’ll need to reconfigure.
  • Extensions are missing. If you deleted the entire extensions folder, reinstall them from the Extensions view (Ctrl+Shift+X). Your installed extensions list is stored in extensions.json in the .vscode folder—if that file remains, you can see which ones you had.
  • Disk space didn’t increase. Check if you emptied the recycle bin/trash. Also, some caches are stored in other locations (e.g., ~/Library/Caches on macOS). Use the “Open Cache Folderâ€� command to find them.
  • VS Code recreates caches immediately. That’s normal. The editor needs some cache to function. If you want to prevent excessive cache growth, reduce the number of workspaces you open or use the “Clear Editor Historyâ€� command periodically.

Frequently Asked Questions

Will deleting caches remove my extensions?

No, if you only delete cache subfolders inside each extension folder, the extensions themselves remain installed. Deleting the entire extensions folder will remove them.

Can I delete the entire .vscode folder?

No. That folder contains your settings, keybindings, and installed extensions. Deleting it resets VS Code to a fresh state, and you’ll lose your configuration.

Is it safe to delete the workspaceStorage folder?

Yes. It only contains per-workspace data like open files, undo history, and search state. VS Code recreates it as needed.

Why is my workspaceStorage folder so large?

Each workspace stores a copy of the file tree and other metadata. If you open many projects, or projects with thousands of files, the storage grows. Also, some extensions store their own data there.

How often should I clean these caches?

There’s no fixed schedule. If you notice disk space shrinking or VS Code becoming sluggish, it’s a good time to clean. Monthly is a reasonable frequency for active developers.

Does cleaning caches affect performance?

Initially, VS Code may be slightly slower as it rebuilds caches, but after a few minutes it returns to normal. In fact, clearing corrupted caches often improves performance.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.