[BUG] Can't detect VS Code in integrated terminal on native Windows installation

Open 💬 23 comments Opened Aug 5, 2025 by thegrahamking

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

  1. Ensure VS Code - Claude Code extension is installed and up to date
  2. Open folder in VS Code
  3. Click Claude Code button
  4. Wait for CC to load/prompt to be available
  5. Enter /ide and press Enter

OR

  1. Ensure VS Code - Claude Code extension is installed and up to date
  2. Open folder in VS Code
  3. Open a new integrated terminal (Ctrl + Shift + ') / Terminal -> New Terminal
  4. Enter claude /ide and 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                                         │
│                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

View original on GitHub ↗

23 Comments

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4662
  2. https://github.com/anthropics/claude-code/issues/3492
  3. 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

LckOrLck · 11 months ago

same issue

LckOrLck · 11 months ago

it's a bug for window, i think,

LckOrLck · 11 months ago

@wim-anthropic

LckOrLck · 11 months ago

@np-anthropic

LckOrLck · 11 months ago

@ah-anthropic

LckOrLck · 11 months ago

@cal-anthropic

thegrahamking · 11 months ago
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 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

christopher-buss · 11 months ago

I have the issue as well where it works in windows terminal, but not in my terminal in vscode.

teewood · 11 months ago
Ian1971 · 10 months ago

Running vs code as admin seems to work

thegrahamking · 10 months ago

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.                                          │
│                                                                                │
╰────────────────────────────────────────────────────────────────────────────────╯
Molunerfinn · 10 months ago

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

<img width="1150" height="831" alt="Image" src="https://github.com/user-attachments/assets/9b07f08a-f521-4c03-b991-ea59a71be00c" />

Molunerfinn · 10 months ago

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"
sitefinitysteve · 10 months ago

@Molunerfinn You're an allstar, worked like a champ

IdoAmar · 7 months ago

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

IdoAmar · 7 months ago

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

Fartpeach1003 · 7 months ago
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

<img width="739" height="304" alt="Image" src="https://github.com/user-attachments/assets/092b3b4d-928d-41d0-8ace-ccb1fd52228d" />

github-actions[bot] · 6 months ago

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.

alexbandol · 5 months ago

Still experiencing this issue on v2.1.23 (latest channel).

Environment:

  • Windows 11
  • - VS Code with Claude Code extension v2.1.23 installed
  • - - "Use Terminal" setting enabled in extension settings

Symptoms:

  • Running claude in VS Code integrated terminal
  • - /ide command shows "No available IDEs detected"
  • - - Lock file exists in ~/.claude/ide/ with correct VS Code PID and workspace info
  • - - - Extension is running and visible in VS Code

Workaround found:
Downgrading to stable channel fixes the issue:

claude install stable

This installs v2.1.7 where /ide correctly detects VS Code.

Conclusion:
The bug appears to be a regression in the latest channel (v2.1.23). The stable version (v2.1.7) works correctly.

elfenlieds7 · 5 months ago

For Windows users using PowerShell in VS Code integrated terminal, add this to your PowerShell profile ($PROFILE):

# Fix Claude Code /ide detection in VS Code integrated terminal
function claude {
    $env:VSCODE_PID = ""
    $env:VSCODE_CWD = ""
    $env:TERM_PROGRAM = ""
    & (Get-Command claude.cmd -CommandType Application).Source @args
}

Then reload your profile (. $PROFILE) or open a new terminal. Now /ide works correctly! 🎉

alexbandol · 5 months ago
For Windows users using PowerShell in VS Code integrated terminal, add this to your PowerShell profile ($PROFILE): # Fix Claude Code /ide detection in VS Code integrated terminal function claude { $env:VSCODE_PID = "" $env:VSCODE_CWD = "" $env:TERM_PROGRAM = "" & (Get-Command claude.cmd -CommandType Application).Source @args } Then reload your profile (. $PROFILE) or open a new terminal. Now /ide works correctly! 🎉

That worked (at least in the current v2.1.27. For those of you who use native installer:

# Fix Claude Code /ide detection in VS Code integrated terminal
function claude {
    $env:VSCODE_PID = ""
    $env:VSCODE_CWD = ""
    $env:TERM_PROGRAM = ""
    & "$env:USERPROFILE\.local\bin\claude.exe" @args
}
mopanasenko · 5 months ago

Today I had the same issue with Claude Code v2.1.29 and VS Code v1.108.2. This solution worked for me

# Fix Claude Code /ide detection in VS Code integrated terminal
function claude {
    $env:VSCODE_PID = ""
    $env:VSCODE_CWD = ""
    $env:TERM_PROGRAM = ""
    & (Get-Command claude.exe -CommandType Application).Source @args
}