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

[BUG] Claude Code does not detect Jetbrains IDE on Windows WSL

Open masda70 opened this issue 8 months ago • 98 comments

Environment

  • Platform (select one):
    • [X] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.0
  • Operating System: Windows 10 - WSL 2.2.4.0 with Ubuntu 22.04
  • Terminal: bash over WSL launched from Powershell 7

Bug Description

Jetbrains / PyCharm integration with Claude using the new Claude Code 0.1.3-beta plugin does not work

Steps to Reproduce

  1. Install claude on WSL
  2. Isntall Claude Code plugin on Jetbrains
  3. run Claude Code from Jetbrains
  4. run /config , and /ide commands within Claude Code
  5. let Claude Code edit files
  6. Restart multiple times IntelliJ as per the docs https://docs.anthropic.com/en/docs/claude-code/ide-integrations
  7. Repeat tests

Expected Behavior

/config -> Set the diff tool to auto for automatic IDE detection /ide -> should command show integration with Jetbrains

Claude should show "Opened changes in IntelliJ..." when editing files and IntelliJ should display the diff

Actual Behavior

/config -> there are no "diff tool" settings

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

Let Claude Code edit files -> Changes are shown on the Claude Code's terminal

Additional Context

N/A

masda70 avatar May 22 '25 18:05 masda70

Thanks for the report, will take a look!

hackyon-anthropic avatar May 22 '25 19:05 hackyon-anthropic

even jetbrains with their own ai agent "junie" do not support WSL2, I mean.. who cares that most developers on this planet use windows... crazy.... 🤷

michabbb avatar May 22 '25 22:05 michabbb

Same problem here. Is there any version of this plugin that actually works with Windows WSL?

lexura-saas avatar May 23 '25 07:05 lexura-saas

even jetbrains with their own ai agent "junie" do not support WSL2, I mean.. who cares that most developers on this planet use windows... crazy.... 🤷

A little bigger miss here - junie runs in Windows so you could still use it - claude code on windows means WSL - so this a strange miss to not at least note...

markrmiller avatar May 23 '25 10:05 markrmiller

It's Irrelevant, fact is: both have not (well, or not at all) tested an environment, that most windows web developers are using, and that is extremely hard to understand, at least for me. It's more important to spin up the marketing Maschine, release first, fix later... With that attitude, of course, nobody cares about these pseudo apple users using a strange Virtualization. Let's be honest, it's our fault, we should have switched to Linux/Mac a long time ago 😏 now we have to live with the consequences constantly being ignored whenever someone releases something (cool) for jetbrains, nobody wants to deal with that stupid WSL2 thing. 😁

michabbb avatar May 23 '25 10:05 michabbb

Thanks for the report and patience. We're actively working on fixing this!

hackyon-anthropic avatar May 23 '25 17:05 hackyon-anthropic

@hackyon-anthropic thanks a lot for your work

Could you take on the VSCode issue as well? https://github.com/anthropics/claude-code/issues/1276

CoderF3ff avatar May 25 '25 12:05 CoderF3ff

Same issue on Mac - /ide shows none, typing "claude" into the integrated terminal in VSCode or Cursor doesn't connect to the ide.

Image

leocape avatar May 26 '25 11:05 leocape

We've released an updated plugin (v0.1.6-beta) that should address some of the issues with WSL! It should work with the latest Claude Code release v1.0.6

Steps:

  1. Open up your IDE project (current setup assumes the IDE is launched from Windows rather than within the WSL env, but let me know if your setup has it installed within the WSL env as well and we can look into adding support)
  2. Open up a terminal/Power Shell
  3. Start your WSL env (wsl -d Ubuntu) or equivalent
  4. Switch to the same dir as your project root
  5. Start Claude Code with claude
  6. Use the /ide command to select the running IDE to use

Please let me know if you're running into any issuee! Thanks!

hackyon-anthropic avatar May 31 '25 13:05 hackyon-anthropic

