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 want | Use |
|---|---|
| A chat panel, side-by-side diffs you accept or reject, a plan you can comment on | The extension |
Every command and skill, ! shell commands, tab completion | The CLI in the integrated terminal |
| Both, depending on the task | Both: 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
- 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.
- Install it. Open the Extensions view with
Cmd+Shift+Xon Mac orCtrl+Shift+Xon Windows and Linux, search for Claude Code, check the publisher isanthropic.claude-code, and click Install. Cursor and other VS Code forks can install the same extension. - 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.
- 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+Kon Mac orAlt+Kon 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+Esc | Move focus between the editor and Claude |
Cmd+Shift+Esc / Ctrl+Shift+Esc | Open a conversation in a new tab |
Option+K / Alt+K | Insert an @-mention of your selection |
Cmd+Shift+T / Ctrl+Shift+T | Reopen 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
- Open the integrated terminal with
Cmd+`on Mac orCtrl+`on Windows and Linux. - 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. - From an external terminal, run
claude, then/ideto 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.
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.
Related Posts

Claude Code CLI: the commands, flags and shortcuts you'll use every day
The handful of Claude Code CLI commands, prefixes, shortcuts, slash commands and flags that cover a working day: start, resume and script a session, mention files, run shell commands, switch modes and models, and rewind.

Claude Code vs Cursor: how they differ when you work in them
Claude Code is a terminal-first agent that runs on Claude; Cursor is an AI editor with its own agent, Tab autocomplete and models from several labs. Where you work, which models you get, how each reads project rules, how you undo, and how each runs unattended.

Claude Code thinking: turn it on, off, and see what it reasoned
Thinking in Claude Code is the reasoning Claude emits before it responds, and on the newest models it's always on. Which models let you turn it off, the toggle, /config and MAX_THINKING_TOKENS, how to read the reasoning, and what it costs.