Back to Blog

Claude Code in VS Code: the extension or the terminal, and how to set up both

Alex Kim
6 min read
Claude Code in VS Code: the extension or the terminal, and how to set up both

Last updated: November 24, 2026

TL;DR

There are two ways to run Claude Code in VS Code, and they share one engine. Install the Claude Code extension from Anthropic for a chat panel with inline diffs, plan review and @-mentions of your selection. Or run claude in VS Code's integrated terminal and keep the full CLI, with the extension installed so diffs still open in the editor. Both use the same settings file and the same conversation history, so you can switch between them mid-task. Everything below comes from Anthropic's VS Code docs.

Pick the extension or the terminal

If you wantUse
A chat panel, side-by-side diffs you accept or reject, a plan you can comment onThe extension
Every command and skill, ! shell commands, tab completionThe CLI in the integrated terminal
Both, depending on the taskBoth: they share history and ~/.claude/settings.json

Anthropic's comparison table lists three things the extension doesn't have: the ! Bash shortcut, tab completion, and the full set of commands and skills (the extension has a subset; type / to see which). If you live in those, stay in the terminal. Our CLI guide covers what to type there.

Set up the extension

  1. Check your version. The extension needs VS Code 1.94.0 or later. Any paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account works, with no API key.
  2. Install it. Open the Extensions view with Cmd+Shift+X on Mac or Ctrl+Shift+X on Windows and Linux, search for Claude Code, check the publisher is anthropic.claude-code, and click Install. Cursor and other VS Code forks can install the same extension.
  3. Open the panel. Click the Spark icon in the editor toolbar (it shows only when a file is open), click ✻ Claude Code in the status bar (works with no file open), or run "Claude Code" from the Command Palette.
  4. Sign in when it asks, then type your first prompt.

Note that the extension bundles its own copy of the CLI for the panel. It does not put claude on your PATH; for that, install the standalone CLI.

Work in the panel

  • 🎯 Selection is context. Claude sees the text you have selected. Press Option+K on Mac or Alt+K on Windows and Linux to insert it as a reference such as @file.ts#5-10.
  • πŸ“ @ mentions files and folders with fuzzy matching; a trailing slash, as in @src/components/, targets a folder.
  • πŸ” Inline diffs. In Manual mode, each proposed change opens side by side with the original, and you accept it, reject it, or tell Claude what to do instead.
  • πŸ—ΊοΈ Plans as documents. In Plan mode, VS Code opens the plan as a full Markdown document you can comment on inline before Claude starts. Our plan mode guide covers when to plan first.
  • πŸ” Permission modes sit in the mode indicator in the prompt box: Auto, Manual, Plan and Edit automatically. Our permissions guide explains what each one allows.
  • βͺ Checkpoints. Hover over a message to fork the conversation or rewind code to that point.

The shortcuts worth learning first:

Shortcut (Mac / Windows and Linux)What it does
Cmd+Esc / Ctrl+EscMove focus between the editor and Claude
Cmd+Shift+Esc / Ctrl+Shift+EscOpen a conversation in a new tab
Option+K / Alt+KInsert an @-mention of your selection
Cmd+Shift+T / Ctrl+Shift+TReopen a closed session

On macOS Tahoe and later, the system Game Overlay can capture Cmd+Esc; the VS Code docs give the fix. Each conversation in its own tab or window keeps its own history, and the Session history button at the top of the panel finds, renames and archives old ones.

Run the CLI inside VS Code instead

  1. Open the integrated terminal with Cmd+` on Mac or Ctrl+` on Windows and Linux.
  2. Install the extension first, then run claude. The CLI connects to VS Code on its own, so diffs open in the editor and Claude reads your current selection.
  3. From an external terminal, run claude, then /ide to connect to VS Code.

Claude Code 2.1.318 and later no longer install the extension for you from the integrated terminal; until you install it, /ide reports "No available IDEs detected".

If you'd rather have the terminal look inside the extension, tick the Use Terminal setting (claudeCode.useTerminal), or run the Open in Terminal command.

Switch between them mid-task

The extension and the CLI share the same conversation history. To pick up an extension conversation in the terminal, run claude -r and choose it. Settings in ~/.claude/settings.json apply to both, so a permission rule or model you set once holds in either; our settings guide covers what goes in that file.

JetBrains works the CLI way

For IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm and GoLand, Anthropic's JetBrains plugin runs claude in the IDE's integrated terminal and connects to it. It doesn't bundle the CLI, so install both. Diffs open in the IDE's diff viewer, your selection is shared, Cmd+Esc or Ctrl+Esc opens Claude Code, and /ide connects from an external terminal.

Frequently asked questions

Is Claude Code in VS Code the same as the CLI?

Yes, underneath. The extension bundles its own copy of the CLI for the chat panel, and the two share conversation history and the settings in ~/.claude/settings.json. The CLI has a few things the extension lacks, such as the ! shell shortcut, tab completion and the full set of commands.

How do I install Claude Code in VS Code?

Open the Extensions view with Cmd+Shift+X or Ctrl+Shift+X, search for Claude Code, check the publisher is anthropic.claude-code, and install it. You need VS Code 1.94.0 or later and a paid Claude plan or a Claude Console account.

Does the VS Code extension install the claude command?

No. The extension bundles its own CLI for the panel and does not add claude to your PATH. Install the standalone CLI to use claude in a terminal.

How do I connect the Claude Code CLI to VS Code?

Install the extension, then run claude in VS Code's integrated terminal and it connects on its own. From an external terminal, run claude and then /ide.

Does Claude Code work in Cursor?

Yes. Cursor and other VS Code forks can install the same Claude Code extension from their Extensions view.

Next: the commands either way

Whichever surface you pick, the same few commands carry the day. Our Claude Code CLI guide lists the flags, slash commands and shortcuts to learn first, and our comparison with Cursor covers how working in Claude Code differs from an AI editor.

#claude-code#VS Code#IDE#JetBrains#ai-agents
Free assessment

Stop guessing. Score your first workflow.

Score one workflow in about five minutes. Nine questions, a grade, and the specific gap holding it back - no call required.