Is this issue also addressing the fact that you can not give claude code images while served in WSL ?

poppabear8883 avatar May 31 '25 13:05 poppabear8883

Sill not working for me

Image

Image

poppabear8883 avatar May 31 '25 13:05 poppabear8883

@poppabear8883 don´t start CC in a regular windows WSL2, click the icon inside phpstorm (top right) so phpstorm opens a terminal inside phpstorm - and there CC will be started automatically.

Image

michabbb avatar May 31 '25 13:05 michabbb

@poppabear8883 don´t start CC in a regular windows WSL2, click the icon inside phpstorm (top right) so phpstorm opens a terminal inside phpstorm - and there CC will be started automatically.

Image

Yes I have tried it that way as well, the /ide still is not connecting ... and the reason i don't use that method typically is because you can not use esc when in the embedded JB terminal, it simple just switches focus to the editor and doesn't send the esc signal to the terminal.

Image

poppabear8883 avatar May 31 '25 13:05 poppabear8883

Thanks @poppabear8883.

From within your WSL environment, can you check if the /mnt/c/Users/[YourWindowsUser]/.claude directory exists? This is where we save the plugin metadata for the plugin connection.

hackyon-anthropic avatar May 31 '25 13:05 hackyon-anthropic

Thanks @poppabear8883.

From within your WSL environment, can you check if the /mnt/c/Users/[YourWindowsUser]/.claude directory exists? This is where we save the plugin metadata for the plugin connection.

poppabear@MSI:/mnt/c/Users/servn/.claude$ ls -la
total 0
drwxrwxrwx 1 poppabear poppabear 512 May 25 09:39 .
drwxrwxrwx 1 poppabear poppabear 512 May 25 09:52 ..
drwxrwxrwx 1 poppabear poppabear 512 May 31 09:34 ide

poppabear@MSI:/mnt/c/Users/servn/.claude$ ls -la ./ide
total 0
drwxrwxrwx 1 poppabear poppabear 512 May 31 09:34 .
drwxrwxrwx 1 poppabear poppabear 512 May 25 09:39 ..

poppabear8883 avatar May 31 '25 13:05 poppabear8883

Cool, thanks for the info. This is super useful, and we're looking into it now!

hackyon-anthropic avatar May 31 '25 14:05 hackyon-anthropic

I have both catalogues : /mnt/c/Users/[user_name]/.claude$ ls ide always empty

and in wsl:

~/.claude/ide$ ls 55399.lock visible when Cursor is open.

JetBrains doesn't work. Cursors works and configuration is under wsl.

msokolnickiitt avatar May 31 '25 14:05 msokolnickiitt

Same here. In the logs I can see claude starting from the plugin with diff_envs={CLAUDE_CODE_SSE_PORT=50101, ENABLE_IDE_INTEGRATION=true, ...}, but the ide directory is empty and nothing shows in claude. Let me know if you need anymore info. Same for 1.0.6 and 1.0.7

modelD-svg avatar Jun 01 '25 12:06 modelD-svg

Same: plugin 1.0.6, claude code 1.0.6, terminal on wsl.exe -d Ubuntu, shell as zsh, claude launched with the asterisk button: the .claude/ide folder is empty both when read from ubuntu or windows.

enricoros avatar Jun 01 '25 15:06 enricoros

Note, for people trying to at least make something work, this is how you can get Esc to work to stop the current gen/exit menus:

Uncheck this option: Image

enricoros avatar Jun 01 '25 15:06 enricoros

I finally made it work on Windows by installing WSL Extension in Visual Studia Code. Previously I just ran code . from WSL but Claude didn't recognize IDE. Now after installing WSL extension VSC opens "in Linux mode" (all paths are /mnt/c/... and CC finally can find IDE:

Image

tmackowski avatar Jun 01 '25 18:06 tmackowski

