Issue 00 · Autumn 2026日本語 · RSS
AgentKoji

Claude Code in VS Code: Setup, Shortcuts and CLI Differences

Claude Code in VS Code runs as an extension on VS Code 1.94.0 or later. How to install it, pass selections and files, review diffs, and when to use the CLI.

TL;DR

  • The Claude Code extension adds a graphical panel to VS Code, and the docs call it the recommended way to use Claude Code there. It needs VS Code 1.94.0 or later and a paid Claude subscription or a Claude Console account, with no API key.
  • The extension bundles its own copy of the CLI for the chat panel but does not put claude on your PATH, so install the standalone CLI to run claude in the integrated terminal.
  • The extension and the CLI share ~/.claude/settings.json and the same conversation history, so claude --resume in a terminal can continue an extension conversation.

Claude Code runs as a CLI in the terminal, and also as a VS Code extension that puts it in a graphical panel inside the editor. The docs call the extension the recommended way to use Claude Code in VS Code. This guide covers what you need, how to install it, how to give Claude context and review its edits, the main shortcuts, when to switch to the CLI, MCP and plugins, and what to check when something doesn’t work.

On 2026-10-28 our test environment (macOS) reported Claude Code 2.1.312 from claude --version. VS Code is not installed there, so we did not install the extension or try any of the panel features below (not run). Everything about the extension’s behavior comes from the docs, checked the same day.

Requirements and installation

You need:

To install, press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux) to open the Extensions view, search for “Claude Code” and click Install. The extension ID is anthropic.claude-code. It also installs in Cursor, and in other VS Code forks from the Open VSX registry. If it doesn’t appear after installing, restart VS Code or run Developer: Reload Window from the Command Palette.

The extension’s version number is the Claude Code version it bundles. A feature that needs Claude Code v2.1.286 or later needs version 2.1.286 or later of the extension, which the Extensions view shows. Many features below carry a minimum version like this, so check yours first when something described here is missing.

The extension ships its own copy of the CLI for the chat panel. To run claude in VS Code’s integrated terminal, install the standalone CLI as well. On macOS, Linux and WSL the native installer is:

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

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28 Source: https://code.claude.com/docs/en/setup, checked 2026-10-28

For the rest of the CLI setup, see getting started with Claude Code.

Opening the panel and signing in

The Spark icon marks Claude Code throughout VS Code. The quickest way in is the Spark icon in the Editor Toolbar, at the top right of the editor. It only appears when a file is open. Other ways in:

The first time you open the panel, a sign-in screen appears. Click Sign in and finish authorization in the browser.

Past conversations are under the Session history button at the top of the panel, where you can search by keyword or browse by time. Clicking one resumes it. By default, a session with no activity for 14 days moves to Archived sessions, unless it is open, unread or in a group (v2.1.265 or later; the archiveInactiveSessions setting changes the period or turns it off).

If you prefer the CLI-style interface inside VS Code, turn on the Use Terminal setting under Extensions > Claude Code.

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

Giving Claude context

To keep this context out of your messages, turn off Attach Selection (v2.1.300 or later) or Attach Open File (v2.1.271 or later) in VS Code’s settings. Both settings also apply when you run claude in the integrated terminal.

The chat panel also withholds selected text from some files. For a workspace file that matches files.exclude or search.exclude, Claude receives at most its path. The same goes for files git ignores, as long as VS Code’s search.useIgnoreFiles and the extension’s respectGitIgnore are both on, which is the default. This filter covers the chat panel only. When claude runs in the integrated terminal, Claude can receive text you select in those files; the docs say to add a Read deny rule to keep a file such as .env away from Claude there.

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

Reviewing edits and switching modes

The current permission mode is shown at the bottom of the prompt box. Click it to switch between Auto, Manual, Plan and Edit automatically. With Claude Code v2.1.283 or later, Auto is the built-in starting mode; on earlier versions that applied only on Pro, Max and Team plans.

To review an edit one change at a time, use Accept this change and Reject this change under each change in the diff (v2.1.275 or later). The same actions exist as Claude Code: Accept Change at Cursor and Claude Code: Reject Change at Cursor. A diff with more than 100 changes opens without the per-change buttons, so review it as a whole file.

