VS Code setup

The official Claude Code extension,
connected to OpusClaude

Write code with Claude Code in VS Code, using your subscription quota. One command writes the extension configuration, and it shares the same plan with the CLI / desktop app.
No plan yet, or new to the terminal? Start with the 5-minute getting-started guide, which walks you through setup step by step for your computer.
macOS / Linux
🪟 Windows
1

Install VS Code + the Claude Code extension

First install Visual Studio Code, then search the Extensions Marketplace for Claude Code (publisher: Anthropic) and install it. If it's already installed, skip to step 2.

Download VS Code → Claude Code extension →
Extension ID: Anthropic.claude-code · The setup command also tries to install it automatically if it detects the code CLI
2

Run the one-step setup in Terminal

Open Terminal, then paste and run the command. If you've already run the CLI setup on this computer (you have ~/.opusclaude/config), your key is reused directly; otherwise your browser opens so you can sign in and authorize.

Terminal
$ curl -fsSL https://claude.opusapi.xyz/vscode-install.sh | bash
The script writes claudeCode.environmentVariables in your VS Code user settings (the official extension's sign-in check only looks there). It backs up settings.json automatically before writing.
3

Authorize in your browser (if prompted)

If this computer doesn't have a setup configuration yet, your browser opens automatically. Sign in with the account you bought the plan with, then click "Authorize this device". Once authorized, the terminal finishes writing the configuration automatically.

4

Fully quit VS Code and reopen it

Closing all windows isn't enough; use Quit / Exit from the menu, then reopen VS Code and open the Claude Code panel.

✓ When it works: the extension no longer asks you to sign in to Anthropic, and conversations go through OpusClaude and your subscription quota. The CLI, desktop app and VS Code on the same computer share a device slot.
1

Install VS Code + the Claude Code extension

Install Visual Studio Code, search the Extensions Marketplace for Claude Code (Anthropic) and install it. If it's already installed, skip to step 2.

Download VS Code → Claude Code extension →
2

Run the setup command in PowerShell

Open PowerShell (usually no administrator rights needed), then paste and run:

Windows PowerShell
PS> irm https://claude.opusapi.xyz/vscode-install.ps1 | iex
If the execution policy blocks it, first run: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned, or use: powershell -ExecutionPolicy Bypass -Command "irm https://claude.opusapi.xyz/vscode-install.ps1 | iex"
3

Authorize in your browser (if prompted)

If there's no local CLI configuration, your browser opens. Sign in with the account you bought the plan with and authorize, then go back to PowerShell and wait for the completion message.

4

Fully quit VS Code and reopen it

If VS Code is also in the system tray, quit it there too. Then reopen VS Code and open the Claude Code panel to test.

✓ When it works: it no longer asks you to sign in to Anthropic, and usage counts toward your subscription. The configuration file is at %APPDATA%\Code\User\settings.json.
Keeps asking you to sign in to Anthropic?

Most likely the extension didn't pick up the setup configuration. After confirming you've run the setup command, fully quit VS Code and reopen it. Don't set it only in system environment variables: the official extension's sign-in check only looks at claudeCode.environmentVariables in user settings. If you use Remote-SSH / WSL / containers, see the next item.

Using it on a remote server / WSL / container (Remote-SSH, WSL, Dev Containers)?

In a remote window, the Claude Code extension runs on the remote machine and only reads that machine's "Remote Settings"; the setup command you ran on your own computer can't write there. The symptom: the command reports "written successfully", but the extension still asks you to sign in to Anthropic, or shows Anthropic's official 403 (Verification Portal).
What to do: In the VS Code remote window, open a terminal (menu "Terminal → New Terminal") and run curl -fsSL https://claude.opusapi.xyz/vscode-install.sh | bash. If authorization is needed and the browser doesn't open automatically, copy the authorization link from the terminal and open it in the browser on your own computer. When it finishes, press Ctrl+Shift+P (Mac: Cmd+Shift+P) and run Developer: Reload Window.
Manual method: First run the setup command above on your local computer. In a local window, press Ctrl/Cmd+Shift+P and run Preferences: Open User Settings (JSON), then copy the whole claudeCode.environmentVariables block; then, in the remote window, run Preferences: Open Remote Settings (JSON), paste it in and save, and finally run Developer: Reload Window.
How to tell it worked: the Claude Code panel no longer asks you to sign in to Anthropic, and the model dropdown includes Fable 5. The remote machine takes up one device slot; with Dev Containers, run it again after rebuilding the container.

Terminal says it can't connect to 127.0.0.1:7892?

Your local proxy (Clash, etc.) isn't running. Temporarily turn off the proxy and install again: unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY, or start your proxy software and then run the command again.

Does it conflict with the CLI / desktop app?

No. They share the same subscription's quota; on the same computer the device_id is the same, so it takes up only 1 device slot. The VS Code script is independent and doesn't change the CLI install script or the desktop setup script.

How do I uninstall the VS Code setup?

macOS/Linux: curl -fsSL https://claude.opusapi.xyz/vscode-install.sh | bash -s -- --uninstall
Windows: change the install command so it downloads the script, then add -Uninstall, or run the script locally with -Uninstall. This only removes the extension's setup configuration and doesn't touch the CLI / desktop app.

Is my key safe?

The key is written to your VS Code user settings.json (the extension's sign-in check needs it). Don't commit that file to a public repository. It's backed up automatically before writing.

For details, see Docs · VS Code · For the CLI, use opclaude · For the desktop app, see the desktop app guide · For Office, see Excel / Word / PowerPoint setup
Having problems? Contact support and attach a screenshot of the terminal output