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!
Step 1: Open cmd
Open cmd as administrator
Step 2: Set NPM configuration, telling npm to ignore executing scripts in packages during installation (e.g., preinstall, postinstall, etc.)
setx NPM_CONFIG_IGNORE_SCRIPTS true
$env:NPM_CONFIG_IGNORE_SCRIPTS = “true”
Step 3: Configure the SHELL environment variable
setx SHELL "C:\Program Files\Git\bin\bash.exe"
Step 4: Install Claude Code
npm install -g @anthropic-ai/claude-code
Step 5: Add to Environment Variables
Add this line to your environment variables:
C:\Users\y.xie\.npm-global
Step 6: Restart the development environment
Restart CMD or your IDE (e.g., VS Code, IntelliJ IDEA), then log in to your Claude Code account or configure the API directly within the application to start using it.
Supplementary Notes
Ensure Git for Windows is installed, with the path being
C:\Program Files\Git\bin\bash.exe.If the Git installation path is different, please adjust the SHELL environment variable path accordingly.
The path
C:\Users\y.xie\.npm-globalshould also be added based on your actual path.It is recommended to set these variables permanently to avoid having to reconfigure after each restart.
Later, if you want to uninstall and revert the changes from Step Two and Step Three, just execute
setx NPM_CONFIG_IGNORE_SCRIPTS falseandsetx SHELL "".
Videos
I've been diving into Claude Code lately and noticed some interesting performance differences between running it on native Linux Ubuntu versus WSL2 on Windows. I wanted to share what I've found and get your thoughts/experiences.
What I've discovered so far:
Native Linux seems to win on:
Overall stability during long coding sessions
Faster file I/O operations
Fewer random tool execution errors
Smoother handling of large refactoring tasks
WSL2 struggles with:
Cross-filesystem operations (especially accessing
/mnt/c/)Memory management during intensive tasks
Occasional unexpected terminations
My setup comparison:
Native Ubuntu: Runs like butter, rarely crashes
WSL2: Works fine for light tasks, but gets flaky with bigger projects
Questions for the community:
What's your go-to environment for Claude Code? Any particular distro recommendations?
WSL2 users: Have you found ways to improve stability? Any specific configurations that help?
Performance tips: What tweaks have made the biggest difference for you?
Windows users: Is the convenience of staying in Windows worth the potential reliability trade-offs for your workflow?
I'm particularly curious about experiences with large codebases or resource-heavy development work.
TL;DR: Native Linux seems more reliable for Claude Code, but wondering if others have found ways to make WSL2 work just as well.
What's been your experience? Any tips or tricks to share?
Posted this because I couldn't find much recent discussion on this topic and figured the community wisdom would be valuable!
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:
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
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:
Automatic Extension Installation:
When you run
claudefrom within VS Code/Cursor's integrated terminal, the IDE extension is installed automaticallyNo manual installation steps required
Access Claude Code in VS Code/Cursor:
Open VS Code/Cursor in your project folder
Run
claudein the integrated terminal (Ctrl + Shift + `)Look for the Claude icon that appears in the activity bar, or
Press
Ctrl+ESC(Windows/Linux) orCmd+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 currentshould 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 --shutdownin PowerShell, then reopen UbuntuReset 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.
Claude Code just feels different. It's the only setup where the best coding model and the product are tightly integrated. "Taste" is thrown around a lot these days, but the UX here genuinely earns it: minimalist, surfaces just the right information at the right time, never overwhelms you.
Cursor can't match it because its harness bends around wildly different models, so even the same model doesn't perform as well there.
Gemini 3 Pro overthinks everything, and Gemini CLI is just a worse product. I'd bet far fewer Google engineers use it compared to Anthropic employees "antfooding" Claude Code.
Codex (GPT-5.1 Codex Max) is a powerful sledgehammer and amazing value at 20$ but too slow for real agentic loops where you need quick tool calls and tight back-and-forth. In my experience, it also gets stuck more often.
Claude Code with Opus 4.5 is the premium developer experience right now. As the makers of CC put it in this interview, you can tell it's built by people who use it every day and are laser focused on winning the "premium" developer market.
I haven't tried Opencode or Factory Droid yet though. Anyone else try them and prefer them to CC?
"Claude Code is not supported on Windows."
npm error Claude Code requires macOS or Linux to run properly.
After getting an email from Anthropic today I tried to install Claude Code and got this error.
I was also skeptical that is would spend a lot of tokens. Is this true? Does it not run a PC?
Does anyone have a reliable good IDE I can use to vibe code?
I've tried Windsurf and Cursor with very mixed results. I was hopeful that an MCP might help also but they seem very flaky on PCs. All the demos of them that work are on Macs.
Does anyone have any suggestions.
Thank you.
I saw there's no documentation online for this problem, so here's what Claude figured out in case it happens to someone else:
THE PROBLEM: You type claude in WSL and when you say somehting it just hangs forever, after 5 minutes still no response and no reaction, nothing.
CLAUDE'S FIX:
Step 1: Fix Windows Time Open Command Prompt as Administrator and copy-paste these one by one:
net start w32time w32tm /register w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com" w32tm /resync /force
Step 2: Fix WSL and Clean Config Back in WSL terminal, copy-paste:
sudo hwclock -s rm -rf ~/.claude* rm -f /tmp/claude-shell-snapshot-* claude
Should work immediately.
If still broken:
wsl --shutdown wsl --unregister Ubuntu wsl --install Ubuntu
CLAUDE EXPLAINS:
We initially thought it was network issues, VPN conflicts, IPv6 problems, corrupted npm/Node.js, API key problems, WSL networking bugs, account issues, firewall blocking, DNS issues, or SSL certificate problems. None of those were it.
The actual problem: Windows Time service stops working and WSL inherits the broken time. Claude Code validates auth tokens using system timestamps and just hangs forever when the clock is off instead of showing an error.
Claude noticed the config files had timestamps from the "future" which led us to check system time. Once we synced the clock, everything worked.
This happens because most apps don't care about small time differences, but Claude Code is very strict about timestamp validation and has poor error handling for this case.
Writed by Claude
Tested in Windows 11 + WSL Ubuntu
Personal comment: 'anger'
Been using Claude Code + Claude Chrome integration for the past weekend. It has just amazed me. Just wanted to share this quick setup guide while using it.
What it actually does:
Claude Code (terminal) connects to a Claude Chrome extension. So you can write code in terminal, then have Claude open it in Chrome, read console errors, click around, and fix the code. All without copy-pasting anything.
Now Claude can:
Open URLs in your browser
Click buttons, fill forms
Read console errors and DOM state
Take screenshots and record GIFs
Work with authenticated sites (Gmail, Notion, Sheets) using YOUR existing login No APIs. No tokens. Just your browser session.
Prerequisites
Before starting, you need:
[ ] Google Chrome browser
[ ] Paid Claude account (Pro, Team, or Enterprise)
[ ] Claude in Chrome Extension (Version 1.0.36 or higher)
[ ] Claude Code CLI (Version 2.0.73 or higher)
⚠️ Windows users: WSL is not supported for Chrome integration. Run Claude Code in regular Windowss
Setup (5 Minutes)
Step 1: Install Claude Code or update
Open your terminal and run:
curl -fsSL <https://claude.ai/install.sh> | bash
Verify installation:
claude --version
Execute update command if version is not correct or already installed
claude --update
Step 2: Install Chrome Extension
Open Chrome and go to the Chrome Web Store
Search for "Claude" or use the direct link
Click "Add to Chrome"
Click the puzzle piece icon in toolbar → find Claude → click pin
Click the Claude icon and sign in with your Claude account
Step 3: Connect Claude Code to Chrome
In your terminal, run Claude Code with the chrome flag:
claude --chrome
The --chrome flag tells Claude Code to connect to the browser extension.
Step 4: Verify the Connection
Inside Claude Code, type:
/chrome
You should see: Chrome integration: Enabled
Quick Test
Test with this prompt:
Open google.com, click the search field, type "Claude Code tutorial", and tell me what autocomplete suggestions appear.
Watch Chrome as Claude:
Opens Google
Clicks the search field
Types the query
Reads the autocomplete suggestions
Terminal and browser are connected.
Multi-Site Automation
I need you to do a multi-site workflow: 1. Open Google Sheets at sheets.google.com 2. Create a new blank spreadsheet 3. Rename it to "Latest AI News" 4. In the first row, add headers: Title, URL, Summary 5. Open Hacker News at news.ycombinator.com in a new tab 6. Extract the titles and URLs of the top 10 stories 7. Format them as a markdown list 8. Go back to the Google Sheet 9. Add them as a new row with their information 10. Tell me when you're done and give me the Sheet URL Work through this step by step. If you hit any login pages, let me know and I'll handle them.
What Claude does: Creates spreadsheet, searches LinkedIn, extracts data, populates rows.
Key insight: No APIs needed. Claude uses your existing logged-in browser session.
Limitations
Current constraints:
Chrome only (no Arc, Firefox, Safari)
WSL not supported on Windows
No headless mode — browser must be visible
JavaScript modal dialogs (alert/confirm) can interrupt flow
What NOT to use this for:
❌ Financial transactions
❌ Password management
❌ Production deployments without supervision
Remember: Claude uses your logged-in session. Whatever you're logged into, Claude can access. Supervise it.
Anyone else experimenting with this? What workflows are you building?
I put together a more detailed Notion guide with the full prompts and a video walkthrough if anyone wants to go deeper. Happy to share.
Anyone meet this issue? I use Claude code in wsl2 not mount ( in ~/code not /mnt/c...) and wsl network mode is mirror, about last two months, when I starting using Claude code, my entire network become very slow include other operation in windows. For ex, before using Claude code everything is fine, but after even when surf at social media those auto play videos are intermittent, the zoom meeting lose connection, etc...
Hello,
I was struggling to get Claude Code working on Windows with my .NET projects while maintaining proper IDE support. The core problem is that Claude Code requires WSL to run on Windows. If you copy your project files into a WSL folder, you lose crucial IDE integration.
Here's the correct way to do it without copying your code into a WSL folder (if you weren't already aware, like me!):
Open your favorite IDE and your project.
Open the terminal within your IDE.
Navigate to your project directory (e.g.,
C:\MyProject).Type the following command:
wsl claude
Enjoy!
I wanted to check with everybody else in here to see if they have noticed the same thing, but up until just yesterday I had been running Claude Code in WSL on Windows 11.
This morning I decided to go ahead with an SSH/Tailscale/Docker-Linux setup and I'm trying Claude code this way.
It seems to be FAR more stable (without anywhere close to as many tool errors as in WSL), and the run time seems to be far longer per prompt. In a good way; as it seems to have superior output. It was able to follow a very long refactor plan I had here in 1 go; which I use to test local LLM tool calls.
I'm about to do some extensive testing since it's about to wrap up, but just based on the planning document that we made, and what I have seen it do so far--it seems like it's following the plan to a T.
Which is pretty crazy considering the run time. In this screenshot it's been running for over 43 minutes.
I'll report back on how well it actually did, but even more impressed if just switching to a full Linux environment actually helped this much, lol.
Disclaimer: This post was written with the help of an AI assistant.
I've been using CC for a few months now but today, it suddenly said "Command not found"
Running these commands helped (with the help of Gemini)
Just paste these commands into your WSL terminal one by one.
The Fix (4 Commands)
1. Download the Claude program:
curl -L --progress-bar -o claude-binary https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d5f6/claude-code-releases/2.0.37/linux-x64/claude
2. Create the right folders and move the file:
mkdir -p ~/.claude/bin && mv claude-binary ~/.claude/bin/claude
3. Make it runnable:
chmod +x ~/.claude/bin/claude
4. Add it to your PATH so you can run it from anywhere:
echo 'export PATH="$HOME/.claude/bin:$PATH"' >> ~/.bashrc
FINAL STEP: Activate It
You MUST do one of these two things for the claude command to work:
Close and re-open your WSL terminal. (Easiest)
Or, run
source ~/.bashrc
Now the claude command will work. Hope this helps someone
Hey everyone,
Since Claude Code has been around for a while now and many of us are already familiar with Claude Sonnet 3.7, I wanted to share a quick step-by-step guide for those who haven’t had time to explore it yet.
This guide sums up everything you need to know about Claude Code, including:
How to install and set it up
The benefits and when to use it
A demo of its capabilities in action
Some Claude Code essential commands
I think Claude Code is a better alternative to coding assistants like Cursor and Bolt, especially for developers who want an AI that really understands the entire codebase instead of just suggesting lines.
https://medium.com/p/how-to-install-and-use-claude-code-the-new-agentic-coding-tool-d03fd7f677bc?source=social.tw
Starting this morning, Claude Code is broken in my terminal, both with output and input. I can't get it to do anything, and the enter key just injects newlines so it won't parse my input. This is happening with every terminal app I have. Anyone else experiencing this?
Hello everyone
I am using Windows 11 with WSL2. I installed claude code as instruction, and now if I type
```claude```
Nothing happened.
But if I press Ctrl-C, the full UI of Claude Code will appear, but now I cannot do anything because I already Ctrl-C
Do you have the same issue? I am not quite sure how to fix.
I already did
claude migrate-installer
but same issue - nothing happens until I do Ctrl-C.
I know you can install wsl but im curious as to why they still havent made claude code available on windows natively. It is the most popular computer OS, so its kinda weird that they make it for ios and linux but not windows. Anyone know if a windows release date is coming soon?
Development setup is Claude installed on Windows + all code/development in WSL. E.g. filesystem MCP works (using wsl.exe to wrap) - but I think I'm missing out on native shell integration - e.g. it can't run commands, only what filesystem MCP gives it. I can't find any way to get this to work - is there a better way to work?
I signed up for the $200 plan becuase i saw claude code turns out it doesnt work in windows. You dont find out until after have paid and find out from the installer error message. They say oh use wsl, that doesnt work either just gives another errors says click here to fix it which links to page that doesnt even mention the issue. Wasted $200 for absolutely nothing.
Hi everyone, I'm James from Korea and this is my first post on Reddit.
I’d like to share an extension I developed: Claude Code Assistant (WSL).
On Windows, Claude Code (and IDE integration) doesn’t work properly unless you’re already connected to WSL. Also, for people like me — who didn’t come from a traditional developer background and only started coding after the rise of AI — using the CLI can feel unfamiliar and uncomfortable at first.
So, I built this extension to make things easier.
Main features:
-
Claude Code launches automatically when you connect to WSL
-
You can type commands in the extension command input box and press Send or Ctrl+Enter to send them directly to the CLI
-
The Clear button wipes both the command input and the CLI display
-
The New button opens a fresh Claude Code session
-
You can browse folders and files in an Explorer-style view (if you select a path from the Windows side, it automatically converts it to the corresponding WSL path))
Hope this helps others who are getting started with AI-assisted coding on WSL!
Any feedback is more than welcome — the more, the better. Please feel free to share your thoughts, suggestions, or anything I might improve!