Claude Code VS Code Extension

The Claude Code VS Code Extension brings Claude Code’s agentic coding capabilities directly into VS Code. This guide shows how to configure the extension to use LLM Gateway.

Warning

Beta Status (as of 8.12.2025): This extension is currently in beta. Some features available in the CLI version may not be available yet, including checkpoints/rewinding, MCP configuration UI, and subagent configuration. For full feature support, consider using the Claude Code CLI.

Prerequisites

Configuration

Configure Claude Code via VS Code’s settings.json:

  1. Open VS Code Settings (Ctrl+, / Cmd+,)
  2. Click the “Open Settings (JSON)” icon in the top right
  3. Add the following configuration:
{
  "claudeCode.environmentVariables": [
    {"name": "ANTHROPIC_DEFAULT_HAIKU_MODEL", "value": "anthropic.claude-haiku-4-5-20251001-v1:0-native"},
    {"name": "ANTHROPIC_DEFAULT_SONNET_MODEL", "value": "anthropic.claude-sonnet-4-5-20250929-v1:0-native"},
    {"name": "ANTHROPIC_BEDROCK_BASE_URL", "value": "https://<llmgw-deployment-url>/aws-bedrock"},
    {"name": "ANTHROPIC_AUTH_TOKEN", "value": "your-llmgw-token-here"},
    {"name": "CLAUDE_CODE_USE_BEDROCK", "value": "1"},
    {"name": "CLAUDE_CODE_SKIP_BEDROCK_AUTH", "value": "1"}
  ],
  "claudeCode.preferredLocation": "panel"
}

Configuration Options Explained

Variable Description
ANTHROPIC_DEFAULT_HAIKU_MODEL Model ID for fast/cheap operations
ANTHROPIC_DEFAULT_SONNET_MODEL Model ID for complex tasks
ANTHROPIC_BEDROCK_BASE_URL LLMGW AWS Bedrock endpoint
ANTHROPIC_AUTH_TOKEN Your LLMGW API token
CLAUDE_CODE_USE_BEDROCK Enable Bedrock mode
CLAUDE_CODE_SKIP_BEDROCK_AUTH Skip AWS auth (LLMGW handles authentication)
claudeCode.preferredLocation Where to show Claude Code (panel or sidebar)

Model Selection

Claude Code uses two models:

  • Haiku model - Used for fast, simple operations (file summaries, quick questions)
  • Sonnet model - Used for complex coding tasks (code generation, refactoring)

Cost Saving Tip: For testing purposes, set both models to Haiku to minimize costs. You can upgrade to Sonnet later when you need better quality for complex tasks.

Available Models

Check the Available Models page for the current list. Common options:

Model Use in Variable
Claude Haiku 4.5 (Recommended for testing) anthropic.claude-haiku-4-5-20251001-v1:0-native
Claude Sonnet 4.5 (For production/complex tasks) anthropic.claude-sonnet-4-5-20250929-v1:0-native

Beta Limitations

The VS Code extension is in beta and has some limitations compared to the CLI:

Feature CLI VS Code Extension
Core coding capabilities Yes Yes
Plan review system Yes Yes
Auto-accept mode Yes Yes
Extended thinking Yes Yes
MCP integration Yes Yes (but configure via CLI first)
Checkpoints/rewinding Yes Not yet
MCP configuration UI Yes Not yet
Subagent configuration Yes Not yet

Security Considerations

Info

Claude Code in VS Code runs with auto-edit permissions enabled, which means it may modify IDE configuration files. For untrusted workspaces:

  1. Enable VS Code Restricted Mode
  2. Use manual approval mode instead of auto-accept
  3. Only use Claude with trusted prompts

Verification

To verify your configuration is working:

  1. Open a project in VS Code
  2. Open the Claude Code panel (click the Claude icon in the sidebar or Activity Bar)
  3. Ask a simple question to test connectivity:
    What is 2 + 2?
  4. Check the LLMGW Admin Portal to confirm requests are being logged.

Troubleshooting

“Invalid API Key” Error

If you see authentication errors:

  1. Verify your token hasn’t expired
  2. Regenerate a new token if needed from the Admin Portal
  3. Ensure you’ve copied the full token string
  4. Verify the endpoint URL is correct in your settings.json

“Model not found” Error

If you get “model not found” errors:

  1. Check the Available Models page for correct model IDs
  2. Ensure model IDs match exactly (including the -native suffix)

Extension Not Working After Configuration

If the extension doesn’t respond after configuration:

  1. Reload VS Code window (Ctrl+Shift+P / Cmd+Shift+P → “Reload Window”)
  2. Verify settings.json syntax is valid (no trailing commas, proper JSON format)
  3. Check VS Code’s Output panel for error messages (select “Claude Code” from dropdown)

Connection Timeout

If you experience connection timeouts:

  1. Check network connectivity to LLMGW
  2. If using a VPN, ensure it allows access to LLMGW endpoints

Spend Limit Exceeded

If you see an error like:

API Error: 403 Spend limit exceeded for project_user name: <email> · Please run /login

This means you’ve reached your daily/weekly/monthly spend limit. To resolve:

  1. Wait for the limit to reset (check with your administrator for reset period)
  2. Contact your administrator/PM to increase limits if needed

Best Practices

  1. Use environment variables for sensitive configuration like API tokens
  2. Verify connectivity - Check the Admin Portal to confirm requests are being logged
  3. Choose appropriate models - Haiku for simple tasks saves costs
  4. Reload VS Code after changing settings.json
  5. Consider the CLI for full feature support if you need checkpoints or advanced MCP configuration