Checkpoints work in the extension too. Hover over a message for the rewind button, then choose Fork conversation from here, Rewind code to here or Fork conversation and rewind code.

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

For how plan mode works in general, see Claude Code plan mode.

Keyboard shortcuts

ActionMacWindows/Linux
Toggle focus between the editor and ClaudeCmd+EscCtrl+Esc
Open a new conversation in an editor tabCmd+Shift+EscCtrl+Shift+Esc
Insert an @-mention for the current file and selection (editor focused)Option+KAlt+K
Reopen the most recently closed Claude session tabCmd+Shift+TCtrl+Shift+T
Toggle Focus view (hide tool activity)Ctrl+Option+FCtrl+Alt+F
New line without sendingShift+EnterShift+Enter

Cmd+N / Ctrl+N starts a new conversation only when Claude is focused and enableNewConversationShortcut is set to true; it is off by default. Every extension command is listed in the Command Palette under “Claude Code”.

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

Extension vs CLI

FeatureCLIVS Code extension
Commands and skillsAllSubset (type / to see them)
MCP server configYesYes, with /mcp in the chat panel
CheckpointsYesYes
! Bash shortcutYesNo
Tab completionYesNo

When you need a CLI-only feature, open the integrated terminal (Cmd+` / Ctrl+`) and run claude. The CLI connects to VS Code on its own for diff viewing and diagnostic sharing. From an external terminal, run /ide inside Claude Code to connect it to VS Code.

That connection goes through a local MCP server the extension runs, named ide and hidden from /mcp. Only two of its tools are visible to the model: mcp__ide__getDiagnostics, which reads the errors and warnings in the Problems panel, and mcp__ide__executeCode, which runs Python in the active Jupyter notebook only after you pick Execute in a VS Code prompt. In the chat panel (v2.1.285 or later), diagnostics come from a separate server, so a hook or permission rule that should cover both names mcp__ide__getDiagnostics and mcp__claude-vscode__getDiagnostics.

The extension and the CLI share the same conversation history. To continue an extension conversation in the CLI, run claude --resume in the terminal and pick it from the list.

Settings live in two places. ~/.claude/settings.json is shared by the extension and the CLI and holds allowed commands, environment variables, hooks and MCP servers. Extension-only settings are in VS Code under Extensions > Claude Code.

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28 Source: https://code.claude.com/docs/en/commands, checked 2026-10-28

Resuming in the terminal is covered in Claude Code resume, commands in the slash commands cheat sheet, and settings.json rules in Claude Code permissions and settings.json.

MCP and plugins

Type /mcp in the chat panel to add servers, remove servers saved at the local, user or project scope, enable or disable them, reconnect, and manage OAuth. Adding and removing in the dialog needs v2.1.261 or later. claude mcp add in the integrated terminal saves to the same configuration, and changes from either take effect in conversations you start afterwards.

Type /plugins to open Manage plugins. When you install a plugin, you pick a scope:

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

When it doesn’t work

Source: https://code.claude.com/docs/en/vs-code, checked 2026-10-28

Summary

FAQ

What do I need to use Claude Code in VS Code?
VS Code 1.94.0 or later and an Anthropic account: a paid Claude subscription (Pro, Max, Team or Enterprise) or a Claude Console account. No API key is required.
Why is claude not found in the VS Code terminal after installing the extension?
The extension bundles a private copy of the CLI for its chat panel and does not add claude to your PATH. Install the standalone CLI to run claude in the integrated terminal.
Can I continue a VS Code extension conversation in the CLI?
Yes. The extension and the CLI share the same conversation history. Run claude --resume in a terminal and pick the conversation from the picker.
Why does Cmd+Esc do nothing in VS Code on macOS?
On macOS Tahoe and later, the system Game Overlay shortcut takes Cmd+Esc first. Clear it under System Settings, Keyboard, Keyboard Shortcuts, Game Controllers, or rebind Claude Code: Focus input in VS Code.
Does the extension send selected text from gitignored files?
In the chat panel, no: for files that match files.exclude, search.exclude or a gitignore pattern, Claude receives at most the path, as long as the default settings are on. The filter does not apply to claude in the integrated terminal.