Claude Code in VS Code: Extension Settings and Configuration
Install the extension, configure settings.json, and verify environment variables
Install Claude Code for VS Code first. claudeCode.preferredLocation controls the panel location; use claudeCode.environmentVariables to pass actual environment variables for a custom endpoint and auth token.
How do you use Claude Code in VS Code?
Install the Claude Code for VS Code extension first. It provides the native panel and IDE integration. Configure a custom endpoint and auth token in settings.json only when your setup requires them.
- Install Claude Code for VS Code from the VS Code Marketplace
- Open settings.json with Preferences: Open Settings (JSON)
- Save the settings, reopen the Claude Code panel, and reload the window if needed
Prerequisites
- Visual Studio Code installed
- Access to the VS Code Marketplace
- A valid Claude Code auth token if you need a custom endpoint
Configuration Steps
Install the Claude Code for VS Code extension
Search for Claude Code for VS Code in the VS Code Marketplace and install it. This is the recommended way to use Claude Code in VS Code because it provides the native panel, session entry points, and IDE integration.
Extension name:
Claude Code for VS Code
After install, check:
After install, you should see the Claude Code entry in VS Code and be able to open the panel
Open VS Code settings.json
If you want to control where Claude opens in VS Code or pass environment variables to the Claude process launched by the extension, open the command palette and run Preferences: Open Settings (JSON).
Preferences: Open Settings (JSON)
Add the Claude Code extension settings
Add only the Claude Code-related settings below. Keeping the example minimal makes it easier to maintain and less error-prone.
{
"claudeCode.preferredLocation": "panel",
"claudeCode.environmentVariables": [
{
"name": "ANTHROPIC_BASE_URL",
"value": "https://api.lumecoder.com"
},
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "sk-xxx"
}
]
}Replace sk-xxx with your real key from lumecoder.com, save settings.json, then restart or reopen Claude Code for VS Code to start using it.
How to verify the setup
Use these 3 checks to confirm the setup is active:
- The Claude Code extension is visible in VS Code and the panel opens normally
- Claude opens in the panel area by default
- There are no endpoint or authentication errors
Which settings are required?
Settings required for a custom endpoint
To use the Lumecoder endpoint through the extension, pass ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN through claudeCode.environmentVariables. claudeCode.preferredLocation only changes the panel location and is not required for endpoint authentication.
Other editor preferences
Settings like explorer.confirmDelete and workbench.startupEditor are personal VS Code preferences and do not determine whether the Claude Code extension works.
FAQ
Do I need the Claude Code for VS Code extension to use Claude Code in VS Code?
If you want the native VS Code panel and IDE integration, yes, the extension is the recommended path. If you only run the claude CLI inside the VS Code terminal, the extension is not strictly required.
Is claudeCode.environmentVariables the shared Claude Code configuration?
No. It is a VS Code extension setting used to pass environment variables to the Claude process launched by the extension. Shared Claude Code configuration typically lives in ~/.claude/settings.json.
Why did I update settings.json but Claude Code still does not react?
The usual causes are invalid JSON syntax, unsaved settings, the extension not being reloaded yet, or incorrect ANTHROPIC_BASE_URL / ANTHROPIC_AUTH_TOKEN values.
Can I put ANTHROPIC_AUTH_TOKEN directly in settings.json?
Yes, but keep it private. Do not commit real tokens to public repositories or expose them in screenshots or public docs.
Continue setting up AI coding tools
Summary
Install Claude Code for VS Code first. For a custom endpoint, pass the endpoint and auth values through claudeCode.environmentVariables. Use claudeCode.preferredLocation only when you want to change where the panel opens.
