[BUG] Can't detect VS Code in integrated terminal on native Windows installation
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: VS Code Extension v1.0.68
- Claude CLI version: v1.0.68
- Operating System: Windows 11 22H2 (OS Build 22621.5624)
- Terminal: Windows Terminal w/ PowerShell 7.5.2
Bug Description
VS Code is not detected when running claude /ide in the integrated terminal or clicking the Claude Code button in VS Code
Steps to Reproduce
- Ensure VS Code - Claude Code extension is installed and up to date
- Open folder in VS Code
- Click Claude Code button
- Wait for CC to load/prompt to be available
- Enter
/ideand press Enter
OR
- Ensure VS Code - Claude Code extension is installed and up to date
- Open folder in VS Code
- Open a new integrated terminal (
Ctrl + Shift + ') / Terminal -> New Terminal - Enter
claude /ideand press Enter
Expected Behavior
VS Code is detected, selectable and can be connected to
Actual Behavior
VS Code is not detected
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 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
Additional Context
If I run claude /ide in an external terminal (i.e. seperate from VS Code) running in the same working directory as VS code then VS Code is detected and can be connected to
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Select IDE │
│ Connect to an IDE for integrated development features. │
│ │
│ 1. Visual Studio Code │
│ ❯ 2. None✔ │
│ │
│ ※ Tip: You can enable auto-connect to IDE in /config or with the --ide flag │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/4662
- https://github.com/anthropics/claude-code/issues/3492
- https://github.com/anthropics/claude-code/issues/5084
If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
same issue
it's a bug for window, i think,
@wim-anthropic
@np-anthropic
@ah-anthropic
@cal-anthropic
Found 3 possible duplicate issues:
1. [[BUG] Unable to connect to VS code IDE (windows npm native) #4662](https://github.com/anthropics/claude-code/issues/4662) 2. [[BUG] Can't detect VSCode Extension on Windows Native Environment #3492](https://github.com/anthropics/claude-code/issues/3492) 3. [VSCode Integration Fails on Native Windows Environment #5084](https://github.com/anthropics/claude-code/issues/5084)If your issue is a duplicate, please close it and 👍 the existing issue instead.
🤖 Generated with Claude Code
I do not believe this is an exact duplicate given that it is working in a seperate terminal, but not in the integrated on.
it's a bug for window, i think,
I'm inclined to agree given that I have the same issue in Rider #5154
I have the issue as well where it works in windows terminal, but not in my terminal in vscode.
I have the exact same issue https://github.com/anthropics/claude-code/issues/4662
Running vs code as admin seems to work
I've updated to 1.0.88. Running as admin or user makes no difference for me. Both still show
╭────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 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. │
│ │
╰────────────────────────────────────────────────────────────────────────────────╯
I found a solution, just typeVSCODE_PID= VSCODE_CWD= TERM_PROGRAM= command claude in your VSCode integrated terminal (I use git-bash.exe)
Or if you want to use the alias/function, you can just do it in your bashrc / zshrc like this:
# You can type cc in the terminal
alias cc="VSCODE_PID= VSCODE_CWD= TERM_PROGRAM= command claude"
# You can type claude in the terminal
claude() {
VSCODE_PID= VSCODE_CWD= TERM_PROGRAM= command claude "$@"
}
enjoy
And If you use cmd as VSCode integrated terminal, you can do this:
cmd /c "set VSCODE_PID= && set VSCODE_CWD= && set TERM_PROGRAM= && claude"
@Molunerfinn You're an allstar, worked like a champ
I want to hijack this to say not only this reproduces on my vscode environment (vscode terminal claude doesnt find vscode) but also in any jetbrains IDE the jetbrains ide terminal also does not work but the windows terminal (seperated from ide) works in both cases
but when I use it on the seperate terminal after asking a question, the ctrl alt k shortcut stop working and tries to open a new claude code instance instead of referecing the file im currently at in the chat
thanks to @Molunerfinn Solution idea i was able to find a solution to the Jetbrains IDEs also : if you use powershell : $env:IDEA_INITIAL_DIRECTORY = "" $env:INTELLIJ_COMMAND_HISTFILE = "" $env:TERMINAL_EMULATOR = "" claude
thanks to @Molunerfinn Solution idea i was able to find a solution to the Jetbrains IDEs also : if you use powershell : $env:IDEA_INITIAL_DIRECTORY = "" $env:INTELLIJ_COMMAND_HISTFILE = "" $env:TERMINAL_EMULATOR = "" claude
JetBrains Claude-Code[Beta] settings :
$env:IDEA_INITIAL_DIRECTORY = ""; $env:INTELLIJ_COMMAND_HISTFILE = ""; $env:TERMINAL_EMULATOR = ""; claude
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.