Claude Code can run directly inside VS Code through Anthropic's official extension. For API requests through BetterToken from Russia, you do not need a permanent VPN or a foreign bank card: add the Base URL https://www.bettertoken.ai and your API key to ~/.claude/settings.json. The extension reads the shared Claude Code configuration and uses BetterToken instead of connecting to Anthropic directly.
The three layers of the Claude Code and VS Code integration
The integration consists of three independent layers. A failure in any of them may look the same — Claude Code does not respond — but each requires a different fix.
Layer 1 — CLI. claude is installed at the system level. The VS Code extension uses its own CLI copy for the chat panel, while running claude in the integrated terminal requires a separate CLI installation.
Layer 2 — VS Code extension. Anthropic's official Claude Code extension provides the graphical interface, side-by-side diffs, @-mentions for files, and session history. It requires VS Code 1.94.0 or later.
Layer 3 — API endpoint. Claude Code connects to the Anthropic API by default. To use BetterToken, set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in the configuration; the extension passes these values to Claude Code.
This separation makes troubleshooting clearer. A successful Dashboard entry confirms that BetterToken received the request. Verify the IDE layer separately with the current-file context and the proposed diff.
BetterToken API requests from Russia do not require a VPN or a foreign virtual bank card. Create an account, generate an API key, and use the Base URL from the documentation.
Create an API key and follow the BetterToken Claude Code guide: docs.bettertoken.ai/en/ai-tools/claude-code
Create a BetterToken API key and configure the endpoint
Step 1. Create an account and API key
Open bettertoken.ai, register, and go to the API key management section. Create a new API key and copy it for the next step.
Step 2. Use the correct Base URL
For Claude Code, use this Anthropic-compatible Base URL:
https://www.bettertoken.ai
Do not append /v1. Claude Code adds the API method path automatically. The /v1 suffix is used by OpenAI-compatible tools such as Codex CLI, not by this Claude Code setting.
Step 3. Edit ~/.claude/settings.json
On macOS and Linux, the configuration file is ~/.claude/settings.json. On Windows, use %USERPROFILE%\.claude\settings.json.
Add the env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://www.bettertoken.ai",
"ANTHROPIC_AUTH_TOKEN": "your_api_key_here"
}
}
Replace your_api_key_here with the key from step 1. If the file already contains other fields, add only the env section and preserve the rest.
Both the VS Code extension and the CLI read this shared configuration file.
Step 4. Disable the login screen in the extension
Open VS Code settings (Cmd+, on macOS or Ctrl+, on Windows/Linux), go to Extensions → Claude Code, and enable Disable Login Prompt. For a third-party API provider, this setting removes the Anthropic login screen; it does not replace the env configuration.
Start Claude Code in VS Code
Step 5. Install the extension
Press Cmd+Shift+X on macOS or Ctrl+Shift+X on Windows/Linux, find “Claude Code” by Anthropic, and select Install.
If the extension icon does not appear, run Developer: Reload Window from the Command Palette.
The minimum supported version is VS Code 1.94.0. Check it under Help → About.
Step 6. Open a file and launch the panel
Open any file in the editor. The Spark icon (✱) appears in the upper-right Editor Toolbar only while a file is open. Select it to open the chat panel.
Other ways to open Claude Code:
- Activity Bar — select the Spark icon in the left sidebar.
- Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) — run “Claude Code: Open in New Tab”. - Status Bar — select ✱ Claude Code in the lower-right corner; it also works when no file is open.
Step 7. Verify that Claude sees the current file
Select several lines of code. Claude Code shows the number of selected lines below the input field, confirming that the extension can read the current context. Press Option+K on macOS or Alt+K on Windows/Linux to insert an @-reference such as @file.ts#5-10.
Verify context, diff, and the Dashboard request
Step 8. Send a low-risk test request
Open a small script or configuration file and ask Claude for a simple, reversible change:
Add a one-line comment before the first function that briefly explains what it does.
Or:
Rename the `tmp` variable to `result` in this file.
The goal is to receive a concrete edit proposal that you can inspect visually.
Step 9. Inspect the side-by-side diff
When Claude proposes a change, the extension shows a before-and-after comparison and asks for permission. Review it, then select Accept or Reject.
A meaningful diff confirms that the extension received a model response and associated the edit with the current file. Verify the BetterToken route separately in Dashboard.
Step 10. Find the request in BetterToken Dashboard
Open bettertoken.ai and go to Dashboard or request history. Find the entry whose time matches the test request. You can compare the request time, model, status, input, output and cache tokens, and the corresponding consumption.
If VS Code shows the expected diff and Dashboard has a successful entry at the same time, all three layers work: the extension sent the file context, BetterToken processed the request, and the answer returned to the IDE.
If the test fails, compare the signals:
- no response and no Dashboard entry — check whether the extension started, the
envvalues, the Base URL, and the network connection; - Dashboard shows a failed request — open it and check the API key, model, and error message;
- VS Code shows a response or diff, but no matching entry exists — recheck the endpoint, request time, and Dashboard filters; the BetterToken route is not yet confirmed.
What to check when the integration is not detected
The Spark icon is missing
The Editor Toolbar shows the Spark icon only when a file is open. If a file is open but the icon is still missing:
- Check that VS Code is version 1.94.0 or later under Help → About.
- Run Developer: Reload Window from the Command Palette.
- Temporarily disable other AI extensions such as Cline, Continue, or GitHub Copilot if their toolbar actions conflict.
You can also use ✱ Claude Code in the Status Bar, which works without an open file.
VS Code does not inherit terminal environment variables
If ANTHROPIC_BASE_URL is defined in your shell but the extension still requests an Anthropic login, VS Code launched from Spotlight or the application menu may not have inherited the shell environment.
Start VS Code from the terminal:
code .
This passes the current environment to VS Code. If you prefer launching the app normally, duplicate the values under Extensions → Claude Code → environmentVariables in the extension settings.
The extension asks you to sign in again
Confirm that Disable Login Prompt is enabled under Extensions → Claude Code. This option hides the Anthropic login screen for a third-party provider, but the connection variables must still be configured separately.
Authentication error: 401 or no response
Check the following in order:
- Base URL — it must be
https://www.bettertoken.aiwithout/v1. An extra/v1can produce 404 errors for some methods. - API key — make sure the value has no spaces, line breaks, or extra quotation marks.
- Conflicting variables — an existing
ANTHROPIC_AUTH_TOKENorANTHROPIC_BASE_URLin the shell may override the expected configuration. Remove conflicting values from the shell profile or launch VS Code withcode .so the active environment is explicit.
Dashboard helps separate these cases: no entry means you should first check request dispatch, the endpoint, and the network; a recorded 401 points to the key or its format.
Full BetterToken setup guide for Claude Code: docs.bettertoken.ai/en/ai-tools/claude-code