How to Use Claude Code in VS Code: Extension Guide
How to use Claude Code in VS Code: install the official extension, sign in, review diffs, @-mention files, pick permission modes and fix common problems.
Josh Pocock8 min read
AI Coding
VS Code extension
Stride AI Academy
To use Claude Code in VS Code, install the official Claude Code extension from Anthropic, open a file, click the Spark icon in the top-right of the editor and sign in with your Claude account. The extension gives you a chat panel where Claude reads your code, proposes edits as side-by-side diffs and runs commands, all without leaving the editor. You need VS Code 1.94.0 or later and a paid Claude plan or a Claude Console account.
This guide covers installing the extension, opening the panel, signing in, the features you'll use every day, the settings worth changing, how the extension differs from the terminal CLI and how to fix the usual problems. Everything here was checked against Claude Code's VS Code docs and the Chrome integration docs on November 18, 2026.
What you need first
- VS Code 1.94.0 or later.
- An Anthropic account. Any paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. You don't need an API key. See how much Claude Code costs if you're picking a plan.
- Optional: the standalone CLI. The extension bundles its own copy of Claude Code for the chat panel. You only need the CLI install if you also want to run
claudein the integrated terminal.
How to install the Claude Code extension
- Press
Ctrl+Shift+X(Windows and Linux) orCmd+Shift+X(Mac) to open the Extensions view. - Search for "Claude Code".
- Check the publisher is Anthropic, then click Install.
If the extension doesn't show up after installing, restart VS Code or run Developer: Reload Window from the Command Palette.
Cursor and other VS Code forks
The same extension works in Cursor. It's also published on the Open VSX Registry, so forks that use Open VSX can install it there. If your editor can't install the extension at all, run the CLI in its built-in terminal instead.
How to open the panel and sign in
There are four ways to open Claude Code:
| Where | What to click |
|---|---|
| Editor toolbar | The Spark icon, top-right. Only shows when a file is open |
| Activity Bar | The Spark icon, which opens your sessions list |
| Command Palette | Ctrl+Shift+P / Cmd+Shift+P, type "Claude Code", pick Open in New Tab |
| Status bar | ✻ Claude Code, bottom-right. Works with no file open |
The first time, click Sign in and approve access in your browser. If you see "Not logged in · Please run /login", the sign-in screen should reopen. If it doesn't, reload the window.
The features you'll use every day
Selected text and @-mentions
Claude automatically sees the text you've selected. To point it at specific code, press Alt+K (Windows and Linux) or Option+K (Mac) in the editor. That inserts a reference with the file and line numbers, such as @file.ts#5-10.
In the prompt box you can also type:
@authto fuzzy-match a file by name@src/components/with a trailing slash to reference a whole folder@terminal:nameto include output from a named terminal
You can paste images straight in, and hold Shift while dragging a file onto the prompt box to attach it. Shift+Enter adds a new line.
Inline diffs you can accept or reject
In Manual mode, Claude shows each proposed edit as a side-by-side diff with Accept and Reject buttons. You can edit the proposed text before accepting it. There are also per-change buttons, and two commands for keyboard users: Claude Code: Accept Change at Cursor and Claude Code: Reject Change at Cursor.
Permission modes
The current mode shows at the bottom of the prompt box. Click it to switch:
| Mode in the extension | What happens |
|---|---|
| Manual | Claude asks before file edits and most shell commands |
| Edit automatically | Claude edits files without asking |
| Plan | Claude describes what it will do and waits for your approval |
| Auto | A classifier reviews most actions instead of asking you |
For the full picture of how modes and rules interact, see Claude Code permissions.
Plan review
Type /plan to switch to plan mode, or /plan fix the auth bug to start planning a specific task. VS Code opens the plan as a Markdown document, and you can add inline comments on it before Claude starts. The plan mode guide covers when that's worth doing.
Multiple conversations
Run Open in New Tab or Open in New Window to work on several tasks at once. A blue dot on a tab means Claude is waiting for permission. An orange dot means it finished while the tab was hidden. Click Session history at the top of the panel to search past conversations.
Checkpoints
Hover over any message to rewind. You can fork the conversation from that point, rewind your code to that point, or both.
Slash commands in the panel
Type / to open the command menu. A few useful ones: /model to change model, /mcp to manage MCP servers, /plugins to install plugins, /compact to shrink the conversation and /usage to check your plan usage. The extension supports a subset of the CLI's commands, so the slash commands guide won't all apply here.
Using the CLI in VS Code's terminal
You can still run the terminal version inside VS Code. Open the integrated terminal with Ctrl+` and run:
claudeThis needs the standalone CLI install. Installing the extension does not put claude on your PATH.
The extension and the CLI share conversation history, so you can start in the panel and continue in the terminal:
claude --resumeIf you run Claude Code in a terminal outside VS Code, type /ide to connect it to the open editor.
If you prefer the terminal look inside the extension, tick Use Terminal in the extension settings or run Open in Terminal from the Command Palette.
Extension vs terminal CLI
| Feature | CLI | VS Code extension |
|---|---|---|
| Commands and skills | All | A subset |
| MCP server setup | Yes | Yes, with /mcp in the panel |
| Checkpoints | Yes | Yes |
! bash shortcut |
Yes | No |
| Tab completion | Yes | No |
Settings in ~/.claude/settings.json are shared between the two, so permission rules, hooks and MCP servers you set up once apply in both places. Use the extension when you want to review diffs visually. Use the CLI when you need every command or want to script it.
Settings worth knowing
Open them under Extensions > Claude Code in VS Code settings.
| Setting | Default | What it does |
|---|---|---|
useTerminal |
false |
Terminal-style interface instead of the graphical panel |
initialPermissionMode |
unset | Starting mode: default, plan, acceptEdits or bypassPermissions |
preferredLocation |
panel |
Open in sidebar or panel |
autosave |
true |
Saves files before Claude reads or writes them |
useCtrlEnterToSend |
false |
Send with Ctrl/Cmd+Enter instead of Enter |
respectGitIgnore |
true |
Leaves .gitignore files out of searches |
allowDangerouslySkipPermissions |
false |
Adds bypass mode to the mode picker |
Leave the last one off unless you work in a sandbox with no internet access. Skipping permissions explains why.
Browser testing from VS Code
With the Claude in Chrome extension (version 1.0.36 or later) installed, type @browser and a task in the prompt box:
@browser go to localhost:3000 and check the console for errorsThe full setup is in Claude Code with Chrome.
Useful shortcuts
| Action | Windows and Linux | Mac |
|---|---|---|
| Toggle focus between editor and Claude | Ctrl+Esc |
Cmd+Esc |
| New conversation in a tab | Ctrl+Shift+Esc |
Cmd+Shift+Esc |
| Insert @-mention | Alt+K |
Option+K |
| Reopen closed session | Ctrl+Shift+T |
Cmd+Shift+T |
Troubleshooting
The Spark icon is missing. Open a file first. Then check VS Code is 1.94.0 or later, reload the window, disable other AI extensions that might conflict, and make sure the workspace is trusted. The extension doesn't run in Restricted Mode.
You set ANTHROPIC_API_KEY but still see the sign-in screen. Launch VS Code from a terminal with code ., or sign in with your Claude account.
The panel is blank. Update the extension, reload the window, then run Claude Code: Show Logs to read the logs.
Cmd+Esc does nothing on a recent macOS. A Game Overlay shortcut catches it. Clear that shortcut in System Settings, or rebind Claude Code: Focus input.
Claude never responds. Check your connection, start a new conversation, then run claude in a terminal to see a fuller error message.
Learn to build with Claude Code
The Stride AI Coding course teaches Claude Code and Codex for building client tools, written for non-programmers, with weekly live calls to review your builds. Many of the free guides cover Claude Code setups, and the Claude Code community is where members compare theirs.
FAQ
Is there an official Claude Code extension for VS Code?
Yes. Anthropic publishes the Claude Code extension on the Visual Studio Marketplace and Open VSX. Search "Claude Code" in the Extensions view and check the publisher is Anthropic.
Do I need an API key to use Claude Code in VS Code?
No. You can sign in with a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. Amazon Bedrock, Google Cloud and Microsoft Foundry are supported too, with the login prompt turned off.
Does the Claude Code extension work in Cursor?
Yes. The same extension installs in Cursor, and other forks can install it from Open VSX. If an editor can't install it, run the CLI in that editor's terminal.
What's the difference between the VS Code extension and the Claude Code CLI?
The extension adds a graphical panel with visual diffs, plan comments and session tabs. The CLI has every command and skill, the ! bash shortcut and tab completion. They share settings and conversation history.
Why can't I run claude in the VS Code terminal after installing the extension?
The extension bundles its own copy of Claude Code but doesn't add claude to your PATH. Install the standalone CLI to use it in the integrated terminal.
Can I use Claude Code in VS Code with Chrome?
Yes. Install the Claude in Chrome extension, then type @browser followed by a task in the prompt box. Claude opens tabs in your browser and reports back in the panel.