Skip to content

Claude Code in VS Code

Install and configure the Claude Code extension for VS Code. Get AI coding assistance with inline diffs, @-mentions, plan review and keyboard shortcuts.

Claude Code VS Code Extension

The VS Code extension provides a native graphical interface for Claude Code directly inside VS Code.

With the extension you can:

  • Review and edit Claude plans before accepting them
  • Auto-accept edits
  • Use @ mentions for files and line ranges
  • Access conversation history
  • Open multiple conversations in separate tabs or windows

Prerequisites

  • VS Code 1.98.0 or higher
  • An Anthropic account

TIP

You do not need to install the Claude Code CLI first.

Some advanced features such as MCP configuration still require the CLI.


Install the extension

Install directly:

Or manually:

  1. Open Extensions with:

    • Cmd+Shift+X on Mac
    • Ctrl+Shift+X on Windows/Linux
  2. Search for:

txt
Claude Code
  1. Click Install

TIP

You may need to restart VS Code or run Developer: Reload Window.


Get started

Open the Claude Code panel

You can open Claude Code in several ways:

Editor Toolbar

Click the Spark icon in the top-right corner of the editor.

Editor Toolbar

Command Palette

Open:

  • Cmd+Shift+P on Mac
  • Ctrl+Shift+P on Windows/Linux

Search for:

txt
Claude Code

Then select:

txt
Open in New Tab

Status Bar

Click:

txt
✱ Claude Code

in the bottom-right corner of VS Code.


Send a prompt

Ask Claude to help with:

  • debugging
  • explaining code
  • refactoring
  • generating code
  • reviewing files

TIP

Select text in the editor and press Alt+K to insert an @ mention with file path and line numbers.

Send Prompt


Review changes

When Claude wants to modify files, VS Code shows a diff preview.

You can:

  • Accept changes
  • Reject changes
  • Request modifications

Review Changes


Customize your workflow

Change the layout

You can move the Claude panel to:

  • Secondary sidebar (default)
  • Primary sidebar
  • Editor area

Switch to terminal mode

Enable terminal mode in VS Code settings:

txt
Extensions → Claude Code → Use Terminal

Or open:

txt
vscode://settings/claudeCode.useTerminal

Commands and shortcuts

CommandShortcut
Focus InputCmd+Esc / Ctrl+Esc
Open in New TabCmd+Shift+Esc / Ctrl+Shift+Esc
New ConversationCmd+N / Ctrl+N
Insert @ MentionAlt+K

Configure settings

Open settings:

  • Cmd+, on Mac
  • Ctrl+, on Windows/Linux

Then go to:

txt
Extensions → Claude Code

Important settings include:

  • Selected Model
  • Use Terminal
  • Preferred Location
  • Autosave
  • Respect Git Ignore
  • Disable Login Prompt

Use third-party providers

Claude Code can also work with:

  • Amazon Bedrock
  • Google Vertex AI
  • Microsoft Foundry

Configure providers in:

txt
~/.claude/settings.json

CLI vs VS Code extension

FeatureCLIExtension
Slash commandsFullPartial
MCP configYesPartial
Terminal shortcutsYesNo

Security considerations

When auto-edit permissions are enabled, Claude can modify VS Code configuration files.

WARNING

Review changes carefully before accepting them.

For untrusted projects:

  • Enable Restricted Mode
  • Use manual approvals
  • Disable auto-accept

Common issues

Extension will not install

  • Verify VS Code version
  • Check extension permissions
  • Restart VS Code

Spark icon missing

Try:

  1. Open a file first
  2. Restart VS Code
  3. Disable conflicting AI extensions
  4. Check workspace trust

Claude does not respond

  1. Check internet connection
  2. Start a new conversation
  3. Try the CLI:
bash
claude

Uninstall the extension

  1. Open Extensions
  2. Search for Claude Code
  3. Click Uninstall

Remove extension data:

bash
rm -rf ~/.vscode/globalStorage/anthropic.claude-code

Next steps

  • Explore workflows
  • Configure MCP servers
  • Customize Claude settings
  • Connect external providers

Documentation source: https://code.claude.com/docs/llms.txt