Skip to content

Claude Code for VSCode ​ ​

VSCode extension version of Claude Code, offering full Claude Code capabilities directly in the editor without switching to the terminal.

Installation ​ ​

  • Open VSCode
  • Go to the Extensions Store (Ctrl+Shift+X / Cmd+Shift+X)
  • Search for "Claude Code"
  • Click Install

Configuration ​ ​

Mac / Linux ​ ​

Add environment variables in ~/.bash_profile or ~/.zshrc:

bash

echo 'export ANTHROPIC_API_KEY="sk-xxx"' >> ~/.bash_profile
echo 'export ANTHROPIC_BASE_URL="https://www.fast-api.org"' >> ~/.bash_profile
source ~/.bash_profile

Windows ​ ​

Edit ~/.claude/settings.json:

json

{
  "env": {
    "ANTHROPIC_MODEL": "claude-sonnet-4-20250514",
    "ANTHROPIC_BASE_URL": "https://www.fast-api.org",
    "ANTHROPIC_API_KEY": "sk-xxx"
  }
}

VSCode settings.json (Optional) ​ ​

You can also configure terminal environment variables in VSCode's settings.json:

json

{
  "terminal.integrated.env.osx": {
    "ANTHROPIC_API_KEY": "sk-xxx",
    "ANTHROPIC_BASE_URL": "https://www.fast-api.org"
  },
  "terminal.integrated.env.linux": {
    "ANTHROPIC_API_KEY": "sk-xxx",
    "ANTHROPIC_BASE_URL": "https://www.fast-api.org"
  },
  "terminal.integrated.env.windows": {
    "ANTHROPIC_API_KEY": "sk-xxx",
    "ANTHROPIC_BASE_URL": "https://www.fast-api.org"
  }
}

Usage Example ​ ​

  • Press Ctrl+Shift+P / Cmd+Shift+P to open the Command Palette
  • Enter Claude to view available commands
  • Select Claude Code: Open to start the interactive panel
  • Enter your task description in the panel to start using

FAQ ​ ​

No response after installing the extension ​ ​

Make sure environment variables are correctly configured and restart VSCode. The extension needs to read environment variables to connect to the API.

Authentication failed prompt ​ ​

Check if ANTHROPIC_API_KEY is correct and confirm the key begins with sk-.

How to switch models ​ ​

Use the /model command in the Claude Code panel to switch models.

Notes ​ ​

  • Configuration is identical to Claude Code CLI; environment variables are interchangeable
  • Base URL should be https://www.fast-api.org, do not append /v1
  • Restart VSCode after modifying environment variables to take effect