Claude Code in VS Code on Windows: the Extension, the CLI and WSL

You installed the Claude Code extension, the panel opened, you signed in, and then the questions started. Is this the same Claude Code as the claude you run in PowerShell? Why does claude say “not recognized” in the integrated terminal when the extension is right there? Which settings.json does it read, and what happens when the window is connected to WSL?

This post is the extension on Windows from the first install to the point where the panel and the CLI stop being 2 mysteries: what it bundles, what it shares with the CLI, the prompt box keys and settings worth knowing, and the WSL and remote notes. Everything is from the current docs, linked at the end. The install post covers the standalone CLI, which you still want.

Install the Extension

Press Ctrl+Shift+X to open the Extensions view, search for Claude Code, and click Install. The publisher is Anthropic and the extension id is anthropic.claude-code; the Marketplace page is linked at the end if you prefer to install from the browser. It needs VS Code 1.94.0 or later and a Claude account: any paid subscription (Pro, Max, Ultra, Team or Enterprise) or a Console account. No API key is needed.

The extension’s version number is the Claude Code version it bundles, so the Extensions view also tells you which Claude Code the panel is running. If the extension does not appear after the install, run Developer: Reload Window from the Command Palette (Ctrl+Shift+P). The same extension installs in Cursor and in VS Code forks, from the Marketplace or the Open VSX Registry.

Open It and Sign In

The Spark icon is Claude Code throughout VS Code. The quickest way in is the Spark icon in the Editor Toolbar, top right of the editor, which only appears while a file is open. The other routes:

  • Activity Bar: the Spark icon in the left sidebar opens the sessions list. Click a session, or start a new one.
  • Command Palette: Ctrl+Shift+P, type Claude Code, pick an option such as Open in New Tab.
  • Status Bar: click Claude Code at the bottom right. This works with no file open.

The first time the panel opens it shows a sign-in screen. Click Sign in and finish in the browser. If you have ANTHROPIC_API_KEY set in your shell and still see the sign-in prompt, VS Code did not inherit your environment; launch it from a terminal with code ., or sign in with your Claude account instead. After sign-in a Learn Claude Code checklist appears; dismiss it with the X, or bring it back later by unchecking Hide Onboarding under Extensions > Claude Code in the settings.

You can drag the panel anywhere: the secondary sidebar on the right keeps Claude visible while you code, the editor area opens it as a tab beside your files, and Open in New Tab or Open in New Window from the Command Palette starts a second conversation with its own context. A small coloured dot on the Spark icon of a tab means something happened while it was hidden: blue is a permission request waiting, orange is Claude finished.

How It Relates to the CLI

