claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude Code integration with VS Code not working on Windows

Open JoshHeitzman opened this issue 7 months ago • 30 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.2 (Claude Code)
  • Operating System: Windows 10
  • Terminal: Ubuntu WSL terminal

Bug Description

Claude isn't integrated with Visual Studio Code just like it doesn't with PyCharm. The impression I've gotten is that Claude will install it's extension, since the installation instructions just says: "Run claude - the extension will auto-install". I've search the VS Code marketplace and there isn't extension there from Anthropic to install manually. I asked Claude and it hallucinated a marketplace link that was a 404.

Steps to Reproduce

  1. In Ubuntu WSL terminal: sudo npm install -g @anthropic-ai/claude-code
  2. In Ubuntu WSL terminal: claude config set -g autoUpdaterStatus disabled
  3. In Visual Studio Code Ubuntu WSL terminal: claude
  4. /ide

Expected Behavior

Says something about being integrated with Visual Studio Code.

Actual Behavior

This output: Select IDE
Connect to an IDE for integrated development features.

No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.

Additional Context

I've attempted to contact support, but haven't been emailed yet. I also tried installing PyCharm, your plug-in for it, and then using Claude Code from the Ubuntu WSL terminal there. That didn't work and lead me to the existing issue about that not working. Couldn't find an existing issue for VS Code not working on Windows, so opened this.

JoshHeitzman avatar May 23 '25 22:05 JoshHeitzman

Found the same issue @JoshHeitzman reported.

  Select IDE                                                                                                                                                       │
│  Connect to an IDE for integrated development features.                                                                                                           │
│                                                                                                                                                                   │
│  No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running. 

My environment VS Code version: Version: 1.100.2 (user setup) Commit: 848b80aeb52026648a8ff9f7c45a9b0a80641e2e Date: 2025-05-14T21:47:40.416Z Electron: 34.5.1 ElectronBuildId: 11369351 Chromium: 132.0.6834.210 Node.js: 20.19.0 V8: 13.2.152.41-electron.0 OS: Windows_NT x64 10.0.19045

Ubuntu in WSL2: Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy

WSL version: WSL version: 2.4.13.0 Kernel version: 5.15.167.4-1 WSLg version: 1.0.65 MSRDC version: 1.2.5716 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.19045.5854

aaronamm avatar May 24 '25 07:05 aaronamm

Same issue here, I use Claude Code via WSL2 on Windows 11, installed the extension manually. When I launch claude and /ide, it doesn't detect it.

Select IDE                                                                                                      │
│  Connect to an IDE for integrated development features.                                                          │
│                                                                                                                  │
│  No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is         │
│  running.      

visata avatar May 24 '25 12:05 visata

Just locate the folder where Claude Code is installed on your WSL, do a search for @anthropic-ai in your Linux on windows file explorer and you'll find the extension in a path similar to this one: "\wsl.localhost\Ubuntu-24.04\home[linuxUser].nvm\versions\node\v22.16.0\lib\node_modules@anthropic-ai\claude-code\vendor\claude-code.vsix"

Just use the command code --install-extension "\wsl.localhost\Ubuntu-24.04\home[linuxUser].nvm\versions\node\v22.16.0\lib\node_modules@anthropic-ai\claude-code\vendor\claude-code.vsix"

idaliopessoa avatar May 24 '25 16:05 idaliopessoa

@idaliopessoa I found that file at: ./usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

the install appeared to be successful: /$ code --install-extension ./usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix Installing extensions... Extension 'claude-code.vsix' was successfully installed.

Fired up VS Code (from Windows) again, switched to the extension tab, but there wasn't a new extension in the list. Still getting the same "No available IDEs detected" from /ide when running claude in the Ubuntu WSL terminal in VS Code.

I went to the Ubuntu WSL terminal at the Windows level (i.e. not in VS Code) and used code to start VS Code from there. Opened a new terminal (called bash in this case not Ubuntu) and started claude. This time /ide was able to find and connect to VS Code.

Unfortunately VS Code started from WSL is useless for working on workspace setup for doing development on actual Windows.

JoshHeitzman avatar May 24 '25 17:05 JoshHeitzman

Just followed what @idaliopessoa suggested and it works. Thank you so much. Here are what I did. In WSL2: Find a path of your claude-code.vsix my is under .nvm folder because I use NVM and node 22.16.0 .nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

In WSL (Windows Terminal or other terminals), install the extension with the following command:

 $ code --install-extension .nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

Then open VS Code, launch integrated terminal:

