Claude Code in VS Code: the extension, CLI and Remote-SSH
Install the Claude Code extension in VS Code or Cursor, sign in, panel vs CLI, the claudeCode settings, Remote-SSH, WSL and dev containers, and its errors.
Install Anthropic’s Claude Code for VS Code extension, ID anthropic.claude-code: open the Extensions view with Ctrl+Shift+X (Cmd+Shift+X on a Mac), search “Claude Code” and click Install, or run code --install-extension anthropic.claude-code. It needs VS Code 1.94.0 or later and a Pro, Max, Ultra, Team or Enterprise plan, or a Claude Console account. Click the Spark icon at the top right of an open file, or ✻ Claude Code in the status bar, then Sign in. Cursor and other VS Code forks take the same extension.
The extension carries its own copy of Claude Code, and its version number is that copy’s: 2.1.330, released November 20, 2026. It does not put claude on your PATH, so the CLI in VS Code’s terminal is a separate install; with both in place, the CLI shows the edits it asks to make in VS Code’s diff viewer and sees what you select. In a Remote-SSH, WSL or dev container window, install the extension on the remote side and edit Claude Code’s ~/.claude/settings.json on that machine, not on your laptop.
Install it in VS Code, Cursor or another fork
On the Visual Studio Marketplace the listing is Claude Code for VS Code, from the publisher Anthropic with its domain verified as anthropic.com, which is worth checking before you install anything with a similar name. Where it comes from in each editor, per Anthropic’s install instructions:
- VS Code: the Extensions view, or
code --install-extension anthropic.claude-codefrom a terminal. VS Code’s command line also takes a version, as inanthropic.claude-code@2.1.329, which is a way back to the previous release if a new one misbehaves for you; turn off Auto Update on the extension’s right-click menu so VS Code doesn’t move it forward again. - Cursor: search “Claude Code” in its Extensions view, or open Anthropic’s link
cursor:extension/anthropic.claude-code. - Other forks, such as Devin Desktop (Windsurf before its rebrand, as Claude Code’s changelog records in 2.1.162) and Kiro: their Extensions view, or the Open VSX Registry, where Anthropic publishes it as
Anthropic/claude-code. - An editor that can’t install the extension: install the CLI and run
claudein the editor’s terminal.
The extension’s version is the Claude Code version it bundles, so a feature Anthropic documents as needing Claude Code 2.1.286 needs extension 2.1.286 or later, whatever claude --version says in a terminal. Anthropic publishes a separate build for each platform: Windows and Linux on x64 and Arm64, macOS on Intel and Apple silicon, and Alpine Linux on x64 and Arm64. It also stays off in a folder you haven’t trusted; in the words of its manifest, “Claude Code can run commands and use settings from this folder, so it stays off until you trust the folder.”
Sign in
The first time the panel opens it shows a sign-in screen: click Sign in and finish in the browser. Any paid Claude plan works, as does a Claude Console account, with no API key needed; the free claude.ai plan does not include Claude Code. Three cases catch people out:
- An API key in your shell may not reach VS Code. If
ANTHROPIC_API_KEYis set but the sign-in screen still appears, VS Code may not have inherited your shell’s environment. Start VS Code from that terminal withcode ., or sign in with your Claude account. - Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry. Turn on Disable Login Prompt (
claudeCode.disableLoginPrompt) and configure the provider in~/.claude/settings.json. Plan usage bars, voice dictation and the Web tab for cloud sessions need a claude.ai account, so they don’t appear. Not logged in · Please run /login. The panel reopens the sign-in screen by itself; if it doesn’t, run Developer: Reload Window. The causes, which the CLI shares, are in Claude Code not logged in.
The panel and a claude you run in a terminal on the same machine use one saved login: 2.1.329 fixed a slow token refresh in the extension signing people out “in every window and terminal”. In the prompt box, /usage shows the account and its usage, /status the version, account and model, and /logout (or Sign out in the command menu) signs out.
The panel or claude in the terminal
Anthropic calls the extension “the recommended way to use Claude Code in VS Code”, but the two are not the same tool. From its comparison and the rest of its VS Code page:
| Extension panel | claude in VS Code’s terminal | |
|---|---|---|
What to install | The extension | The standalone CLI as well |
Commands and skills | A subset: type / to see which | All of them |
! shell shortcut, Tab completion | No | Yes |
Reviewing an edit | In Manual mode, a side-by-side diff to accept or reject, each change separately from 2.1.275 (whole file only above 100 changes); in Auto, the starting mode from 2.1.283, or Edit automatically, Claude edits most files without asking | VS Code’s diff viewer while connected to the extension, or the terminal with "diffTool": "terminal" in ~/.claude.json |
Your selection and open file | Sent with each message; Alt+K (Option+K) inserts a reference such as @app.ts#5-10 | Sent while connected; the transcript shows ⧉ Selected N lines from <file> |
Plans | Open as a Markdown document you can comment inline | Shown in the terminal; Ctrl+G opens the plan in your text editor |
Shared | ~/.claude/settings.json, the MCP server configuration and the conversation history; both have checkpoints for rewinding | |
The panel also runs several conversations at once in tabs or windows, keeps a sessions list you can group, and archives a session after 14 days without activity, unless it is open, unread or in a group. For the CLI, install it once:
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash
# Windows PowerShell
irm https://claude.ai/install.ps1 | iexCopiedIn the integrated terminal, claude connects to the extension by itself. Since 2.1.318 the CLI no longer installs the extension for you, so until you do, /ide reports “No available IDEs detected”. From a terminal outside VS Code, run /ide to connect; it installs the extension if VS Code is running without it, unless autoInstallIdeExtension is false in ~/.claude.json. claude --resume in a terminal in the same project lists the conversations you had there in the panel (Ctrl+A widens the list to every project on the machine), so one can carry on in the CLI.
The connection runs through an MCP server the extension starts, named ide and hidden from /mcp. It listens on 127.0.0.1 on a random port between 10000 and 65535 and takes only clients that present the token in ~/.claude/ide/<port>.lock, a file only your user can read. Through it Claude reads the errors and warnings in VS Code’s Problems panel (mcp__ide__getDiagnostics) and can run Python in an open Jupyter notebook, which always waits for you to pick Execute. The panel reads diagnostics through a server of its own, so a permission rule meant to block both names mcp__ide__getDiagnostics and mcp__claude-vscode__getDiagnostics; a Read deny rule covers neither.
Two more things. The Use Terminal setting opens Claude in terminal mode, the CLI-style interface, instead of the graphical panel. And the panel and the terminal can be on different versions: the panel runs the copy inside the extension, which moves when the extension updates, and the terminal runs your standalone install, which updates on its own (updating Claude Code covers that side).
The extension’s own settings
Claude Code in VS Code reads two sets of settings. The extension’s are in VS Code’s settings under Extensions › Claude Code (or type / and pick General config…), saved as claudeCode.* keys in VS Code’s settings.json. Allow rules, environment variables and hooks go in ~/.claude/settings.json, which the panel and the CLI share; MCP servers added from the panel’s /mcp dialog or with claude mcp add are saved in ~/.claude.json (or a project’s .mcp.json), which both read. The extension settings most people end up changing, from Anthropic’s settings table:
| Setting | Default | What it does |
|---|---|---|
preferredLocation | panel | Where Claude opens: sidebar (on the right) or panel (a new editor tab) |
useCtrlEnterToSend | false | Send with Ctrl+Enter or Cmd+Enter instead of Enter |
initialPermissionMode | unset | The mode new conversations start in: default (alias manual), acceptEdits, plan or bypassPermissions |
autosave | true | Save files before Claude’s Read, Edit and Write tools run; it doesn’t save before a notebook edit |
attachSelection, attachOpenFile | true | Send your selection, and which file is open, with each message |
respectGitIgnore | true | Leave .gitignore patterns out of file searches and selection context |
useTerminal | false | Open Claude in terminal mode |
environmentVariables | [] | Environment variables for the Claude process; a CLAUDE_CONFIG_DIR entry counts only as an absolute path |
disableLoginPrompt | false | Skip the sign-in screen, for third-party providers |
allowDangerouslySkipPermissions | false | Add Bypass permissions to the mode list; Anthropic says to use it only in sandboxes with no internet access |
claudeProcessWrapper | unset | An executable to launch Claude with, such as a separately installed claude |
archiveInactiveSessions | 14 | Days without activity before a session is archived: 1, 2, 7 or 14, or 0 for never |
The starting permission mode is where people get caught. The extension never reads a project’s .claude/settings.json or .claude/settings.local.json for it, and initialPermissionMode counts only in your user settings, never a workspace’s. Per Anthropic’s permission modes page, a new conversation starts in the first of these that applies:
claudeCode.initialPermissionMode, which doesn’t acceptauto;- the mode you last picked from the mode indicator under the prompt box, if it was Manual, Edit automatically or Auto (a pick of Plan or Bypass permissions lasts for that conversation only);
permissions.defaultModefrom managed settings or~/.claude/settings.json;- the built-in default: Auto from Claude Code 2.1.283, or Manual where auto mode isn’t available to you.
With claudeProcessWrapper set, the last two don’t apply, so conversations start in Manual unless the first two set a mode. A bypassPermissions value also starts in Manual unless Allow dangerously skip permissions is on. In VS Code’s user settings.json, a set of choices looks like this:
{
"claudeCode.initialPermissionMode": "plan",
"claudeCode.preferredLocation": "sidebar",
"claudeCode.useCtrlEnterToSend": true
}CopiedWhat each mode lets Claude do, and how a plan is approved, are in Claude Code plan mode and Claude Code without permission prompts.
Over Remote-SSH, in WSL and in dev containers
In a Remote-SSH, WSL or dev container window, VS Code runs most extensions on the remote side. For Claude Code, Anthropic’s dev container page says the panel and claude in the integrated terminal “both run inside the container and share the same ~/.claude configuration”, and its VS Code page, on fixing a TLS-inspecting proxy, says that in a window connected to WSL, an SSH host or a dev container you save the certificate file and edit ~/.claude/settings.json “on that system, not on your local computer.” Developer: Show Running Extensions in the Command Palette shows where each extension is running.
Install it on the host. In the remote window’s Extensions view, an extension that has to run remotely but is installed only on your computer shows dimmed under Local - Installed, with an Install button that puts it on the host. To have it on every SSH host you connect to, add it to your local user settings, per VS Code’s Remote-SSH docs:
"remote.SSH.defaultExtensions": ["anthropic.claude-code"]CopiedSet four extension settings again, remotely. The extension declares initialPermissionMode, environmentVariables, allowDangerouslySkipPermissions and claudeProcessWrapper with VS Code’s machine scope, and a remote window doesn’t inherit machine-scope settings from your local user settings. Set them for each host with Preferences: Open Remote Settings, or on the Remote tab of the Settings editor. The extension’s other settings carry over from your local ones.
Sign in there if the panel asks. If the browser lands on a connection error for a localhost address after you sign in from a remote window’s panel, the sign-in card says what to do on 2.1.325 and later. The route that works from any terminal: install the CLI on the host, run claude auth login, open the URL it prints in your local browser and paste the code the browser shows, as in Claude Code on Linux. On WSL 2 you can instead point BROWSER at your Windows browser, as in export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe".
Size the machine for Claude Code, not for VS Code. Remote-SSH asks for 1 GB of RAM on the host and recommends 2 GB and two cores. Claude Code’s own requirements are 4 GB or more and an x64 or ARM64 processor, and on Linux, Ubuntu 20.04 or later, Debian 10 or later, or Alpine 3.19 or later.
In WSL, install the CLI inside the distribution with the Linux installer, not from PowerShell or CMD. On WSL 1, claude fails with cannot execute binary file: Exec format error; Anthropic’s fix is to convert the distribution with wsl --set-version <DistroName> 2 in PowerShell (installing WSL 2 covers the rest). Keep the project on the Linux filesystem under /home rather than on /mnt/c, where Claude Code’s searches can come back with fewer matches than they should.
In a dev container, Anthropic’s feature ghcr.io/anthropics/devcontainer-features/claude-code:1.0 installs the CLI and, when you open the container in VS Code or Codespaces, adds the extension too. By default, the container’s home folder is discarded on rebuild, sign-in included, so mount a volume at ~/.claude and point CLAUDE_CONFIG_DIR at it in devcontainer.json, replacing /home/node with your remoteUser’s home:
"mounts": [
"source=claude-code-config,target=/home/node/.claude,type=volume"
],
"containerEnv": {
"CLAUDE_CONFIG_DIR": "/home/node/.claude"
}CopiedWhen the window closes. Anthropic’s VS Code page doesn’t say whether a conversation in the panel keeps running on the host once the window disconnects or your laptop sleeps. Work that has to carry on with nobody connected is better started with claude on the server itself, inside tmux, as in Claude Code on a VPS. Claude’s desktop app has SSH sessions of its own, set against Codex’s in Claude Code and Codex desktop apps over SSH.
When it goes wrong
The messages the extension shows, with Anthropic’s fixes from its VS Code troubleshooting and error reference:
| What you see | What to do |
|---|---|
No Spark icon in the editor toolbar | It appears only with a file open. Otherwise check VS Code is 1.94.0 or later (Help › About), run Developer: Reload Window, turn off other AI extensions such as Cline or Continue for a test, and trust the folder. ✻ Claude Code in the status bar works with no file open. |
claude not found in VS Code’s terminal | The extension doesn’t add claude to PATH. Install the CLI, as above. |
Could not locate the Claude CLI on PATH (Windows, PowerShell terminal) | Run where.exe claude in a PowerShell window outside VS Code. Put the install folder on your user or system PATH rather than in your PowerShell profile, which the extension doesn’t run, then restart VS Code. |
Claude Code did not finish starting or Subprocess initialization did not complete within 60000ms | Claude Code didn’t report it was ready within 60 seconds. View output logs (or Claude Code: Show Logs) shows how far it got; slow plugins, MCP servers, hooks, disks or network can each cause it. Since extension 2.1.304, up to 10 minutes of reported SessionStart or Setup hook time doesn’t count; if the message ends “check authentication and network connectivity”, the extension predates that, so update it. |
The Claude Code program for this computer, the Linux (linux-x64) build, could not be found | The extension holds no Claude Code build for your computer. If the message names the build it does hold, install the package for your platform; otherwise reinstall from the Extensions view, or set claudeProcessWrapper to a separately installed claude. Before 2.1.290 it read Unsupported platform. |
Claude Code process exited with code 1 | The real error is behind View output logs. Running claude in a terminal in the same project usually reproduces it with a readable message, and claude doctor checks the install. |
The connection to Claude Code ended before this message completed | Send the message again; that starts a fresh process, which resumes the conversation. |
/ide reports No available IDEs detected | Install the extension. If the extension is installed but claude in VS Code’s terminal doesn’t connect by itself, as under tmux, start it with CLAUDE_CODE_AUTO_CONNECT_IDE=true; if auto-connect still can’t find the running VS Code, CLAUDE_CODE_IDE_SKIP_VALID_CHECK=1 skips validation of its lock-file entries. |
Cmd+Esc does nothing on macOS | On macOS Tahoe and later, the Game Overlay shortcut takes it. In System Settings, go to Keyboard, Keyboard Shortcuts, Game Controllers and clear Game Overlay, or rebind Claude Code: Focus input in VS Code. |
The panel is blank | Update the extension to 2.1.309 or later and reload the window; if a Claude Code couldn’t load notice appears, work through its steps. |
The extension comes back after you uninstall it | /ide from an outside terminal reinstalls it. Set "autoInstallIdeExtension": false in ~/.claude.json, or set CLAUDE_CODE_IDE_SKIP_AUTO_INSTALL to 1 under env in a settings file, then uninstall again. |