Quick correction before anything else, since it still trips people up: if you search "claude code vscode", a lot of what comes up tells you there's no official Claude Code integration and you should wire Claude in through a third-party extension and an API key. That was true once. It isn't now. Anthropic ships a Claude Code extension for VS Code, its docs call it the recommended way to use Claude Code there, and you don't need an API key to use it.
I spend most of my week inside existing repos: reading code someone else wrote, fixing it, and reviewing what Claude proposes before it lands. That's where this extension earns its keep. (For brand-new throwaway sites I don't open VS Code at all. I start in begin, which turns a prompt into a Next.js/React/Tailwind project I can then pull into VS Code like any other repo.)
What follows is how I set the extension up, the settings I change on day one, and a few things that aren't obvious from the marketplace page.
Claude Code VS Code extension: what you need first
From the official VS Code docs, the prerequisites are short:
- VS Code 1.94.0 or later
- A paid Claude subscription (Pro, Max, Team or Enterprise) or a Claude Console account. No API key is required; you sign in through the browser the first time you open the panel.
If your company reaches Claude through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry, that's supported too. You tick Disable Login Prompt in the extension settings and configure the provider in ~/.claude/settings.json.
Installing is the usual Extensions view search for "Claude Code", or from a terminal:
code --install-extension anthropic.claude-code
Two details I wish I'd known earlier:
- The extension's version number is the Claude Code version it bundles. When the docs say a feature needs v2.1.280 or later, check the extension version in the Extensions view. That's the number that matters.
-
It does not put
claudeon your PATH. The panel uses a private bundled copy of the CLI. If you also wantclaudein the integrated terminal, do the standalone CLI install separately.
Cursor and other VS Code forks can install it too, either from their own extension search or from Open VSX.
The first ten minutes
Open any file, and a Spark icon shows up in the top-right editor toolbar. That's the fastest way in. It only appears when a file is open; having just a folder open isn't enough, which confused me for a minute. You can also click ✻ Claude Code in the status bar, which works with no file open, or use the Spark icon in the Activity Bar to see your sessions.
The habit that changed the most for me is selection-as-context. Whatever you highlight, Claude already sees. Press Option+K on Mac or Alt+K on Windows/Linux and it inserts a precise reference like @app.ts#5-10 into the prompt. That beats pasting code into a chat window, because Claude knows exactly which file and lines you mean and can go read the surrounding code itself.
Other context tricks worth learning on day one:
-
@src/components/(with the trailing slash) pulls in a folder;@authfuzzy-matchesauth.js,AuthService.tsand friends. -
@terminal:namereferences a terminal's output by its title, so I stop copy-pasting stack traces. - Paste a screenshot straight into the prompt box. Hold
Shiftwhile dragging to attach files.
Pick a permission mode on purpose
This is the part older tutorials skip entirely, and it matters more than prompt phrasing. The mode indicator at the bottom of the prompt box has four options:
| Mode | What happens | When I use it |
|---|---|---|
| Plan | Claude writes a plan and waits. VS Code opens it as a Markdown doc you can comment on inline. | Anything touching more than two files |
| Manual | Asks before file edits and most shell commands; shows a side-by-side diff per edit. | Unfamiliar or sensitive repos |
| Auto | A classifier reviews most actions instead of asking you. | Well-tested repos where I trust the guardrails |
| Edit automatically | Edits files without asking. | Scratch branches only |
With Claude Code v2.1.283 or later, Auto is the built-in starting mode. I override that. Plan mode with inline comments is the single best feature in the extension: I correct the approach in the plan, before any code exists, instead of arguing with a diff afterwards. You can also type /plan fix the auth bug to jump straight in.
In Manual mode, diffs now have per-change Accept this change and Reject this change buttons (v2.1.275+), so you're no longer forced into all-or-nothing on a file. One caveat: diffs with more than 100 changes open without those buttons.
Settings I change on day one
There are two settings files, and mixing them up cost me some time:
-
VS Code user settings for the extension's behaviour (
claudeCode.*keys). -
~/.claude/settings.jsonfor things shared with the CLI: permissions, hooks, MCP servers, environment variables.
My VS Code side:
{
"claudeCode.initialPermissionMode": "plan",
"claudeCode.preferredLocation": "sidebar",
"claudeCode.useCtrlEnterToSend": true
}
initialPermissionMode is only read from user settings. Workspace values are ignored, so don't bother committing it to .vscode/settings.json. useCtrlEnterToSend stops me from sending half-written prompts when I hit Enter for a new line (Shift+Enter also works).
On the Claude Code side, the docs suggest adding "$schema": "https://json.schemastore.org/claude-code-settings.json" to ~/.claude/settings.json so VS Code autocompletes and validates it. Then I add a Read deny rule for .env. The docs point out that a matching deny rule stops both selected text and the open-file notice for that file from reaching Claude.
Checkpoints: the undo button I lean on
Hover over any message and you get a rewind button with three choices: Fork conversation from here, Rewind code to here, or both. "Rewind code to here" is what makes Edit automatically mode survivable. If Claude goes off in a bad direction across six files, I roll the files back to before that message and keep the conversation, so I can explain what went wrong.
Panel or terminal?
Both, honestly. The extension and the CLI share conversation history, so I start in the panel and run claude --resume in the terminal when I need something CLI-only. Per the docs, the gaps are:
- The panel exposes a subset of commands and skills (type
/to see them); the CLI has all of them. - The
!bash shortcut and tab completion are CLI-only. - MCP config and checkpoints work in both. In the panel,
/mcpopens a dialog to add and manage servers.
If you just prefer the terminal UI, the Use Terminal setting launches Claude in terminal mode inside VS Code.
Things that bit me (so they don't bite you)
-
ANTHROPIC_API_KEYset in your shell but still getting the sign-in screen? VS Code may not have inherited your shell environment. Launch it from a terminal withcode .. - No Spark icon? Open a file, check you're on 1.94.0+, reload the window, and temporarily disable other AI extensions. The docs specifically name Cline and Continue as possible conflicts, which is ironic given how many guides tell you to install Continue for this.
-
Untrusted repos. With auto-edit on, Claude can modify
.vscode/settings.jsonortasks.json, which VS Code may execute. The docs recommend Restricted Mode for untrusted workspaces (the extension doesn't run there) and Manual mode for edits. -
Usage surprises.
/usageshows your plan's limit bars, with reset times, and flags what's eating them, like cache misses or subagent-heavy sessions.
Wrapping up
The official extension does what people were hacking together with third-party plugins a year ago, plus things those never had: plan review with inline comments, per-change diff review, checkpoints, and one session history shared with the CLI. Set the permission mode deliberately, learn Alt+K, and keep secrets behind a deny rule.
And when the job is a fresh prototype rather than an existing codebase, I still let begin produce the first build, then open that repo in VS Code and let Claude Code take it from there.
FAQ
Is there an official Claude Code extension for VS Code?
Yes. It's published by Anthropic (anthropic.claude-code), and Anthropic's docs call it the recommended way to use Claude Code in VS Code.
Do I need an Anthropic API key for Claude Code in VS Code?
No. A paid Claude plan (Pro, Max, Team, Enterprise) or a Claude Console account works; you sign in through the browser.
Why can't I run claude in the VS Code terminal after installing the extension?
The extension bundles a private CLI and doesn't add it to your PATH. Install the standalone CLI to use claude in any terminal.
Does Claude Code work in Cursor?
Yes. Install it from Cursor's extension search or Open VSX. If your editor can't install it, run the CLI in its integrated terminal.
Top comments (0)