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

[BUG][wsl2][Claude-code] doesn't recognizes ide's working directory correctly

Open Sebastian-Geocento opened this issue 1 year ago • 18 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ x] Other:
  • Claude CLI version: <1.0.5>
  • Operating System: <windows 11, wsl2 >
  • Terminal: <default terminal from ubuntu 24 lts isnide wsl2 integration>

Bug Description

I have updated Claude-code from 1.0.4 to 1.0.5 and now it doesn't recognizes ide's working directory correctly (either intelij, or vscode) even when opened inside them via terminal or via ctrl+esc or clicking the widget; thus it does not apply the ide integration correctly as it doesn't correctly sense that they are open

Steps to Reproduce

  1. Open ide
  2. Run claude in terminal
  3. Claude conencts but ide is not connected; Message when using the /ide command : 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. │ │ │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ Esc to exit

Expected Behavior

Connect to the ide; use the file reference automatically, git diff in the ide etc.

Actual Behavior

Works just in the terminal, unable to see the correct wkd path , adds the //wsl/username to the perceived working directory of the ide (/home/username/folder_of_interest)

Additional Context

This is definitely a regression, as 1.0.4 version was integrating correctly with both ide's ; When running Intelij Idea actually and claude in terminal separately in the home directory, it senses that intelij is open:

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. │ │ │ │ Found 1 other running IDE(s). However, their workspace/project directories do not match the current cwd. │ │ │ │ • IntelliJ IDEA: //wsl.localhost/Ubuntu/home/username/project_directory

-> adds the //wsl.localhost/Ubuntu prefix to the path where the ide is open isntead of considering the cwd of the ide /home/username/project_directory ; that is 1000% the issue, might be a change in aliases etc. ;

This doesn't happen for vs code unfortunately, but it doesn't connect to vs code either

Sebastian-Geocento avatar May 29 '25 15:05 Sebastian-Geocento

Also experiencing the same thing with VS Code on Windows with WSL2.

empz avatar May 29 '25 17:05 empz

solved for vs code by 1.0.6 release, Intelij still doesn't get detected

Sebastian-Geocento avatar May 29 '25 17:05 Sebastian-Geocento

Possible duplicate: https://github.com/anthropics/claude-code/issues/1390

sid374 avatar May 29 '25 20:05 sid374

Same here with Claude 1.0.51 and Cursor 1.2.5 . But doesn't recognize that its in wsl

│  Found 1 other running IDE(s). However, their workspace/project directories do not match the current cwd.                  │
│                                                                                                                            │
│     • Cursor: c:\<repo>

IhsenBouallegue avatar Jul 13 '25 14:07 IhsenBouallegue

But doesn't recognize that its in wsl

Same for 1.0.53 Claude with 1.102.0 VSCode

|  Found 1 other running IDE(s). However, their workspace/project directories do not match the current cwd.
|
|    • Visual Studio Code: c:\<repo>

StephenSHorton avatar Jul 17 '25 02:07 StephenSHorton

Also having the same issue. Vscode was opened using a workspace file:

~/projects/oc/.vscode.workspace In the workspace file there is couple of paths:

{
  "folders": [
    {
      "name": "backend",
      "path": "backend"
    },
    {                                                                                                                        
      "name": "ui",                                                                                                          
      "path": "ui"                                                                                                           
    },
...
}

When running the /ide command in claude I get those those paths:

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.                              │
│                                                                                                                                                │
│  Found 1 other running IDE(s). However, their workspace/project directories do not match the current cwd.                                      │
│                                                                                                                                                │
│     • Visual Studio Code: /home/user/projects/oc/backend, /home/user/projects/oc/ui, 

Opening not the workspace but using "Open folder" in vsocde solved the issue but it looks like regression. It was working quite fine just yesterday.

mmsrubar avatar Jul 17 '25 05:07 mmsrubar

Also happening on MacOS. "Open Folder" instead of using "Open Recent" or "GPM" to open the project does seem to work around the issue (sometimes)

iterate-nick avatar Jul 18 '25 08:07 iterate-nick

@iterate-nick thanks. CC can't match softlinked folders. "Open Folder" with full path helped!

pannous avatar Jul 18 '25 08:07 pannous

In Cursor and I suspect VS Code on MacOS, you need to close all of your terminal windows and File/Open Folder... I don't think the order matters but you must do both.

terris-citizen avatar Jul 20 '25 15:07 terris-citizen

In Cursor and I suspect VS Code on MacOS, you need to close all of your terminal windows and File/Open Folder... I don't think the order matters but you must do both.

This method works. You can't had any terminal opened when the window reload.

Seems the vscode resumed terminal can't work well with claude code extension

If you reload like this way which a terminal had open, can't connect to claude code extension:

Image

But like following, first kill all terminal, the reload, the extension works:

Image

tjx666 avatar Jul 22 '25 09:07 tjx666

I tried relaunch terminal and fixed automatically.

Image

hastalavistababy avatar Jul 25 '25 12:07 hastalavistababy

Workaround for VSCode users -> Open the project from WSL using the code command. This is how I was able to get Claude (WSL installation) to recognize my editor.

StephenSHorton avatar Jul 26 '25 15:07 StephenSHorton

Same problem! Nothing helps. cwd shows the same folder in Claude but says it's a different folder. I'm using remote VS Code from macOS to Ubuntu.

UPDATE: It helped to downgrade to 1.0.62

jnpatrick99 avatar Aug 04 '25 21:08 jnpatrick99

Fyi: I used Git Bash instead of PowerShell and was able to connect to WebStorm

Claude Plugin: 0.1.12-beta Claude Code: 2.0.55 WebStorm: 2025.2.5

narekntm avatar Nov 29 '25 22:11 narekntm

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 30 '25 10:12 github-actions[bot]

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

github-actions[bot] avatar Jan 29 '26 10:01 github-actions[bot]

For whoever is facing this issue, I was able to workaround it in macOS by opening vscode from the terminal and then claude. Not sure if it works on WSL tho:

code . && claude --dangerously-skip-permissions

erick-siordia avatar Jan 30 '26 19:01 erick-siordia

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Feb 07 '26 14:02 github-actions[bot]