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.
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¶
- VS Code 1.98.0 or higher
- Claude Code VS Code extension installed from the VS Code Marketplace
- LLMGW API token (see User Tokens)
Configuration¶
Configure Claude Code via VS Code's settings.json:
- Open VS Code Settings (
Ctrl+,/Cmd+,) - Click the "Open Settings (JSON)" icon in the top right
- 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_DEFAULT_OPUS_MODEL", "value": "anthropic.claude-opus-4-5-20251101-v1:0"},
{"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_DEFAULT_OPUS_MODEL |
Model ID for the most capable 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 three models:
- Haiku model - Used for fast, simple operations (file summaries, quick questions)
- Sonnet model - Used for complex coding tasks (code generation, refactoring)
- Opus model - Used for the most capable tasks requiring deep reasoning
Cost Saving Tip: For testing purposes, set all models to Haiku to minimize costs. You can upgrade to Sonnet/Opus later when you need better quality for complex tasks.
Available Models¶
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 |
| Claude Opus 4.5 (Most capable) | anthropic.claude-opus-4-5-20251101-v1:0 |
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:
- Enable VS Code Restricted Mode
- Use manual approval mode instead of auto-accept
- Only use Claude with trusted prompts
Verification¶
To verify your configuration is working:
- Open a project in VS Code
- Open the Claude Code panel (click the Claude icon in the sidebar or Activity Bar)
- Ask a simple question to test connectivity:
- Check the LLMGW Admin Portal to confirm requests are being logged.
Troubleshooting¶
"Invalid API Key" Error¶
If you see authentication errors:
- Verify your token hasn't expired
- Regenerate a new token if needed from the Admin Portal
- Ensure you've copied the full token string
- Verify the endpoint URL is correct in your settings.json
"Model not found" Error¶
If you get "model not found" errors:
- Check if the selected model ID is correct
- Ensure model IDs match exactly (including the
-nativesuffix)
Extension Not Working After Configuration¶
If the extension doesn't respond after configuration:
- Reload VS Code window (
Ctrl+Shift+P/Cmd+Shift+P→ "Reload Window") - Verify settings.json syntax is valid (no trailing commas, proper JSON format)
- Check VS Code's Output panel for error messages (select "Claude Code" from dropdown)
Connection Timeout¶
If you experience connection timeouts:
- Check network connectivity to LLMGW
- If using a VPN, ensure it allows access to LLMGW endpoints
Spend Limit Exceeded¶
If you see an error like:
This means you've reached your daily/weekly/monthly spend limit. To resolve:
- Wait for the limit to reset (check with your administrator for reset period)
- Contact your administrator/PM to increase limits if needed
Best Practices¶
- Use environment variables for sensitive configuration like API tokens
- Verify connectivity - Check the Admin Portal to confirm requests are being logged
- Choose appropriate models - Haiku for simple tasks saves costs
- Reload VS Code after changing settings.json
- Consider the CLI for full feature support if you need checkpoints or advanced MCP configuration