
Claude Code is Anthropic's coding assistant, and it does more than answer questions: it reads your whole project, edits files, runs commands and asks for your permission before anything sensitive. The best place to use it is the editor you already write code in every day: VS Code.
In this guide you will connect Claude to VS Code with the official extension, sign in, reference files and lines of code, review changes before they are applied and, if you prefer the terminal, run Claude Code from the VS Code terminal. If you are still choosing between Claude and other tools, read Claude, ChatGPT, Gemini, Grok and Codex compared first.

Two ways to connect Claude to VS Code
| Method | Who it suits | What you get |
|---|---|---|
| The Claude Code extension | Most users | A graphical panel, diffs next to your code, quick references to files and selections |
| The CLI in the VS Code terminal | People who prefer the command line | The same Claude Code in a terminal, connected to the editor with /ide |
The two are not competitors. The extension ships with its own copy of Claude Code, which is enough for the graphical panel. But if you also want to run the claude command in a terminal, you need to install the CLI separately (explained below).
Requirements
- VS Code 1.94 or later. Check your version under Help › About and update if it is older.
- A paid Claude subscription (Pro, Max, Team or Enterprise) or a Claude Console account, which is billed by API usage. The free claude.ai plan does not include Claude Code. You do not need an API key to sign in to the extension.
- Workspace Trust. The extension does not work in Restricted Mode. When VS Code asks whether you trust the folder, choose Trust if the project is yours.
- A supported country. Anthropic only offers its services in supported countries; check the list and the terms of use before you buy a subscription.
Installing the Claude Code extension in VS Code