Just a note: I actually tried launching PyCharm from WSL when it didn't working launching from Windows originally, and I didn't really test anything out thoroughly, but the IDE was detected. I doubt many run that way, but just to note, that may already work.

markrmiller avatar Jun 02 '25 06:06 markrmiller

Note, for people trying to at least make something work, this is how you can get Esc to work to stop the current gen/exit menus:

Uncheck this option:

For older versions of jetbrains or as an alternative way, this also achieves this and additionally allows rebinding if you still want to be able to switch to the editor with your keyboard (from the plugin reviews):

Here's how to make the ESC key work: Go to settings → Keymap. Look for "Switch Focus To Editor". It should be bound to ESC. Unbind or rebind it. Next (still in Keybinds), expand Plugins → Terminal → Escape. It should say "inherited". Remove or rebind this one too


Just a note: I actually tried launching PyCharm from WSL when it didn't working launching from Windows originally, and I didn't really test anything out thoroughly, but the IDE was detected. I doubt many run that way, but just to note, that may already work.

Sadly this does not work for me in goland 2025.1.1. or pycharm 2025.1.1.1. Must be some subtle difference between our machines. Sounds like a nightmare to debug. Maybe can you specify what you mean by "running from wsl"? Just starting it from the wsl console, so just pycharm?

modelD-svg avatar Jun 02 '25 08:06 modelD-svg

I got it to work. At least in my case, I had to have claude already opened in a terminal BEFORE opening the ide. Then starting the IDE, then doing /ide in claude.

I can also see a file in the .ide directory now:

/mnt/c/Users/usr/.claude$ ls -ll ./ide/
total 0
-rwxrwxrwx 1 usr usr 137 Jun  2 13:05 55607.lock

I think the IDE extension is correctly creating the lock file but claude deletes it on startup. Having claude already running when the file is created seems to work around this.

Edit: Well at least the initial connection from Claude Code works, it is still very unstable during usage however.

Edit2: Funnily enough I can get claude code to connect from the IDEs terminal by starting the ide, waiting for the lockfile to be created, setting the ide directory to readonly, then starting claude via the extension-button. Doesn't stay connected though.

Edit3:

Stacktrace
java.lang.Throwable: Bus is already disposed
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:375)
	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverImmediately(MessageBusConnectionImpl.kt:47)
	at com.intellij.execution.console.ConsoleExecutionEditor.dispose(ConsoleExecutionEditor.java:200)
	at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:132)
	at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:164)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:193)
	at com.intellij.serviceContainer.ComponentManagerImpl.dispose(ComponentManagerImpl.kt:1174)
	at com.intellij.openapi.project.impl.ProjectImpl.dispose(ProjectImpl.kt:336)
	at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:132)
	at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:164)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:193)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject$lambda$17(ProjectManagerImpl.kt:418)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$13(AnyThreadWriteThreadingSupport.kt:613)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$15(AnyThreadWriteThreadingSupport.kt:623)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:623)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:613)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:988)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject(ProjectManagerImpl.kt:398)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject$default(ProjectManagerImpl.kt:323)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeAndDisposeAllProjects(ProjectManagerImpl.kt:316)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$destructApplication$6(ApplicationImpl.java:706)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:28)
	at com.intellij.openapi.application.impl.ApplicationImpl.destructApplication(ApplicationImpl.java:705)
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:646)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:631)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:620)
	at com.intellij.openapi.application.ex.ApplicationEx.exit(ApplicationEx.java:56)
	at com.intellij.openapi.wm.impl.CloseProjectWindowHelper.quitApp(CloseProjectWindowHelper.kt:102)
	at com.intellij.openapi.wm.impl.CloseProjectWindowHelper.windowClosing$lambda$2(CloseProjectWindowHelper.kt:81)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction$lambda$6(AnyThreadWriteThreadingSupport.kt:274)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithTemporaryThreadLocal(AnyThreadWriteThreadingSupport.kt:204)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:274)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:222)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:1009)
	at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
	at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
	at com.intellij.openapi.wm.impl.CloseProjectWindowHelper.windowClosing(CloseProjectWindowHelper.kt:64)
	at com.intellij.openapi.wm.impl.ProjectFrameHelper.windowClosing(ProjectFrameHelper.kt:551)
	at com.intellij.openapi.wm.impl.WindowCloseListener.windowClosing(ProjectFrameHelper.kt:591)
	at java.desktop/java.awt.AWTEventMulticaster.windowClosing(AWTEventMulticaster.java:357)
	at java.desktop/java.awt.Window.processWindowEvent(Window.java:2115)
	at java.desktop/javax.swing.JFrame.processWindowEvent(JFrame.java:298)
	at java.desktop/java.awt.Window.processEvent(Window.java:2074)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5043)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2810)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4871)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:783)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:755)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:753)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:752)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:585)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:482)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10$lambda$9(IdeEventQueue.kt:307)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:864)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12$lambda$11$lambda$10(IdeEventQueue.kt:306)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:958)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:117)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:958)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$12(IdeEventQueue.kt:301)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:341)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2025-06-02 13:24:58,134 [ 200126] SEVERE - #c.i.u.m.i.MessageBusImpl - GoLand 2025.1.1  Build #GO-251.25410.140
