misonoteApp Center

VS Code cache on Mac: safe to delete CachedData and logs?

Safe to deleteRegenerated automatically; Thermo deletes it outright.

Quit first: Code · Electron

Where it is

  • ~/Library/Application Support/Code/Cache
  • ~/Library/Application Support/Code/CachedData
  • ~/Library/Application Support/Code/Code Cache
  • ~/Library/Application Support/Code/GPUCache
  • ~/Library/Application Support/Code/CachedExtensionVSIXs
  • ~/Library/Application Support/Code/logs
  • ~/Library/Caches/com.microsoft.VSCode.ShipIt

What it is

Visual Studio Code is an Electron app, and its Application Support folder holds several caches: Chromium's web, code and GPU caches, CachedData with compiled JavaScript for the editor itself, CachedExtensionVSIXs with downloaded extension packages, and logs. The updater's ShipIt folder in ~/Library/Caches stores downloaded updates.

Why it gets so big

VS Code releases frequently, so CachedData can hold leftovers from earlier versions, and every extension update can leave a cached package. Logs are written per session and per window.

Is it safe to delete?

Yes. Your settings, keybindings, snippets and installed extensions live in the User folder and ~/.vscode/extensions, which aren't touched. VS Code regenerates these caches when it starts. Quit VS Code first, including any instance running from a development build.

Tip

The User/workspaceStorage folder can also get big, but it holds per-project state such as open editors and extension data, so it isn't part of this cache cleanup.

See how much space it uses

du -sh "$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" "$HOME/Library/Application Support/Code/CachedExtensionVSIXs" "$HOME/Library/Application Support/Code/logs" "$HOME/Library/Caches/com.microsoft.VSCode.ShipIt" 2>/dev/null

Delete it by hand

Run in Terminal. Deleting cannot be undone, so check the paths first.

rm -rf "$HOME/Library/Application Support/Code/Cache"/*
rm -rf "$HOME/Library/Application Support/Code/CachedData"/*
rm -rf "$HOME/Library/Application Support/Code/Code Cache"/*
rm -rf "$HOME/Library/Application Support/Code/GPUCache"/*
rm -rf "$HOME/Library/Application Support/Code/CachedExtensionVSIXs"/*
rm -rf "$HOME/Library/Application Support/Code/logs"/*
rm -rf "$HOME/Library/Caches/com.microsoft.VSCode.ShipIt"/*