Claude Code in VS Code: install, first prompt and fixes
The VS Code extension puts Claude Code in a panel next to your code, with diffs you can read before accepting. It is the same Claude Code underneath, with a few differences from the terminal version that trip people up. Here is the short path from install to a first useful prompt, and what to check when something is missing.
Before you install
- A recent VS Code. As we read the docs, the minimum is 1.94.0. Check Help > About if the extension won't show up.
- An account. A paid Claude subscription or a Claude Console account works, and you do not need an API key. You sign in from the panel the first time you open it.
- The extension carries its own copy of the CLI. That copy runs the chat panel only. It does not put
claudeon your PATH, so typingclaudein a terminal still needs the standalone install (see fix “command not found: claude”).
Install and open it
- Press Ctrl+Shift+X (Cmd+Shift+X on Mac), search for Claude Code and click Install. It also installs in other VS Code-based editors such as Cursor; if one can't install it at all, run the CLI in that editor's terminal instead.
- If nothing appears afterwards, restart VS Code or run Developer: Reload Window from the Command Palette (Ctrl+Shift+P).
- Open the panel with the Spark icon at the top right of the editor. That icon only shows when a file is open. Other ways in: the Spark icon in the Activity Bar (it lists your sessions), the Command Palette (type “Claude Code”), or ✻ Claude Code in the Status Bar, which works even with no file open.
- Click Sign in and finish in your browser. If you set
ANTHROPIC_API_KEYin your shell but still see the sign-in screen, VS Code may not have inherited your environment: start it from a terminal withcode ., or sign in with your account.
Your first prompt
Ask the way you would in the terminal: explain this function, find why this test fails, make this change. Two things help right away:
- Claude sees your selection. Highlight code and the prompt box shows how many lines are attached. It also knows which file you have open. Alt+K (Option+K on Mac) inserts a reference with the file and line numbers, like
@app.ts#5-10. - Look at the mode. The permission mode sits at the bottom of the prompt box. In manual mode Claude shows a side-by-side diff of each proposed edit and waits for your answer; in an automatic mode it edits files without asking; in plan mode it writes a plan first and waits for approval. The starting mode can differ by version and plan, so read the indicator instead of assuming. Details in permission modes.
Give it the right context
@authfuzzy-matches a file or folder name. Add a trailing slash for a folder:@src/components/.@terminal:namepulls in the output of a terminal by its title, so you don't copy and paste errors.- Paste an image from your clipboard to attach it, or hold Shift while dragging files into the box.
- Shift+Enter adds a new line without sending.
- Don't want your selection or open file attached to every message? There are settings to turn off Attach Selection and Attach Open File in the extension's settings.
Resume, rewind, branch
- Session history, the button at the top of the panel, lets you search and reopen old conversations. Old inactive ones are archived automatically after a while, and you can unarchive them.
- The extension and the CLI share one history. To carry on an extension conversation in a terminal, run
claude --resumeand pick it. - Rewind: hover over a message and click the rewind button. You can fork the conversation from there, rewind the code to that point, or do both. See undoing changes with rewind.
Shortcuts worth knowing
- Ctrl+Esc (Cmd+Esc on Mac) toggles focus between the editor and Claude.
- Ctrl+Shift+Esc opens a new conversation as an editor tab.
- Ctrl+N starts a new conversation, but only while Claude is focused and the
enableNewConversationShortcutsetting is on. - Everything else is in the Command Palette: type “Claude Code” to list the extension's commands.
Extension or CLI?
As we read the docs, the extension supports a subset of commands and skills (type / to see yours), and a few terminal conveniences are CLI only, such as the ! shell shortcut and tab completion. To use the full CLI without leaving VS Code, open the integrated terminal with Ctrl+` (Cmd+` on Mac) and run claude; it connects to the editor for diffs and diagnostics. From an external terminal, run /ide to connect it to VS Code. See also the slash commands worth knowing and terminal setup.
When something is missing
- No Spark icon: open a file (a folder alone is not enough), check the VS Code version, run Developer: Reload Window, temporarily disable other AI extensions that may conflict, and make sure the workspace is trusted, because the extension does not work in Restricted Mode. The Status Bar button and the Command Palette work without it.
- Extension won't install: compatible VS Code version, permission to install extensions, or try the Marketplace page directly.
- Cmd+Esc does nothing on a Mac: a recent macOS binds that key to the Game Overlay. Clear that shortcut in System Settings, or rebind Claude Code: Focus input in VS Code's Keyboard Shortcuts editor.
- Errors such as “Could not locate the Claude CLI on PATH”, a 403 after sign-in or certificate errors: the docs have a table that points each message to its fix, so search for the exact text there.
- A stuck or slow session: Show Logs in the Command Palette shows the extension's debug logs.
All the guides are in the guides index. If you are new to all of this, start with how Claude Code works and everyday workflows; MCP servers and plugins work here too: add an MCP server, install plugins. This follows Anthropic's VS Code documentation as we read it in October 2026, shortened on purpose. We are not affiliated with Anthropic. We wrote this from the documentation and have not tested every setup or operating system. The extension changes often, many features are limited to recent versions, and where this page and the documentation disagree, the documentation wins.
See also: Claude Code in JetBrains IDEs.
The free loop-stop skill gives long tasks a limit and a stop rule. If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.