Install the Claude Code VS Code extension
Search for Claude Code by Anthropic in the Extensions view, or paste vscode:extension/anthropic.claude-code into your browser to open it directly. The extension is a front-end for the CLI: on first launch it checks for the claude binary and installs it if it is missing (Node.js 18+ is required for the npm route; the native installer needs nothing). After that, the Claude icon in the activity bar opens a panel where you chat, and every change the agent makes shows as an inline diff you accept or reject — the same loop as the terminal, with the editor as the review surface.
# check the CLI the extension will use
claude --version
# if it is missing, install it yourself and reload VS Code
npm install -g @anthropic-ai/claude-code # or: curl -fsSL https://claude.ai/install.sh | bash
Or skip the extension: Claude Code in the integrated terminal
Open VS Code's terminal and run claude. This is the full agent — plan mode, subagents, hooks, MCP, /compact — and it works in any VS Code fork, including Cursor and VSCodium, without the extension. Edits land in the open files immediately and VS Code's own diff view shows them. For long autonomous tasks most people prefer this route; for small interactive edits the extension panel is more convenient. They can run at the same time.
Check which account Claude Code is using in VS Code
Both the extension and the terminal read the same configuration, so the answer is the same in either: run /status inside a session. It prints the endpoint (ANTHROPIC_BASE_URL), whether an API key or a /login subscription is active, the model, and the version. If an API key is set in the environment it wins over the login, which is the usual reason "I logged in with Max but it bills my API balance" happens. To switch, either unset ANTHROPIC_API_KEY for subscription use, or set it (with ANTHROPIC_BASE_URL for a gateway) for metered use.
# use this gateway from VS Code: put these in your shell profile, restart VS Code
export ANTHROPIC_BASE_URL=https://aiprimetech.io
export ANTHROPIC_API_KEY=your_gateway_key
VS Code inherits environment variables from the shell that launched it. If /status still shows the old endpoint after you changed your profile, quit VS Code completely and start it from a fresh terminal — reloading the window is not enough.
Error: command 'claude-vscode.editor.openlast' not found
This appears when a keybinding or the command palette calls the extension before it has activated, or when the extension activated but could not find the CLI it wraps.
In order: 1) Reload the window (Developer: Reload Window) — most cases end here. 2) Run claude --version in the terminal; if it is not found, install the CLI (above) and reload again. 3) Check the extension is enabled for this workspace, not just installed. 4) If you use a VS Code fork, confirm the extension version supports it — otherwise the terminal route works regardless. 5) As a last resort uninstall the extension, delete ~/.claude/ caches only if you accept losing local session history, and reinstall.
Other extension problems
- Panel opens but stays empty → the CLI is starting; check the Output panel (Claude Code) for the real error, usually an old Node.js.
- Inline diffs never appear → the workspace is not trusted; VS Code blocks extensions in Restricted Mode.
- Works in the terminal, not in the panel → a proxy or
ANTHROPIC_BASE_URLset only in your shell profile, not in the environment VS Code was launched from. - 401 / invalid key → the key does not match the endpoint; a gateway URL needs a gateway key, the Anthropic URL needs a console key.
Cost inside VS Code
The extension bills exactly like the CLI — per token through whatever is behind it. On this gateway that is credits at 7.69× face value ($13 buys $100 of usage, 87% off) or a flat-rate unlimited plan from $1; the pricing guide has the details, and the models guide lists what /model can select.
| Plan | Duration | Price |
|---|---|---|
| Unlimited 1 Hour | 1 hour | $1 |
| Unlimited 24 Hours | 24 hours | $10 |
| Unlimited 1 Week | 1 week | $49 |
| Unlimited 15 Days | 15 days | $89 |
Frequently asked questions
Is there a Claude Code extension for VS Code?
Yes — Anthropic's official `anthropic.claude-code` extension on the Marketplace. It wraps the CLI with a panel and inline diffs; the CLI also runs on its own in VS Code's terminal.
How do I check which account Claude Code uses in VS Code?
Run /status in a session. It shows the endpoint, whether an API key or a subscription login is active, and the model. An API key in the environment takes precedence over /login.
How do I fix 'claude-vscode.editor.openlast' not found?
Reload the VS Code window; if it persists, make sure `claude --version` works in the terminal (install the CLI if not) and that the extension is enabled for the workspace.
Does Claude Code work in Cursor or VSCodium?
In the integrated terminal, always. The extension works where the fork's marketplace carries it.
Run Claude Code on the gateway
Same models, two environment variables, credits at 7.69× face value — or a flat-rate unlimited plan.
Get an API key See unlimited plansAI Prime Tech is an independent API gateway and is not affiliated with, endorsed by, or sponsored by Anthropic. “Claude” and “Claude Code” are trademarks of Anthropic. Claude Code features described here follow Anthropic’s public documentation at the time of writing and change frequently; prices and model lists on this page are read from this gateway’s live settings.