Visual Studio Code

Use Claude Code with Visual Studio Code through our native extension or CLI integration

VS Code Extension (Beta)

The VS Code extension, available in beta, lets you see Claude's changes in real-time through a native graphical interface integrated directly into your IDE. The VS Code extension makes it easier to access and interact with Claude Code for users who prefer a visual interface over the terminal.

Features

The VS Code extension provides:

Requirements

Installation

Download and install the extension from the Visual Studio Code Extension Marketplace.

Updating

To update the VS Code extension:

  1. Open the VS Code command palette with Cmd+Shift+P (Mac) or Ctrl+Shift+P (Windows/Linux)
  2. Search for "Claude Code: Update"
  3. Select the command to update to the latest version

How It Works

Once installed, you can start using Claude Code through the VS Code interface:

  1. Click the Spark icon in your editor's sidebar to open the Claude Code panel
  2. Prompt Claude Code in the same way you would in the terminal
  3. Watch as Claude analyzes your code and suggests changes
  4. Review and accept edits directly in the interface
    • Tip: Drag the sidebar wider to see inline diffs, then click on them to expand for full details

Using Third-Party Providers (Vertex and Bedrock)

The VS Code extension supports using Claude Code with third-party providers like Amazon Bedrock and Google Vertex AI. When configured with these providers, the extension will not prompt for login. To use third-party providers, configure environment variables in the VS Code extension settings:

  1. Open VS Code settings
  2. Search for "Claude Code: Environment Variables"
  3. Add the required environment variables

Environment Variables

Variable Description Required Example
CLAUDE_CODE_USE_BEDROCK Enable Amazon Bedrock integration Required for Bedrock "1" or "true"
CLAUDE_CODE_USE_VERTEX Enable Google Vertex AI integration Required for Vertex AI "1" or "true"
ANTHROPIC_API_KEY API key for third-party access Required "your-api-key"
AWS_REGION AWS region for Bedrock "us-east-2"
AWS_PROFILE AWS profile for Bedrock authentication "your-profile"
CLOUD_ML_REGION Region for Vertex AI "global" or "us-east5"
ANTHROPIC_VERTEX_PROJECT_ID GCP project ID for Vertex AI "your-project-id"
ANTHROPIC_MODEL Override primary model Override model ID "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
ANTHROPIC_SMALL_FAST_MODEL Override small/fast model Optional "us.anthropic.claude-3-5-haiku-20241022-v1:0"

For detailed setup instructions and additional configuration options, see:

Not Yet Implemented

The following features are not yet available in the VS Code extension:

We are working on adding these features in future updates.

Security Considerations

When Claude Code runs in VS Code with auto-edit permissions enabled, it may be able to modify IDE configuration files that can be automatically executed by your IDE. This may increase the risk of running Claude Code in auto-edit mode and allow bypassing Claude Code's permission prompts for bash execution.

When running in VS Code, consider:

Legacy CLI Integration

The first VS Code integration that we released allows Claude Code running in the terminal to interact with your IDE. It provides selection context sharing (current selection/tab is automatically shared with Claude Code), diff viewing in the IDE instead of terminal, file reference shortcuts (Cmd+Option+K on Mac or Alt+Ctrl+K on Windows/Linux to insert file references like @File#L1-99), and automatic diagnostic sharing (lint and syntax errors).

The legacy integration auto-installs when you run claude from VS Code's integrated terminal. Simply run claude from the terminal and all features activate. For external terminals, use the /ide command to connect Claude Code to your VS Code instance. To configure, run claude, enter /config, and set the diff tool to auto for automatic IDE detection.

Both the extension and CLI integration work with Visual Studio Code, Cursor, Windsurf, and VSCodium.

Troubleshooting

Extension Not Installing

Legacy Integration Not Working

For additional help, see our troubleshooting guide.