AI & prompting

Claude Code for VS Code: Install and Set Up the Extension

To get Claude Code for VS Code, open the Extensions view with Ctrl+Shift+X (Cmd+Shift+X on a Mac), search for "Claude Code" and click Install. Then open the panel from the Spark icon, click Sign in, and finish authorization in your browser.

This guide follows Anthropic's documentation as of November 2026. Claude Code is an AI coding assistant; if you are new to Claude itself, what Claude is covers the basics.

What you need first

  • VS Code 1.94.0 or later.
  • An Anthropic account: a Pro, Max, Ultra, Team or Enterprise plan, or a Claude Console account. No API key is required. The free claude.ai plan does not include Claude Code.
  • Or a third-party provider: Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. Enable claudeCode.disableLoginPrompt for these.
  • Workspace trust. The extension does not work while VS Code is in Restricted Mode.

How to install the Claude Code extension

  1. Press Ctrl+Shift+X (Cmd+Shift+X on macOS) to open Extensions.
  2. Search for Claude Code, pick the one published by Anthropic (ID anthropic.claude-code), and click Install.
  3. If it does not show up afterwards, restart VS Code or run Developer: Reload Window from the Command Palette.

You can also install from a link: vscode:extension/anthropic.claude-code for VS Code or cursor:extension/anthropic.claude-code for Cursor. Other forks can use the Open VSX Registry. The extension's version number matches the Claude Code version it bundles.

Open the panel and sign in

There are four ways to open Claude:

  • Editor toolbar: the Spark icon at the top right of the editor. It only appears while a file is open.
  • Activity Bar: the Spark icon in the left sidebar opens the sessions list.
  • Command Palette: press Ctrl+Shift+P, type "Claude Code", and choose an entry such as Open in New Tab.
  • Status Bar: click ✻ Claude Code at the bottom right. This works even with no file open.

The first time, click Sign in and approve access in the browser window that opens.

Give Claude the right context

  • @-mentions: type @ and a name. Fuzzy matching works, so @auth finds an auth file. Add a trailing slash for a folder, like @src/components/.
  • Selected lines: select code and press Alt+K (Option+K on Mac) to insert a reference with line numbers, such as @file.ts#5-10.
  • Automatic context: Claude sees your selected text and the open file. The footer of the prompt box shows how many lines are selected. The settings attachOpenFile and attachSelection turn this off.
  • Terminal output: @terminal:name includes it.
  • Images: paste from the clipboard, or hold Shift while dragging a file into the prompt box.

Keyboard shortcuts

ActionWindows / LinuxMac
Focus input (toggle editor and Claude)Ctrl+EscCmd+Esc
Open in new tabCtrl+Shift+EscCmd+Shift+Esc
Reopen closed sessionCtrl+Shift+TCmd+Shift+T
Insert @-mention referenceAlt+KOption+K
New conversationCtrl+NCmd+N

Ctrl+N and Cmd+N only work after you set enableNewConversationShortcut to true, and only while Claude is focused.

Permission modes and reviewing edits

The mode indicator at the bottom of the prompt box controls how much Claude asks before acting:

ModeBehavior
ManualAsks before file edits and most shell commands.
PlanDescribes what it will do and waits for approval. Type /plan to enter it.
Edit automaticallyMakes edits without asking.
AutoA classifier reviews most actions instead of asking you.

In Manual mode, each edit opens a diff with Accept this change and Reject this change buttons. To start every session in a given mode, set initialPermissionMode to default, plan, acceptEdits or bypassPermissions. Leave bypass for sandboxes: the docs say to use allowDangerouslySkipPermissions only in sandboxes without internet.

Undo a change with checkpoints

Hover over any message to show the rewind button. It offers three choices: Fork conversation from here (new branch, code kept), Rewind code to here (reverts file changes, keeps history), and Fork conversation and rewind code.

Use the terminal version instead

The panel is the default. To get the CLI-style interface inside VS Code, turn on the Use Terminal setting (useTerminal), or run Open in Terminal from the Command Palette.

The extension does not put claude on your PATH. To type claude in the integrated terminal, install the standalone CLI. On Windows PowerShell:

irm https://claude.ai/install.ps1 | iex

On macOS, Linux or WSL:

curl -fsSL https://claude.ai/install.sh | bash

Open a new terminal, then check it worked:

claude --version

A working install prints a version number, for example 2.1.211 (Claude Code) (example output; yours will differ). claude --resume in the terminal also opens conversations started in the extension. From an external terminal, run /ide to connect to VS Code.

Settings worth knowing

Open them with Ctrl+,, then Extensions > Claude Code.

SettingDefaultWhat it does
preferredLocationpanelOpen in the sidebar or the editor panel.
autosavetrueSaves files before Claude reads or writes them.
respectGitIgnoretrueKeeps gitignored files out of search and selection context.
useCtrlEnterToSendfalseSend with Ctrl/Cmd+Enter instead of Enter.
archiveInactiveSessions14Days before sessions are archived. 0 disables it.

Permissions, environment variables, hooks and MCP servers are shared with the CLI and live in ~/.claude/settings.json. Type /mcp in the panel to manage MCP servers.

If the Spark icon is missing or the panel fails

  • No Spark icon: open a file (a folder alone is not enough), confirm VS Code is 1.94.0 or newer, reload the window, disable other AI extensions that may conflict, and make sure the workspace is trusted. The Status Bar entry works as a fallback.
  • Cmd+Esc does nothing on macOS Tahoe or later: clear Game Overlay under System Settings > Keyboard > Keyboard Shortcuts > Game Controllers, or rebind "Claude Code: Focus input".
  • Sign-in prompt keeps returning: if you use ANTHROPIC_API_KEY, launch VS Code with code . from a terminal that has the variable set. Otherwise sign in with your Claude account.
  • Blank panel: update to extension version 2.1.309 or later and reload. Run Claude Code: Show Logs for debug output.
  • Could not locate the Claude CLI on PATH: Anthropic points to its error reference page for this one.

If none of that helps, Anthropic asks for bug reports on the anthropics/claude-code GitHub issue tracker.

Frequently asked questions

Do I need an API key to use Claude Code in VS Code?
No. Anthropic's documentation says the extension needs an Anthropic account on a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account, and no API key. You sign in through your browser the first time you open the panel. The free claude.ai plan does not include Claude Code.
Does the extension work in Cursor and other VS Code forks?
Yes. Anthropic lists an Install for Cursor link (cursor:extension/anthropic.claude-code), and says other VS Code forks can install the extension from the Open VSX Registry. The extension ID is anthropic.claude-code.
Can I use Amazon Bedrock, Google Cloud or Microsoft Foundry instead of a Claude account?
Yes. The documentation lists all three as supported third-party providers. For these setups, turn on the Disable Login Prompt setting (claudeCode.disableLoginPrompt) so the extension does not ask you to sign in with a Claude account.
Does installing the extension also give me the claude command in the terminal?
No. The extension bundles its own CLI for the chat panel and does not add claude to your PATH. To run claude in the integrated terminal you need the standalone CLI install, for example irm https://claude.ai/install.ps1 | iex in Windows PowerShell.

Sources