ES · Leer en español Explore for free

Recipe · Basic · 10 min

Claude Code in VS Code: extension or terminal, how to install

Install the official Claude Code extension for VS Code (anthropic.claude-code), compare it with the terminal CLI and use it safely in Cursor.

Tested with Claude Code 2.1.316 · reviewed

The problem

Most of us code in VS Code, and it is not obvious how to bring Claude Code into it: the extension, the CLI in the integrated terminal, or both? Is it free? Does it work in Cursor or Windsurf? And there is a new worry: on October 29, 2026, the Cursor marketplace served a tampered copy of the extension. This recipe leaves you with the official extension installed, verified and set up properly.

The solution

1. Check the requirements

According to the official documentation:

2. Install the official extension

The official identifier is anthropic.claude-code and the publisher is Anthropic. Install it from the terminal:

code --install-extension anthropic.claude-code

Or in VS Code: open Extensions (Ctrl+Shift+X; on Mac Cmd+Shift+X), search for "Claude Code" and pick the one from publisher Anthropic. If it does not show up after installing, restart VS Code or run Developer: Reload Window from the Command Palette.

3. Check it comes from the official publisher

The name is not enough: the tampered copy in Cursor used the same identifier, anthropic.claude-code. Check three things:

  1. On the extension page, the publisher is Anthropic with the verified badge and the anthropic.com domain. On the Visual Studio Marketplace, the anthropic publisher has a verified domain; on Open VSX the Anthropic namespace is shown as verified.
  2. The installed version:
code --list-extensions --show-versions | grep -i claude

This is the output on the machine where this recipe was tested (VS Code 1.136.1 on Linux):

anthropic.claude-code@2.1.312
  1. The publisher the extension itself declares:
grep '"publisher"' ~/.vscode/extensions/anthropic.claude-code-*/package.json

It must say "publisher": "Anthropic". And never install a .vsix someone sends you by chat, email or a link: use your editor's marketplace.

4. Open it and learn the shortcuts

To open Claude Code you have the Spark icon at the top right of the editor (it only appears when a file is open), the Activity Bar icon, ✻ Claude Code in the Status Bar, or the Command Palette (Ctrl+Shift+P, type "Claude Code").

ActionWindows/LinuxMac
Toggle focus between the editor and ClaudeCtrl+EscCmd+Esc
Open in a new tabCtrl+Shift+EscCmd+Shift+Esc
Insert a mention of the current file and selectionAlt+KOption+K
Reopen a closed sessionCtrl+Shift+TCmd+Shift+T
New conversation (turn on enableNewConversationShortcut first)Ctrl+NCmd+N
New line in the promptShift+EnterShift+Enter

5. Use mentions and diffs

6. Decide: extension, CLI or both

The extension bundles its own CLI for the chat panel, but it does not add claude to your PATH. If you want the CLI in the integrated terminal, install it separately:

curl -fsSL https://claude.ai/install.sh | bash
claude --version

The differences according to the official documentation:

FeatureCLI in the terminalVS Code extension
Commands and skillsAllA subset (type / to see them)
MCP configurationYesYes (/mcp in the panel)
CheckpointsYesYes
! Bash shortcutYesNo
Tab completionYesNo

You do not have to choose forever: both share history. Start in the panel and continue in the terminal with claude --resume. If you run claude in an external terminal, run /ide to connect it to VS Code and see diffs in the editor.

Our recommendation: the extension for day-to-day work (diffs, Alt+K mentions) and the CLI when you need every command, the ! shortcut or scripts.

7. Cursor, Windsurf and other forks

Anthropic publishes the extension on the Visual Studio Marketplace and Open VSX, and warns that it does not endorse or audit third-party marketplaces.

8. Security notice: the tampered copy in Cursor

This is what the Cursor security notice and StepSecurity confirm:

If you use Cursor and it updated that day, look for the key (macOS and Linux):

grep -qs svc-telemetry ~/.ssh/authorized_keys && echo "svc-telemetry key found" || echo "No key: machine not affected"

If it shows up, uninstalling the extension is not enough: follow the steps in our news post about the incident and in Cursor's notice.

Check it

  1. Open a folder with code, open a file and press Ctrl+Esc (Cmd+Esc on Mac). The Claude Code panel opens.
  2. Select a few lines, press Alt+K and you will see something like @app.ts#5-10 in the prompt box.
  3. Ask for a small change ("add a comment to this function"). In Manual mode a diff opens with buttons to accept or reject.
  4. If you installed the CLI, in the integrated terminal (menu Terminal > New Terminal):
claude --version
2.1.316 (Claude Code)

Why it works

The extension runs Claude Code inside VS Code and also starts a local MCP server called ide that listens only on 127.0.0.1, on a random port, with a new token each time it starts. The CLI connects to it to open diffs in the editor, read your selection and see diagnostics. That is why the extension and the terminal complement each other and share history. It is explained in the VS Code documentation.

Common mistakes

FAQ

Is Claude Code for VS Code free?

The extension is free to install, but to use it you need a paid Claude plan (Pro or higher) or a Claude Console account, which bills by usage.

Do I need to install the CLI if I already have the extension?

Not for the chat panel: the extension bundles its own CLI. Yes if you want to run claude in the terminal, which gives you every command and the ! shortcut.

Does it work in Cursor and Windsurf?

In Cursor, yes, with the official link cursor:extension/anthropic.claude-code. For other forks the documentation points to Open VSX; either way, check that the publisher is the verified Anthropic one.

Is the 2.1.312 version I have in VS Code dangerous?

According to Cursor and Anthropic, the tampered copy was only served from the Cursor marketplace. On the test machine, VS Code's 2.1.312 came from the Visual Studio Marketplace. Even so, update to 2.1.314 or later.

Can I move a conversation from the extension to the terminal?

Yes. They share history: run claude --resume in the terminal and pick the conversation.

All recipes