2025-06-02 13:24:58,134 [ 200126] SEVERE - #c.i.u.m.i.MessageBusImpl - JDK: 21.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2025-06-02 13:24:58,134 [ 200126] SEVERE - #c.i.u.m.i.MessageBusImpl - OS: Windows 10
2025-06-02 13:24:58,134 [ 200126] SEVERE - #c.i.u.m.i.MessageBusImpl - Last Action: com.anthropic.code.plugin.actions.SendToClaudeAction

modelD-svg avatar Jun 02 '25 11:06 modelD-svg

jetbrains plugins + WSL2 = always a FAIL

jetbrains junie: FAILED claude code: FAILED continuedev/continue: FAILED

while one single developer was able to solve such problems in less than a month... 🤷

Fixed spelling: i´m not a kotlin/java developer, but I have a hard time understanding why a simple mapping takes ages to fix 😞

@YetiCGN Thanks for pointing out my lack of English skills 🙏

michabbb avatar Jun 02 '25 11:06 michabbb

You're coming across pretty arrogant and demanding, Micha. By the way, "ich tu mich schwer mit..." is not "I do myself hard" ...

YetiCGN avatar Jun 02 '25 12:06 YetiCGN

Thanks for the feedback. We're doing our best on this and hope to have it fixed asap!

We understand it can be frustrating at times, and we appreciate your patience while we iron out the issues!

hackyon-anthropic avatar Jun 02 '25 12:06 hackyon-anthropic

I can only get Rider to show up in /ide if I run claude code before i open Rider. Then I can select Rider from /ide, but it simply says IDE disconnected.

Image

Cobryis avatar Jun 02 '25 22:06 Cobryis

Just want to plus 1 and say I am getting the same experience with using Rider on windows and Claude Code via WSL2 terminal. I believe WSL is the only supported way to use Claude Code on windows right?

I have tried some of the solutions proposed here re: making a .wslconfig and setting registry keys and did not have any luck with them. As some other users have mentioned, I have been able to momentarily get claude code to find an ide via /ide, assuming I have launch claude code before launching my IDE - but I also find that it immediately says it is disconnected and doesn't seem to work, so I am not sure if I ever truly get connected with it.

Thanks so much as it seems like you are prioritizing a fix. I am curious if there is any way to run Claude Code outside WSL on windows since this does kinda seem like a WSL sandboxing thing.

nakdeyes avatar Jun 03 '25 18:06 nakdeyes

Plus 1'ing here too, having the same experience with PHPStorm and wsl on claude code 1.0.9

Ausoj avatar Jun 03 '25 19:06 Ausoj