Configuring Claude Code Plugin in VS Code

Posted September 29, 2025 by XAI Technical Team ‐ 2 min read

In addition to using it in the terminal, you can seamlessly integrate Claude Code configuration into Visual Studio Code to enjoy the convenience of coding directly within the editor.

Step A: Install Claude Code Plugin

Install the official Claude Code Plugin

Step B: Configure Plugin to Use XAI Control

We need to tell the VS Code plugin to use XAI Control's service address and your API key.

1. Configure Service Address (API Base URL)

  • Open VS Code settings (shortcut Ctrl+, or Cmd+,).
  • Type claude-code.environmentVariables in the search box.
  • Under the found setting, click "Edit in settings.json".
  • Add the following JSON block to your settings.json file. If this setting already exists, make sure the content is merged correctly.
"claude-code.environmentVariables": [
    {
        "name": "ANTHROPIC_BASE_URL",
        "value": "https://api.xaicontrol.com"
    }
]

2. Configure Authentication Key (API Key)

  • Unlike the CLI, the VS Code plugin typically reads the key through a specific configuration file.
  • You need to create a folder named .claude in your user home directory, and create a config.json file within it.

For MacOS/Linux, open terminal and execute:

mkdir -p ~/.claude
echo '{"primaryApiKey": "Your XAI API Key"}' > ~/.claude/config.json

For Windows, open PowerShell and execute:

New-Item -ItemType Directory -Force -Path "$HOME\.claude"
Set-Content -Path "$HOME\.claude\config.json" -Value '{"primaryApiKey": "Your XAI API Key"}'
  • Make sure to replace Your XAI API Key with your actual XAI Control API key.

Step C: Restart and Start Using

  1. Completely exit and restart VS Code to ensure all configurations take effect.
  2. Click the Claude icon in the VS Code activity bar to open the chat window and start a conversation.
  3. You can now interact with Claude directly in VS Code, and all requests will be managed and logged through XAI Control.