Why is this such a painfully annoying process, I've been at it for hours FFS Answer from Deleted User on reddit.com
🌐
Reddit
reddit.com › r/claudeai › how to use claude code in vs code in windows via wsl
r/ClaudeAI on Reddit: How to use Claude Code in Vs Code in Windows via WSL
May 25, 2025 -

What a title. Anyways, figured I'd make a quick little guide on how to do this.

Prerequisites:

  • VS Code

  • Git repository (not an actual requirement, just how I did it with my limited bash knowledge)

Steps

1. Open up PowerShell and install WSL with:

cmd
wsl --install

2. Set Ubuntu as default (important!):

cmd
wsl --set-default Ubuntu

3. Open a WSL terminal

Tip: check the upper left dropdown menu in Windows Terminal that will show various terminals available

4. Install Claude Code in the WSL terminal (if you have issues, please refer to Anthropic's guide):

bash
npx u/anthropic-ai/claude-code

5. Make a directory for your projects:

bash
mkdir coolProjects && cd coolProjects

6. Clone your project (optional):

bash
git clone https://github.com/yourrepo.git

7. Open VS Code

8. Install the official WSL extension

9. Press F1

10. Type "WSL"

IMPORTANT

11. Select "WSL: Connect to WSL using Distro"

Choose Ubuntu.

From here you can now open a folder within VS Code.

How do you know it worked? Check the bottom left corner of VS Code - it should say "WSL: Ubuntu" and your Claude Code extension should be enabled!

Troubleshooting

If you get Alpine Linux errors or "libstdc++ required" messages: This usually happens if you have Docker Desktop installed and it became your default WSL distribution instead of Ubuntu. Run wsl --list --verbose to check, and if docker-desktop-data has an asterisk (*), run wsl --set-default Ubuntu to fix it. That's why step 2 is so important!

Hope this is helpful!

🌐
Medium
medium.com › ai-insights-cobet › comprehensive-guide-to-setting-up-claude-code-on-windows-using-wsl-d3a3f3b5a128
Comprehensive Guide to Setting Up Claude Code on Windows Using WSL | by azhar | azhar labs | Medium
March 27, 2025 - Setting up Claude Code, Anthropic’s AI-driven coding assistant, on a Windows system involves leveraging the Windows Subsystem for Linux (WSL). This approach ensures compatibility and a seamless development experience.
Discussions

Unable to install Claude code in Windows with WSL - Stack Overflow
I installed WSL on my Windows machine to try Claude's code. Everything is fine, but I still get an error. Has anyone faced the same issue? I have Windows 11. I have tested two distributions: Ubuntu... More on stackoverflow.com
🌐 stackoverflow.com
Installation Failure on Windows - Unsupported OS Error
Description: I attempted to install @anthropic-ai/claude-code on WSL using the following command: npm install -g @anthropic-ai/claude-code --force --no-os-check However, the installation failed wit... More on github.com
🌐 github.com
9
February 27, 2025
Complete WSL + Claude Code + Cursor Setup Guide for Windows
Thanks for sharing this. If someone asks in the future I will direct them towards this post. More on reddit.com
🌐 r/ClaudeAI
23
70
June 22, 2025
How to use Claude Code in Vs Code in Windows via WSL
Why is this such a painfully annoying process, I've been at it for hours FFS More on reddit.com
🌐 r/ClaudeAI
22
51
May 25, 2025
🌐
Claude
claude.ai › public › artifacts › 03a4aa0c-67b2-427f-838e-63770900bf1d
Claude Code Installation Guide for Windows 11
Claude Code is built as a command-line tool designed for Unix-like operating systems (Linux and macOS). While Windows is an excellent operating system, it handles certain technical aspects differently than Linux - things like file permissions, process management, and system calls.
🌐
JetBrains
plugins.jetbrains.com › plugin › 27310-claude-code-beta- › reviews
Claude Code [Beta] - IntelliJ IDEs Plugin | Marketplace
1 week ago - IMPORTANT: This plugin requires Claude Code to be installed separately. For more information, see claude.com/claude-code. Integrate Claude Code with your favorite...
🌐
Medium
jewelhuq.medium.com › install-wsl-claude-code-on-windows-complete-guide-2025-873bd4a29478
Install WSL & Claude Code on Windows — Complete Guide 2025 | by Md Mazaharul Huq | Medium
July 23, 2025 - Step-by-step tutorial to enable WSL on Windows, isolate Node.js with NVM, install Anthropic’s Claude Code CLI, and start coding with AI in your terminal.
🌐
Claude
claude.ai › public › artifacts › 8ad38c46-8b37-4f75-99ab-6f695ccac6f4
Complete Guide: Installing Claude Code on Windows 10
Claude Code doesn't work directly on Windows - it needs something called WSL (Windows Subsystem for Linux)
Find elsewhere
🌐
iTechs Online
itecsonline.com › post › how-to-install-claude-code-on-windows
How To Install Claude Code on Windows: Complete Guide 2025 | Blog // ITECS
July 30, 2025 - Developed by Anthropic, this innovative tool understands your entire codebase and accelerates development through natural language interactions. While Claude Code doesn't natively support Windows, this comprehensive guide will show you exactly ...
🌐
GitHub
github.com › anthropics › claude-code › issues › 188
Installation Failure on Windows - Unsupported OS Error · Issue #188 · anthropics/claude-code
February 27, 2025 - Description: I attempted to install @anthropic-ai/claude-code on WSL using the following command: npm install -g @anthropic-ai/claude-code --force --no-os-check However, the installation failed with the following error message: npm WARN ...
Published   Feb 27, 2025
🌐
Scott Spence
scottspence.com › home › posts › getting mcp server working with claude desktop in wsl
Getting MCP Server Working with Claude Desktop in WSL - Scott Spence
December 28, 2024 - In this post, I’ll go through the process of getting a Model Context Protocol (MCP) tool up and running with the Claude desktop app using Node in Windows Subsystem for Linux (WSL).
🌐
Claude
code.claude.com › docs › en › setup
Set up Claude Code - Claude Code Docs
Install, authenticate, and start using Claude Code on your development machine. ... Operating Systems: macOS 10.15+, Ubuntu 20.04+/Debian 10+, or Windows 10+ (with WSL 1, WSL 2, or Git for Windows)
🌐
JHB Software
jhb.software › articles › setup claude code inside cursor with wsl on windows
Setup Claude Code Inside Cursor with WSL on Windows - JHB Software Articles
June 22, 2025 - Learn how to install and integrate Claude Code with Cursor using WSL on Windows. This step-by-step guide covers everything from setup to full IDE integration for optimal AI-assisted development performance.
🌐
ClaudeLog
claudelog.com › home › install
ClaudeLog - Claude Code Docs, Guides, Tutorials & Best Practices
November 11, 2025 - Claude Code now supports native Windows installation via PowerShell or CMD (see Option 1 above). This provides the best experience for Windows users with: ... # In Windows: %USERPROFILE%\.wslconfig [wsl2] memory=8GB # Limit WSL2 memory usage processors=4 # Limit CPU cores swap=2GB # Set swap size localhostForwarding=true
🌐
Reddit
reddit.com › r/claudeai › complete wsl + claude code + cursor setup guide for windows
r/ClaudeAI on Reddit: Complete WSL + Claude Code + Cursor Setup Guide for Windows
June 22, 2025 -

Complete and Corrected Guide: WSL + Claude Code + Cursor Setup for Windows

Overview

This guide walks you through setting up a professional development environment with WSL2, Cursor, and command-line tools like Claude Code – based on proven best practices.

Phase 1: Windows Preparation

1. Windows Updates

  • Settings → Update & Security → Windows Update

  • Install all available updates and restart PC if needed

2. Install Important Dependencies

Open PowerShell as Administrator and ensure important developer tools are installed:

  • Visual C++ Redistributables (all common versions)

  • DirectX (current version)

These are often necessary for compiling tools (e.g., via npm or pyenv).

3. Enable WSL Features

Open PowerShell as Administrator:

powershell
# Enable WSL and Virtual Machine Platform
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart Windows: shutdown /r /t 0

Phase 2: WSL2 Installation

4. Install WSL2 (after restart)

PowerShell as Administrator:

powershell
# Install WSL2 with default distribution (Ubuntu)
wsl --install

If this doesn't work, specify explicitly: wsl --install -d Ubuntu-22.04

Restart Windows again.

5. Verify WSL2 Installation

After restart, open PowerShell:

powershell
wsl -l -v

Expected output should show VERSION as 2.

If 1 is displayed, upgrade to WSL2:

powershell
# Set WSL2 as default
wsl --set-default-version 2
# Convert existing distribution to version 2
wsl --set-version Ubuntu-22.04 2

6. Complete Ubuntu Setup

  • An Ubuntu terminal window opens automatically

  • Create a username (lowercase, no spaces)

  • Create a password

  • Wait for installation to complete

7. Update Ubuntu

In Ubuntu terminal:

bash
sudo apt update && sudo apt upgrade -y

Phase 3: Install Developer Tools in WSL

8. Install Essential Tools

In Ubuntu terminal:

bash
# Git, Curl and Build Tools
sudo apt install git curl build-essential -y

# Python dependencies
sudo apt install python3-pip python3-venv -y

9. Configure Git

bashgit config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main

10. Install Python with pyenv (in WSL)

Install pyenv dependencies:

bashsudo apt install make libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
libffi-dev liblzma-dev -y

Install pyenv:

bash
curl https://pyenv.run | bash

Add pyenv to shell and reload:

bashecho 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
source ~/.bashrc

Install a Python version and set as default:

bashpyenv install 3.11.8
pyenv global 3.11.8

11. Install Node.js with nvm (in WSL)

[NOTE] We use the officially recommended command to always get the latest nvm installation script.

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

Reload shell so nvm is available:

bash
source ~/.bashrc

Install latest LTS version of Node.js and use it:

bashnvm install --lts
nvm use --lts

Phase 4: Cursor Installation and Configuration

12. Install Cursor on Windows

Download Cursor from the official website and install it.

13. Install Important Cursor Extensions

In Cursor via Ctrl + Shift + X:

  • Remote - WSL (ms-vscode-remote.remote-wsl)

  • Remote Development (ms-vscode-remote.vscode-remote-extensionpack)

  • Python (ms-python.python)

  • Prettier (esbenp.prettier-vscode)

14. Configure Cursor WSL Settings

Ctrl + , → Settings, search and set:

json{
    "terminal.integrated.defaultProfile.windows": "WSL",
    "terminal.integrated.cwd": "~/dev/projects"
}

[NOTE] The setting remote.WSL.fileWatcher.polling is usually no longer needed and can cause high CPU usage. Only add it if you notice that file changes aren't being detected.

Phase 5: Set Up Project Structure

15. Create Project Structure in WSL

bash
# Main development folder
mkdir -p ~/dev/projects

[NOTE] You can create additional subfolders as needed.

16. Set Up Default Terminal Path and Aliases

bash
# Edit .bashrc
nano ~/.bashrc

Add the following at the end of the file:

bash
# Change to project folder when opening a new terminal
cd ~/dev/projects

# Useful aliases
alias dev='cd ~/dev/projects'
alias home='cd ~'

Save: Ctrl + O, Enter, Ctrl + X. Reload: source ~/.bashrc

Phase 6: Claude Code Installation

17. Install Claude Code

bash
# Switch to any folder, e.g., the project folder
cd ~/dev/projects

# Install Claude Code globally (DO NOT use sudo)
npm install -g @anthropic-ai/claude-code

18. Claude Code Setup and Authentication

After installation, set up Claude Code with these specific steps:

A. Navigate to your project directory

bash
cd ~/dev/projects

B. Start Claude Code

bash
claude

C. Complete Authentication

When you first run claude, you'll see authentication options:

  1. Anthropic Console (Pay-as-you-go):

    • Choose this option if you want to pay per API usage

    • Requires active billing at console.anthropic.com

    • Claude will open a browser window for OAuth authentication

    • If you're in WSL without GUI, the URL will be printed in terminal

    • Open the URL on any computer and sign in with your Anthropic credentials

  2. Claude App (Pro/Max Plan):

    • Choose this if you have a Claude Pro ($20/month) or Max ($100-200/month) subscription

    • Log in with your Claude.ai account credentials

    • This provides a unified subscription for both Claude Code and web interface

D. IDE Integration (Automatic)

For VS Code/Cursor integration:

  1. Automatic Extension Installation:

    • When you run claude from within VS Code/Cursor's integrated terminal, the IDE extension is installed automatically

    • No manual installation steps required

  2. Access Claude Code in VS Code/Cursor:

    • Open VS Code/Cursor in your project folder

    • Run claude in the integrated terminal (Ctrl + Shift + `)

    • Look for the Claude icon that appears in the activity bar, or

    • Press Ctrl+ESC (Windows/Linux) or Cmd+ESC (Mac)

    • This opens Claude Code in a WebView panel within your IDE

E. Test the Installation

bash
# Check if Claude Code is working
claude --version

# Start an interactive session
claude

# In the Claude Code interface, try:
/help

F. Initial Project Setup (Recommended)

bash
# Generate a project guide (helps Claude understand your codebase)
# In Claude Code session, ask:
"Please create a CLAUDE.md file that documents this project structure and setup"

# Commit the generated file
git add CLAUDE.md
git commit -m "Add Claude Code project documentation"

Phase 7: Test Cursor-WSL Integration

19. Connect Cursor to WSL

  • Open Cursor

  • Click the green >< icon in the bottom left and select "Connect to WSL"

20. Open Workspace in WSL

In WSL terminal:

bash
# Navigate to your project folder
dev 
# Use alias

# Open Cursor in current directory
code .

Verification: Cursor opens and shows "WSL: Ubuntu-22.04" in the bottom left. The integrated terminal (Ctrl + Shift + ) shows a Linux prompt ($`).

Phase 8: Test the Entire Environment

21. Check Versions

In Cursor WSL terminal:

bashgit --version
python --version  
# Should show the pyenv version
node --version    
# Should show the nvm version
npm --version

22. Check Paths

bashwhich python  
# Should point to pyenv shim path
which node    
# Should point to nvm path
pwd           
# Should be /home/username/dev/projects

23. Test with Python Virtual Environment

bashmkdir test-python && cd test-python
python -m venv venv
source venv/bin/activate
pip list
deactivate
cd .. && rm -rf test-python

Troubleshooting (Updated)

command not found: claude-code

  • Ensure you used the correct package name with npm install -g <package-name>

  • Check if nvm is loaded correctly (nvm current should show a version)

EACCES errors with npm install -g

[CORRECTION] This error should not occur with this guide. If it does, nvm is not active correctly. Ensure the nvm lines are in your .bashrc and you've run source ~/.bashrc. Never run npm with sudo when using nvm.

Issues with Cursor-WSL Integration

  • Restart WSL: wsl --shutdown in PowerShell, then reopen Ubuntu

  • Reset remote caches in Cursor: Ctrl + Shift + P → "Remote-WSL: Kill WSL Server"

Completion Checklist

✅ WSL2 enabled and Ubuntu installed & updated
✅ Git configured
✅ Python installed with pyenv
✅ Node.js installed with nvm (correct method, no manual npm prefix)
✅ Cursor installed with WSL extensions
✅ Project structure created
✅ "Claude Code" (or other tool) correctly installed
✅ Cursor-WSL integration working
✅ All tests successful

🎉 Installation Complete!

[IMPORTANT] Never use sudo with npm when nvm is installed, as this can cause permission issues and security risks.

[CORRECTION] This section replaces the erroneous "Configure NPM without sudo" phase. nvm already handles this correctly.

🌐
Medium
medium.com › @joe.njenga › 47-claude-code-wsl-tricks-every-windows-user-should-know-5d42aaee2d93
47 Claude Code WSL Tricks Every Windows User Should Know | by Joe Njenga | Medium
July 13, 2025 - Getting Claude Code running optimally requires more than just a simple installation. Unlike macOS or native Linux environments, Windows users must navigate the Windows Subsystem for Linux (WSL) to unlock Claude Code’s full potential.