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

Not able to connect to IDE

Open p5hema2 opened this issue 1 year ago • 12 comments

At the moment it is not possible to connect to the IDE.

I tested: IDE terminal git bash IDE terminal cmd IDE terminal PS System terminal git bash System terminal cmd

All with the same result.

Error:

Claude detects a missmatch in the current working directory.

Details:

cwd: C:\workspace\foo\bar\baz IntelliJ IDEA: /mnt/c/workspace/foo/bar/baz

p5hema2 avatar Jul 10 '25 08:07 p5hema2

same

nomenon avatar Jul 10 '25 09:07 nomenon

Do you have WSL installed? You can check with wsl --list in PowerShell.

somersby10ml avatar Jul 10 '25 20:07 somersby10ml

@somersby10ml yes, but only docker-desktop

C:\Users\Admin>wsl --list
Windows Subsystem für Linux-Distributionen:
docker-desktop (Standard)

p5hema2 avatar Jul 10 '25 20:07 p5hema2

Maybe this gives you a hint:

CMD Terminal:

print ENABLE_IDE_INTEGRATION, TERMINAL_EMULATOR, CLAUDECODE, MSYSTEM, PWD env variables

● Bash(echo "ENABLE_IDE_INTEGRATION: $ENABLE_IDE_INTEGRATION"; echo "TERMINAL_EMULATOR: $TERMINAL_EMULATOR"; echo "CLAUDECODE: $CLAUDECODE"; echo "MSYSTEM: $MSYSTEM"; echo "PWD: $PWD") ⎿  ENABLE_IDE_INTEGRATION: true TERMINAL_EMULATOR: JetBrains-JediTerm CLAUDECODE: 1 MSYSTEM: MSYS PWD: /c/workspace/foo/bar/baz

echo node cwd

● Bash(node -e "console.log('Node CWD:', process.cwd())") ⎿  Node CWD: C:\workspace\foo\bar\baz

Bash:

print ENABLE_IDE_INTEGRATION, TERMINAL_EMULATOR, CLAUDECODE, MSYSTEM, PWD env variables

● Bash(echo "ENABLE_IDE_INTEGRATION: $ENABLE_IDE_INTEGRATION"; echo "TERMINAL_EMULATOR: $TERMINAL_EMULATOR"; echo "CLAUDECODE: $CLAUDECODE"; echo "MSYSTEM: $MSYSTEM"; echo "PWD: $PWD") ⎿  ENABLE_IDE_INTEGRATION=true - This suggests IDE integration is enabled TERMINAL_EMULATOR=JetBrains-JediTerm - You're using JetBrains IDE terminal CLAUDECODE=1 - Claude Code is running MSYSTEM=MINGW64 - You're in Git Bash/MINGW64 environment PWD=/c/workspace/foo/bar/baz - Your current directory in POSIX format

p5hema2 avatar Jul 10 '25 21:07 p5hema2

I want to reproduce this on my end. Which specific IDE should I install? Could you share a download link?

somersby10ml avatar Jul 10 '25 21:07 somersby10ml

IntelliJ IDEA 2025.1.3 (Ultimate Edition) https://www.jetbrains.com/idea/download/?section=windows Plugin: Claude Code (Beta) 0.1.11-beta

p5hema2 avatar Jul 10 '25 21:07 p5hema2

PS.: If you try to connect with the /ide command inside the IDE Terminal you won't get a decent error msg. Use your system terminal, cmd, bash to get the message with the different paths.

p5hema2 avatar Jul 10 '25 21:07 p5hema2

I've successfully reproduced this issue. I'll work on finding a solution.

somersby10ml avatar Jul 10 '25 21:07 somersby10ml

This appears to be caused by IntelliJ's Claude Code plugin incorrectly assuming the user environment is Linux, resulting in WSL-style path generation.

Temporary workaround (must be repeated each time you restart the IDE):

  1. Navigate to %USERPROFILE%\.claude\ide and open the lock file in Notepad

  2. You'll see the workspaceFolders section containing something like this (example):

    {"workspaceFolders":["/mnt/c/Users/admin/Desktop/Project/test/template"],"pid":32048,"ideName":"...
    
  3. Open Claude Code from your project folder and copy the exact path shown by the pwd command

  4. Replace the WSL-style path with the Windows path, making sure to escape backslashes as double backslashes:

    Example: C:\\Users\\admin\\Desktop\\Project\\test\\template
    

Future solution: I'll research implementing automatic path conversion in Claude Code when it reads lock files from the IDE folder, so that when it detects IntelliJ, the paths are properly converted to match correctly.


Image Image

somersby10ml avatar Jul 10 '25 22:07 somersby10ml

I also encountered this problem using VS Code. I have ubuntu WSL installed, and the path in IDE lock file is already in WIN style.

Reekin avatar Jul 11 '25 14:07 Reekin

Can you test it with npx [email protected]?

somersby10ml avatar Jul 11 '25 20:07 somersby10ml

Still the same

││ 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.

Reekin avatar Jul 12 '25 07:07 Reekin