Skip to content

Instantly share code, notes, and snippets.

@pokey
Created September 25, 2025 12:50
Show Gist options
  • Select an option

  • Save pokey/6cbad580806cf8f0336be7fb91b981e0 to your computer and use it in GitHub Desktop.

Select an option

Save pokey/6cbad580806cf8f0336be7fb91b981e0 to your computer and use it in GitHub Desktop.
VSCode nuclear reinstall

Here's how I do a nuclear reinstall of VSCode (ie uninstall, reset caches, remove all exteions, etc). It is useful when I am completely at my wit's end. I've only had to do it twice, but wanted to capture it for next time. It is based on microsoft/vscode-python#24839 (comment). It might change in a future version of VSCode; worked for me as of VSCode 1.104.1 to solve microsoft/vscode-python#24839

  1. Backup extensions list and config files I care about
    mkdir ~/vscode-backup
    code --list-extensions > ~/vscode-backup/installed-extensions.txt
    cp "$HOME/Library/Application Support/Code/User/settings.json" ~/vscode-backup
    cp "$HOME/Library/Application Support/Code/User/tasks.json" ~/vscode-backup
    cp "$HOME/Library/Application Support/Code/User/keybindings.json" ~/vscode-backup
  2. Move VSCode to bin
  3. Empty trash
  4. 🧨
    rm -rf ~/.vscode
    rm -rf ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState
    sudo rm /usr/local/bin/code
    rm ~/Library/Preferences/com.microsoft.VSCode.plist
    rm -rf ~/Library/Caches/com.microsoft.VSCode.ShipIt
    rm -rf ~/Library/Logs/Code
    rm -rf ~/Library/Caches/com.microsoft.VSCode
    rm -rf ~/Library/Application\ Support/Code
  5. Restart computer for good measure
  6. Reinstall VSCode
  7. Open VSCode
  8. Open your python project
  9. Install python extension
  10. Confirm things are now working
  11. Reinstall code CLI
  12. Move those config backups back
    cp ~/vscode-backup/settings.json "$HOME/Library/Application Support/Code/User" 
    cp ~/vscode-backup/tasks.json "$HOME/Library/Application Support/Code/User" 
    cp ~/vscode-backup/keybindings.json "$HOME/Library/Application Support/Code/User" 
  13. Check that things are still working
  14. Reinstall extensions manually as you notice they're missing, doing a window reload after each one to confirm things haven't broken again. You could look in ~/vscode-backup/installed-extensions.txt to see what you had before or even use a script like in microsoft/vscode-python#24839 (comment) to automatically reinstall all of them, but it felt good to have a clean slate and only install the stuff I notice is missing 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment