From CLI to VS Code Extension: Claude Code Plugin and API Setup Guide
This guide walks through installing the Claude Code VS Code extension, explains differences from the CLI version, notes beta limitations, and provides step‑by‑step instructions for creating and editing the config.json file with API keys and base URL to enable custom API access.
Installation
Search for Claude Code in the VS Code, Cursor, or Qoder extension marketplace, select the version published by Anthropic, click Install, trust the prompt, and the extension downloads.
After installation, open the Claude Code conversation panel directly from the editor area, similar to the older CLI plugin.
First‑time Use
The extension displays the chat in the editor area rather than a sidebar, providing a larger visible area compared to tools such as Cursor, Codex, or Copilot.
On first launch, a login prompt appears. Users with an Anthropic account can log in directly; otherwise they can configure a proxy or domestic model (e.g., GLM, Kimi) by providing API credentials.
Custom API Configuration
Create a configuration file at the following paths:
Mac: ~/.claude/config.json Windows: C:\Users\Administrator\.claude\config.json Insert the JSON content (the primaryApiKey value can be any placeholder): { "primaryApiKey": "yiyuan" } In VS Code, open the Claude Code settings, edit the JSON configuration, and add environment variables for the API credentials:
"claude-code.environmentVariables": [
{
"name": "ANTHROPIC_AUTH_TOKEN",
"value": "YOUR_SK_KEY"
},
{
"name": "ANTHROPIC_BASE_URL",
"value": "YOUR_API_ENDPOINT"
}
],Save the file, reopen the Claude Code conversation panel, and the extension operates with the custom API.
Beta Caveats and UI Benefits
The extension is in beta; several CLI‑only features—MCP server configuration, sub‑proxy or checkpoint settings, advanced shortcuts, and Tab file‑path completion—are not yet supported and must be used via the CLI.
The chat appears in the editor area, offering a larger visual space and easier access to conversation history. The top‑left corner of the chat page provides a dropdown to select previous conversations, a convenience absent from the CLI.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