The extension bundles its own private copy of the CLI for the chat panel. It does not put claude on your PATH, which is why claude in the integrated terminal is “not recognized” on a machine that only has the extension. For that you want the standalone install from the install post; run it once and claude, claude mcp add and claude --resume work in any terminal, including VS Code’s. Ctrl+` opens the integrated terminal.

What the 2 share and where they differ, from the docs:

  • Settings: ~\.claude\settings.json and the project .claude\settings.json are read by both. Permission rules, environment variables, hooks and MCP servers set for the CLI apply in the panel. The permissions post and the MCP post cover those files.
  • Conversation history: shared. Start in the panel, then claude --resume in a terminal opens the picker with that conversation in it. The sessions post has the picker keys.
  • Checkpoints: both. In the panel, hover over a message for the rewind button and its 3 options: fork the conversation from here, rewind the code to here, or both. Rewind Claude Code Edits With Checkpoints explains what checkpoints do and do not track.
  • MCP: both. /mcp in the panel adds, removes, reconnects and authenticates servers, and saves to the same configuration as claude mcp add in the terminal.
  • Commands and skills: the CLI has all of them; the panel has a subset. Type / in the prompt box to see what is there.
  • The ! shell shortcut and Tab completion: CLI only.

When you run the CLI in the integrated terminal with the extension installed, it connects to the extension on its own, and you get diffs in VS Code’s native diff viewer plus your editor selection as context. From an external terminal, /ide inside Claude Code makes the same connection. That link is a small MCP server named ide that the extension runs locally; it is hidden from /mcp because there is nothing to configure, and it only matters if a hook or permission rule of yours lists MCP tools by name (mcp__ide__getDiagnostics and mcp__ide__executeCode are the 2 it exposes; the chat panel reads diagnostics through its own mcp__claude-vscode__getDiagnostics, so a rule needs both names to cover both).

If you would rather have the CLI interface inside the panel, tick Use Terminal under Extensions > Claude Code in the VS Code settings, or set claudeCode.useTerminal to true.

The Prompt Box on Windows

The keys below are the VS Code ones, as the docs list them for Windows and Linux. The terminal shortcuts, Shift+Tab included, are in the keyboard shortcuts post.

Ctrl+Esc          toggle focus between the editor and the Claude prompt box
Ctrl+Shift+Esc    open a new conversation as an editor tab
Alt+K             insert an @-mention of the current file and selection, e.g. @app.ps1#5-10
Shift+Enter       new line without sending
Ctrl+Alt+F        toggle Focus view (hides tool calls and thinking, keeps prompts and replies)
Ctrl+Shift+T      reopen the most recently closed Claude session tab
Ctrl+N            new conversation, only if enableNewConversationShortcut is on

Claude sees your selected text automatically; the prompt box footer shows how many lines are selected, and it also sees which file is open. @ followed by part of a name fuzzy-matches files, a trailing slash means a folder, and @terminal:name pulls in the output of a terminal by its title. Paste an image from the clipboard to attach it, or hold Shift while dragging files in.

The permission mode sits at the bottom of the prompt box; click it to switch between Auto, Manual, Plan and Edit automatically. /plan typed in the box does the same for plan mode, and VS Code opens the plan as a Markdown document you can comment on before Claude starts. The plan mode post covers the mode itself. In Manual mode an edit shows as a side-by-side diff with accept and reject buttons, and from version 2.1.275 you can accept or reject each change in the diff one at a time.

The Session history button at the top of the panel lists past conversations with search. A session with no activity for 14 days moves to Archived sessions on its own; change that under the Archive Inactive Sessions setting, or set it to Never. Conversations that ended in plan mode come back in plan mode.

Settings That Matter

There are 2 places. Claude Code’s own files, shared with the CLI, hold permissions, hooks, MCP and env. The extension’s settings, under Extensions > Claude Code in VS Code or in VS Code’s settings.json with the claudeCode. prefix, control how the panel behaves. The ones worth knowing:

{
  "claudeCode.initialPermissionMode": "plan",
  "claudeCode.preferredLocation": "sidebar",
  "claudeCode.attachOpenFile": true,
  "claudeCode.attachSelection": true,
  "claudeCode.autosave": true,
  "claudeCode.respectGitIgnore": true,
  "claudeCode.useTerminal": false
}
  • initialPermissionMode: default (Manual), plan, acceptEdits or bypassPermissions. VS Code reads it from your user settings only and ignores a workspace value, so a repo cannot set it for you. It does not accept auto. Leave it unset and the extension works down its own list: the mode you last picked from the indicator (Manual, Edit automatically or Auto), then permissions.defaultMode in ~\.claude\settings.json or managed settings, then the built-in default, which is Auto from version 2.1.283.
  • preferredLocation: sidebar or panel (a new tab).
  • attachOpenFile and attachSelection: both on by default. Turn one off to keep the open file or the selected text out of your messages; Alt+K still adds a selection on demand.
  • autosave: saves files before Claude reads or writes them, on by default.
  • respectGitIgnore: keeps git-ignored files out of file searches and out of selection context.
  • environmentVariables: variables for the Claude process. The docs say to prefer the env block in Claude Code’s settings for anything shared with the CLI.

A line worth adding to ~\.claude\settings.json itself: "$schema": "https://json.schemastore.org/claude-code-settings.json" gives you autocomplete and validation for every Claude Code setting while you edit the file in VS Code.

WSL, Remote Windows and Containers

On Windows you can run Claude Code natively or inside WSL, and the choice follows your projects. Native is PowerShell or CMD against your Windows drives, with Git for Windows giving Claude a Bash tool; without it, Claude uses PowerShell as the shell tool. WSL 2 is the Linux build inside your distro, and it is the only Windows option with sandboxed command execution. The install post walks through both; the WSL guide covers WSL itself.

The rule the docs give for the WSL install applies in VS Code too: you install and launch claude inside the WSL terminal, not from PowerShell or CMD. So in a VS Code window connected to WSL, the CLI you run in the integrated terminal is the Linux one, installed in the distro. The same goes for an SSH host or a dev container: Claude Code runs on that system, and its ~/.claude/settings.json is the one on that system, not the one on your Windows profile. The docs make that point in their certificate troubleshooting, and it is the thing to remember whenever a setting works locally and not in a remote window. For containers, the docs have a dedicated development containers page, linked at the end.

On native Windows, Claude Code looks for Git Bash itself. If it cannot find yours, point it there once in settings.json:

{
  "env": {
    "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe"
  }
}

Other Considerations

No Spark icon. It needs a file open, not just a folder; VS Code 1.94.0 or later; and a trusted workspace, since the extension does not work in Restricted Mode. The docs also suggest temporarily disabling other AI extensions. The Status Bar entry works regardless.

Shift+Enter in the integrated terminal. When you run the CLI inside VS Code’s terminal, Shift+Enter needs a keybinding that /terminal-setup writes for you. It also sets terminal.integrated.gpuAcceleration to off to stop garbled text; set it back to auto if you want that undone. Windows Terminal needs no setup.

Open a tab from a script. The extension registers a URL handler, so a PowerShell line opens a new Claude Code tab, optionally with a prompt filled in but not sent:

Start-Process "vscode://anthropic.claude-code/open"
Start-Process "vscode://anthropic.claude-code/open?prompt=review%20my%20changes"

Uninstalling. Extensions view, search, Uninstall. It comes back if you run /ide from an external terminal while VS Code is open, or start claude in the integrated terminal on a version before 2.1.318. To stop that, set autoInstallIdeExtension to false in ~\.claude.json, or turn off Auto-install IDE extension in /config. The extension’s own data on Windows lives under $env:APPDATA\Code\User\globalStorage\anthropic.claude-code, and the docs give a Remove-Item -Recurse -Force on that folder for a full reset.

Third-party providers. On Bedrock, Google Cloud or Microsoft Foundry, tick Disable Login Prompt and configure the provider in ~\.claude\settings.json so the extension and the CLI share it. Those sign-ins lose the claude.ai-only features: plan usage bars, voice dictation and the Web tab for cloud sessions.

Frequently Asked Questions

Do I still need the CLI install if I have the extension?

Only for claude in a terminal. The panel has its own bundled copy and never adds claude to your PATH, so a machine with just the extension has a working panel and a “not recognized” terminal.

Does the extension read my project’s .claude\settings.json?

Yes. Permission rules, hooks, MCP servers and the env block are shared with the CLI. The exception is the starting permission mode, which the extension takes from the VS Code user setting claudeCode.initialPermissionMode and ignores in workspace settings.

Can I continue a panel conversation in the terminal?

Yes. The 2 share one history. Run claude --resume in the terminal and pick the conversation. If a notice says it is still open somewhere else, close it in the other place first, or wait about 10 minutes for the old process to end, then choose Open here anyway.

Why does ! not run a command in the panel?

The ! shell shortcut and Tab completion are CLI-only. Open the integrated terminal with Ctrl+` and run claude there when you want them.

Where did my older sessions go?

After 14 days without activity a session moves to the Archived sessions group at the bottom of the list. Expand it and click Unarchive session, or change the period in the Archive Inactive Sessions setting.


Related

If SQL Server is part of your day job, my current work lives over at sqldba.blog: production DBA scripts, an error library and the SSMS guide.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for SQL Server?

This site started as a SQL Server blog in 2017 and the archive is still here. The new SQL Server writing, and all the scripts, moved to a site of their own.

sqldba.blogScripts, error library, wait types, SSMS
Browse by topic