- In VS Code press
Ctrl+Shift+X(Cmd+Shift+Xon a Mac) to open the Extensions view. - Search for Claude Code. The right extension is Claude Code for VS Code, published by Anthropic, with the ID
anthropic.claude-code. Watch out for look-alike extensions from unknown publishers. - Click Install. If the icon does not appear after installing, restart VS Code or run Developer: Reload Window from the Command Palette.
- The Spark icon (Claude's orange star) now appears in several places. Any of them opens the Claude panel:
- The editor toolbar at the top right of the editor, when a file is open
- The Activity Bar on the left, which shows your list of conversations
- The status bar at the bottom of the window, on the words Claude Code
- The Command Palette: press
Ctrl+Shift+Pand type Claude Code
You can also install the extension straight from its page on the Visual Studio Marketplace. The same extension also installs in Cursor.
Signing in to your Claude account
The first time you open the panel, a sign-in screen appears:
- Click Sign in.
- Your browser opens. Sign in with your Claude or Claude Console account and approve access.
- Go back to VS Code. The panel is ready.
If you see "Not logged in", run Developer: Reload Window to bring the sign-in screen back. Organisations that use Claude through Amazon Bedrock, Google Cloud or Microsoft Foundry can turn off the sign-in screen with the claudeCode.disableLoginPrompt setting and connect with that provider's environment variables.
Your first request: how Claude sees your code
Type your request in plain language in the box at the bottom of the panel, for example "Add a /health route to the server that returns ok". A few habits make the results more precise:
- The open file and your selection are sent automatically. You do not need to copy code; Claude sees the active file and the lines you have selected.
- Reference files and folders with @. Type
@and part of a file name to get suggestions; end a folder name with/. - Reference exact lines with Alt+K. Select some lines and press
Alt+K(Option+Kon a Mac); a reference such as@server.mjs#3-5is added to your message. - Include terminal output.
@terminal:followed by the terminal's name adds its output, such as an error message, to the conversation. - New line with Shift+Enter. Enter sends the message.

Reviewing changes: look before you apply
The biggest advantage over copying code from a chatbot is that changes are shown as a diff next to your code before they are applied: removed lines in red and added lines in green.
- Every change has Accept and Reject buttons, so you can keep some parts and reject others.
- If you do not like a change, tell Claude what to adjust; there is no need to start over.
- The Command Palette also has Claude Code: Accept Change at Cursor and Reject Change at Cursor.
Permission modes
The current mode is shown under the message box, and you change it with a click:
| Mode | Behaviour | When to use it |
|---|---|---|
| Manual | Asks before every edit or command | The default and safest mode; for real projects |
| Plan | Writes a plan first and does not touch code until you approve | Big changes, or when you want to see the approach first |
| Edit automatically | Edits files without asking | Repetitive work in a project backed up with Git |
| Auto | Decides for itself which actions need your approval | Experienced users |
My advice: start with Manual and use Plan for changes that span several files.
Going back and earlier conversations
- Hover over an earlier message to reveal the rewind button; you can fork the conversation from that point or take the code back to that moment.
- The Session history button at the top of the panel lets you search and reopen earlier conversations.
- Open in New Tab keeps several separate conversations open at once.
Useful shortcuts
| Action | Windows and Linux | Mac |
|---|---|---|
| Open the Extensions view | Ctrl+Shift+X | Cmd+Shift+X |
| Focus the Claude message box | Ctrl+Esc | Cmd+Esc |
| Open Claude in a new tab | Ctrl+Shift+Esc | Cmd+Shift+Esc |
| Reference the selected lines | Alt+K | Option+K |
| Command Palette | Ctrl+Shift+P | Cmd+Shift+P |
| New line in a message | Shift+Enter | Shift+Enter |
| Open the VS Code terminal | Ctrl and the key above Tab | Ctrl and the key above Tab |
Method two: Claude Code in the VS Code terminal

If you are comfortable on the command line, or your editor does not support the extension, install the CLI. The official install commands:
Windows (PowerShell):
irm https://claude.ai/install.ps1 | iexmacOS, Linux and WSL:
curl -fsSL https://claude.ai/install.sh | bashThere are other options too: winget install Anthropic.ClaudeCode on Windows, brew install --cask claude-code on a Mac, or npm install -g @anthropic-ai/claude-code, which needs Node.js 22 or later. On Windows, installing Git for Windows is also recommended.
After installing:
- Open a new terminal (Ctrl and the key above Tab) so the program is found, and check the install with
claude --version. - Run
claudein your project folder. The first time, you will be asked to sign in. - If you run Claude Code in a terminal outside VS Code, type
/ideand choose VS Code, so Claude can see the open file and your selection and show diffs inside the editor.
The extension and the CLI share conversations: claude --resume in the terminal continues a conversation you started in the panel.
CLAUDE.md: tell Claude your project rules once
At the start of every conversation Claude Code reads the CLAUDE.md file in the project root. Put your build and test commands, naming rules and anything that must not be forgotten there, so you do not have to repeat it. The /init command creates a first version of this file from your project's structure.
Common problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| The Spark icon is missing | The window was not reloaded after installing, or no file is open | Developer: Reload Window, or open it from the Activity Bar or status bar |
| The extension will not install | VS Code is too old | Update VS Code to 1.94 or later |
| "Not logged in" | Sign-in did not finish | Reload Window and Sign in again |
| The extension does nothing and Restricted Mode is shown | The folder is not trusted | Choose Trust for the project folder |
claude is not recognised in the terminal | The CLI is not installed, or the terminal is old | Install the CLI separately and open a new terminal |
| You cannot sign in even though you have an account | Free plan, or an unsupported country | Check your plan and the list of supported countries |
Security tips
- Read every diff before you click Accept. Claude is accurate, but the code is your responsibility.
- Never paste passwords or keys into the conversation, and keep files like
.envin.gitignore; by default the extension skips gitignored files in search. - Commit your work before you start, so you always have a safe point to go back to.
- On production servers or sensitive projects use Manual or Plan, not the automatic modes.
Summary
Connecting Claude to VS Code takes four steps: open Extensions, search for Claude Code, click Install and Sign in. After that you reference code with @ and Alt+K, review changes as diffs and decide with Accept or Reject. If you prefer the terminal, install the CLI and connect it to the editor with /ide.
Claude Code is not only for programming; the same technology is the basis of agents that take repetitive work off a business. If you want an AI agent or automation for your company, see the AI agent development and AI-based business automation services, read Installing n8n on localhost or get in touch.
Official sources: Claude Code in VS Code documentation, Claude Code setup guide and the extension on the Visual Studio Marketplace.