$ code .

Then in VS Code integrated terminal:

claude
/ide 

Image

aaronamm avatar May 24 '25 17:05 aaronamm

Have same issue

Enviorment: Version: 0.50.7 (user setup) VSCode Version: 1.96.2 Commit: 02270c8441bdc4b2fdbc30e6f470a589ec78d600 Date: 2025-05-24T18:32:30.918Z Electron: 34.3.4 Chromium: 132.0.6834.210 Node.js: 20.18.3 V8: 13.2.152.41-electron.0 OS: Windows_NT x64 10.0.22631

The solution above works, but it makes Claude Code unusable in many cases.

CoderF3ff avatar May 25 '25 11:05 CoderF3ff

These steps seem to work for me...

  1. Launch Windsurf as normal windows app (icon in task bar, etc.).
  2. Once launched, click the >< in lower left and select Connect to WSL.
  3. Open Terminal within Windsurf (will default to home dir), navigate to /mnt/c/... (path to project)... then run claude from project dir.
  4. I see IDE Connected message and /ide shows Windsurf.

Note: First time I ran claude, I think I got prompted or it auto installed the claude code extension in Windsurf.

ben-vargas avatar May 27 '25 22:05 ben-vargas

@igorkofman solution above (https://github.com/anthropics/claude-code/issues/1276#issuecomment-2906940003) stops working for Claude Code v1.0.5 After downgrading to 1.0.3, it may be used, but Claude automatically updates it to 1.0.5, so it's not working again :)

IDE: Cursor latest stable Claude code extension installed v1.0.5

Enviroment: Version: 0.50.7 (user setup) VSCode Version: 1.96.2 Date: 2025-05-24T18:32:30.918Z Electron: 34.3.4 Chromium: 132.0.6834.210 Node.js: 20.18.3 V8: 13.2.152.41-electron.0 OS: Windows_NT x64 10.0.22631

Image Image

CoderF3ff avatar May 29 '25 07:05 CoderF3ff

Thanks for the report @CoderF3ff - we should have a fix out today (1.0.6)

igorkofman avatar May 29 '25 16:05 igorkofman

@igorkofman it works, thank you a lot!

CoderF3ff avatar May 30 '25 06:05 CoderF3ff

These steps seem to work for me...

  1. Launch Windsurf as normal windows app (icon in task bar, etc.).
  2. Once launched, click the >< in lower left and select Connect to WSL.
  3. Open Terminal within Windsurf (will default to home dir), navigate to /mnt/c/... (path to project)... then run claude from project dir.
  4. I see IDE Connected message and /ide shows Windsurf.

Note: First time I ran claude, I think I got prompted or it auto installed the claude code extension in Windsurf.

Thank you, my friend. This method has proven to work the best.

SamatIssat avatar May 31 '25 07:05 SamatIssat

I am using 1.0.6 and having issues on Mac using nvm.

I need to manually install as follows:

cursor --install-extension ~/.nvm/versions/node/v20.18.2/lib/node_modules/\@anthropic-ai/claude-code/vendor/claude-code.vsix 

It reports the connection but still indicates a problem:

Image

danielsharvey avatar May 31 '25 12:05 danielsharvey

I'm using 1.0.6 on Mac, VSCode, and this is what helped (partially based on previous answers):

  • Asked claude code "find .vsix file in your installation folder"
  • Command Palette > Install from VSIX...
  • Select .vsix file from claude folder
  • Restart integrated terminal and launch Claude Code

persiyanov avatar Jun 01 '25 06:06 persiyanov

The same issue, I spent a few hours trying to figure this out, and ironically ended up solving it with help from Sonnet itself. I was getting the same error in my IDE terminal:

No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.

Weird thing was, if I ran Claude Code in a separate WSL terminal instead of Jetbrains Rider's one, while also having my IDE open, it would detect Rider. I could even select it, and it said the connection was successful, but still showed pink “IDE disconnected” in status message.

Here’s what ended up fixing it for me:

I added a .wslconfig file in %UserProfile% with this content:

[wsl2]
networkingMode=mirrored

But that caused another issue - my Ubuntu WSL instance no longer had the eth0 interface. Thankfully I found a helpful comment by arslantu that suggested a registry tweak:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\DisabledComponents

Set the value to 32 (Decimal)

After a reboot, everything worked - Rider showed up under /ide, the status was fine (no more "IDE disconnected"), and it now works both inside and outside the IDE's terminal.

And of course, sometimes it still doesn't detect the IDE right away, even after all that, so the classic "restart the IDE a few times" trick can actually help.

Hope this helps someone!

BnnQ avatar Jun 01 '25 22:06 BnnQ

Here’s what ended up fixing it for me:

I added a .wslconfig file in %UserProfile% with this content:

[wsl2] networkingMode=mirrored But that caused another issue - my Ubuntu WSL instance no longer had the eth0 interface. Thankfully I found a helpful comment by arslantu that suggested a registry tweak:

Great, let’s test it out. I spent two full days setting everything up — had some issues with the Android emulator. Initially, I was launching the IDE through WSL and later configured the emulator separately, which finally worked. But then my system started lagging badly, even though it’s a powerful machine. So I decided to install Ubuntu, but it felt too heavy. Eventually, I switched to Linux Mint — and I’m really satisfied. It’s not Windows, of course, but now I can work smoothly with Claude Code, the IDE, and the emulator all running without issues.

SamatIssat avatar Jun 02 '25 15:06 SamatIssat

We've shipped improvements to WSL support and would love to hear if its working better for folks with the latest version of claude (you may have to restart the extension after the new version of claude installs the latest extension).

igorkofman avatar Jun 03 '25 16:06 igorkofman

We've shipped improvements to WSL support and would love to hear if its working better for folks with the latest version of claude (you may have to restart the extension after the new version of claude installs the latest extension).

@igorkofman At this point is it expected that one can start Visual Studio Code from Windows, open the Ubuntu (or whatever distribution one installed for WSL) terminal, type in claude and expect /ide to connect with VS Code? Or is it only expected to work if one opens a WSL terminal from Windows, types in code to start VS Code from WSL, and use the terminal in VS Code to start Claude?

JoshHeitzman avatar Jun 04 '25 19:06 JoshHeitzman

We've shipped improvements to WSL support and would love to hear if its working better for folks with the latest version of claude (you may have to restart the extension after the new version of claude installs the latest extension).

@igorkofman v1.0.11 is integrating with VS Code more poorly then v1.0.2. Back on May 24 (details in this thread) I was at least able to get the integration working when VS Code was started via the code command in the Ubuntu WSL prompt and then claude was started in the Ubuntu WSL terminal in VS Code. After updating claude via npm I manually installed claude's .vsix again. Now I'm getting no ides detected after several restarts of VS Code.

JoshHeitzman avatar Jun 05 '25 16:06 JoshHeitzman

We've shipped improvements to WSL support and would love to hear if its working better for folks with the latest version of claude (you may have to restart the extension after the new version of claude installs the latest extension).

@igorkofman v1.0.11 is integrating with VS Code more poorly then v1.0.2. Back on May 24 (details in this thread) I was at least able to get the integration working when VS Code was started via the code command in the Ubuntu WSL prompt and then claude was started in the Ubuntu WSL terminal in VS Code. After updating claude via npm I manually installed claude's .vsix again. Now I'm getting no ides detected after several restarts of VS Code.

When you launch VS Code regularly in Windows, are you using the >< in the lower left to connect to the WSL? With that connected (I use ubuntu), launching claude code from another WSL terminal window, or the terminal inside windsurf (should be same as VS Code), it connects fine. I've never had to manually install the extension... when both windsurf/vscode and claude code are both running on WSL, the communication works and extension auto installs if not there.

ben-vargas avatar Jun 05 '25 17:06 ben-vargas

When you launch VS Code regularly in Windows, are you using the >< in the lower left to connect to the WSL? With that connected (I use ubuntu), launching claude code from another WSL terminal window, or the terminal inside windsurf (should be same as VS Code), it connects fine. I've never had to manually install the extension... when both windsurf/vscode and claude code are both running on WSL, the communication works and extension auto installs if not there.

@ben-vargas Thanks! I was not using that. But using that relatively obscure GUI element relaunched VS Code in what seems to be a proper WSL mode. It was nearly two weeks ago when I last tried this. At the time starting VS Code from an Ubuntu WSL prompt via the code command seemed to start VS Code in a proper WSL mode, but its definitely not doing that today. Now I'm seeing the same thing you are in that claude is able to find the WSL VS Code when it run in a WSL terminal regardless of whether the terminal was started directly on Windows or in VS Code.

Doesn't feel like there has been any improvement since 1.0.2 though. Still get nothing when running a Windows mode VS Code.

JoshHeitzman avatar Jun 05 '25 17:06 JoshHeitzman

@ben-vargas Thanks! I was not using that. But using that relatively obscure GUI element relaunched VS Code in what seems to be a proper WSL mode. It was nearly two weeks ago when I last tried this. At the time starting VS Code from an Ubuntu WSL prompt via the code command seemed to start VS Code in a proper WSL mode, but its definitely not doing that today. Now I'm seeing the same thing you are in that claude is able to find the WSL VS Code when it run in a WSL terminal regardless of whether the terminal was started directly on Windows or in VS Code.

Doesn't feel like there has been any improvement since 1.0.2 though. Still get nothing when running a Windows mode VS Code.

@JoshHeitzman - Yeah, I found that last week and commented in the issue thread above... like you I found that when using windsurf from a WSL terminal window to launch windsurf, it wasn't launching/connecting correctly, as if it was actually launching not connected to the WSL (pretty much confirmed because open folder shows windows file structure, not the linux WSL paths).

By far the most consistent method for me has been to make sure windsurf (or cursor, or vsc) is running in WSL mode (connection?) with that little obscure icon, then claude code in WSL seems to have no problem integrating. Agree, still not ideal because I haven't seen this requirement/need documented anywhere in the docs, so people don't know about it.

ben-vargas avatar Jun 05 '25 18:06 ben-vargas

I saw a lot of tool errors from Opus when I first started using it while connected to VS Code in WSL. The errors were not specific enough to say if they were IDE specific tools, but Opus was stuck in a loop until I told it couple of times that it was stuck and that tool wasn't going to work for it. It generally stopped having tool errors after that and definitely didn't get stuck in a loop of tool errors again (today at least). When I switch to Sonnet I see some occasional tool error there too, but not a sticky loop. Tomorrow I'll try things in a WSL prompt without being connected to VS Code and see if similar issues occur.

JoshHeitzman avatar Jun 06 '25 01:06 JoshHeitzman

We've identified the WSL2.0 issues and will have a fix shortly

igorkofman avatar Jun 06 '25 01:06 igorkofman

FYI for Arch Linux installation via the AUR the plugin is available at:

/usr/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

install via:

code --install-extension /usr/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix

Then run /ide in vscode terminal

Bad3r avatar Jun 06 '25 05:06 Bad3r

Thank you @ben-vargas It worked for me on VS Code

These steps seem to work for me...

  1. Launch Windsurf as normal windows app (icon in task bar, etc.).
  2. Once launched, click the _><_ in lower left and select _Connect to WSL_.
  3. Open Terminal within Windsurf (will default to home dir), navigate to /mnt/c/... (path to project)... then run _claude_ from project dir.
  4. I see IDE Connected message and /ide shows Windsurf.

Note: First time I ran claude, I think I got prompted or it auto installed the claude code extension in Windsurf.

neil-rubens avatar Jun 10 '25 12:06 neil-rubens

Just last night something force my vscode window loading and then the claude button on the top right (tab option) has disappeared. /ide says its connected to vscode however the button has gone.

ashrodan avatar Jun 14 '25 03:06 ashrodan

What worked for me was properly adding Cursor’s Windows path to my ~/.bashrc. I added the following line:

export PATH="$PATH:/mnt/c/Users/{user}/AppData/Local/Programs/cursor/resources/app/bin"

After that, I opened Cursor from the Windows Terminal inside WSL (Ubuntu, in my case), then launched Claude — and voilà, it worked!

It’s actually a mix of different solutions from this thread, and in the end, it's fairly simple once you understand the reasoning behind each step.

Bonus: Claude now even works when I open Cursor directly from Windows — no need to launch it through the terminal anymore.

AntoineArt avatar Jun 14 '25 20:06 AntoineArt

Going into WSL with VS code is not an option for my .NET project as I need to build and run on Windows. Is there any plan to make claude code work with VS code without running WSL?

anose001 avatar Jun 15 '25 20:06 anose001

FYI for Arch Linux installation via the AUR the plugin is available at:

/usr/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix install via:

code --install-extension /usr/lib/node_modules/@anthropic-ai/claude-code/vendor/claude-code.vsix Then run /ide in vscode terminal

minor addition: if you use profiles in VSCode you might want to add ... --profile "PROFILENAME" to the command above, otherwise it would be added to Default profile only. Took me some time to figure this out...

GeorgeNikitinNV avatar Jun 19 '25 01:06 GeorgeNikitinNV

This issue is still present on MacOS and Claude Code for VSCode version 10.0.35. None of the above mentioned fixes work.

StrawIII avatar Jun 28 '25 09:06 StrawIII