# VS Code + QCode on Windows & macOS: Claude Code extension, step by step


**Short answer**: Install **Claude Code for VS Code** (`anthropic.claude-code`), keep `ANTHROPIC_BASE_URL=https://api.qcode.cc/api` and `ANTHROPIC_AUTH_TOKEN=cr_xxxxxxxx` in your Windows user environment variables, create `%USERPROFILE%\.claude\config.json` containing `{"primaryApiKey": "qcode"}`, restart VS Code, trust your folder, and click the **Claude** icon → **+ New session**.

| Item | Fill in |
|---|---|
| Extension ID | `anthropic.claude-code` |
| Base URL (`ANTHROPIC_BASE_URL`) | `https://api.qcode.cc/api` |
| API key (`ANTHROPIC_AUTH_TOKEN`) | `cr_xxxxxxxx` |
| Config file (Windows) | `%USERPROFILE%\.claude\config.json` |
| Config content | `{"primaryApiKey": "qcode"}` |

Checked on 2026-11-22 · Visual Studio Code 1.147.0 · Claude Code for VS Code 2.1.330 · Windows 11


Follow the 22 Windows 11 screenshots below to install Visual Studio Code and the official Claude Code extension, connect them to QCode through your existing CLI environment variables and `config.json`, and chat or run code actions right inside the editor. No GitHub or Anthropic account is required.


- **Applies to**: Windows 10 / 11 (64-bit) and macOS; the screenshots were taken on Windows 11
- **Software version**: Visual Studio Code 1.147.0 (User Installer, x64) and Claude Code for VS Code 2.1.330 (CLI 2.1.330)
- **Screenshots updated**: 2026-11
- **Time needed**: about 15 minutes, including downloading the ~276 MiB installer
- **You will need**: Claude Code CLI working with QCode and a QCode API key starting with `cr_`


> **On a Mac?** Follow the same steps. The screenshots were taken on Windows 11, and VS Code and the Claude Code extension work the same on macOS. Press ⌘ Cmd wherever a step says Ctrl, and read `%USERPROFILE%\` as `~/` in file paths. The **macOS and Linux setup** section of this page has the commands that differ.

Before the first screenshot, confirm these four items:


- A 64-bit Windows 10 or 11 PC or a Mac with internet access and space for the ~276 MiB User Installer (installs per user, so no administrator rights are needed)
- Claude Code CLI already installed and working in PowerShell — `claude --version` prints a version and `ANTHROPIC_BASE_URL` / `ANTHROPIC_AUTH_TOKEN` are set as user environment variables (see [Installation Guide](/docs/getting-started/installation) and [Environment Configuration](/docs/getting-started/environment))
- A QCode API key starting with `cr_` (`cr_xxxxxxxx`) stored in `ANTHROPIC_AUTH_TOKEN`. No account yet? [Sign up](https://qcode.cc/en/auth/sign-up?utm_source=docs.qcode.cc&utm_medium=tut_before&utm_campaign=knowledge_base&src=docs-ide-vscode-before) first, pick a plan on the [pricing page](https://qcode.cc/en/pricing?utm_source=docs.qcode.cc&utm_medium=tut_before&utm_campaign=knowledge_base&src=docs-ide-vscode-before), then create the key in your [Dashboard](https://qcode.cc/en/dashboard).
- Access to `code.visualstudio.com` and the Visual Studio Code Marketplace (no GitHub or Anthropic account is needed)


## Download and install VS Code

VS Code is a standalone desktop installer (~276 MiB for version 1.147.0 x64 User Installer). Pick the tab that matches your region:

**Other regions**

Open [code.visualstudio.com/download](https://code.visualstudio.com/download) and click **Download** in the **Windows** card to get the x64 User Installer (`VSCodeUserSetup-x64-*.exe`), or pick **Arm64** for Windows on ARM. You can also install from PowerShell with `winget install Microsoft.VisualStudioCode` (winget can occasionally trail the website by one minor release). On a locked-down work PC that blocks installers, use the portable `.zip` build on the same download page.


**Mainland China**

Open [code.visualstudio.com/download](https://code.visualstudio.com/download) and choose **Windows** → **User Installer (x64)** for standard Intel or AMD PCs (or **Arm64** for Windows on ARM). Access to `code.visualstudio.com` and `update.code.visualstudio.com` can be slow or intermittent from mainland China; if the browser download stalls, retry later, switch networks, or install from PowerShell with `winget install Microsoft.VisualStudioCode`.

If the extension download inside VS Code stalls on a restricted network, retry on another network or check your proxy settings.




### Check Claude Code CLI and environment variables

Open **Windows PowerShell** and verify that Claude Code CLI and both user-level QCode environment variables are ready before installing VS Code:

```powershell
claude --version
[Environment]::GetEnvironmentVariable('ANTHROPIC_BASE_URL','User')
if ([Environment]::GetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN','User')) { 'ANTHROPIC_AUTH_TOKEN is set' }
```

① confirms `claude --version` prints a version number. ② confirms `ANTHROPIC_BASE_URL` is set to `https://api.qcode.cc/api`. ③ confirms `ANTHROPIC_AUTH_TOKEN` is populated.

![PowerShell window verifying prerequisites: claude --version outputs a version, ANTHROPIC_BASE_URL points to https://api.qcode.cc/api, and ANTHROPIC_AUTH_TOKEN is set](https://docs.qcode.cc/static/images/tut/vscode/202611/en/01-prerequisites.webp)

**Stuck? claude is not recognized or a variable is empty**

The VS Code extension reads the same user environment variables as the CLI. Complete [Installation Guide](/docs/getting-started/installation) and [Environment Configuration](/docs/getting-started/environment) first, then open a new PowerShell window and run these three checks again.



Done right you will see: ① a Claude Code version line, ② `https://api.qcode.cc/api` with no trailing slash or `/v1`, and ③ `ANTHROPIC_AUTH_TOKEN is set`.




### Open the VS Code download page

Open [code.visualstudio.com/download](https://code.visualstudio.com/download) in your browser. Click ① the **Windows** download button for a standard 64-bit Intel or AMD PC, or pick the exact architecture under ② **User Installer** (**x64** or **Arm64**).

![VS Code official download page highlighting the Windows Download button and the User Installer row underneath](https://docs.qcode.cc/static/images/tut/vscode/202611/en/02-download-page.webp)


Done right you will see: clicking ① starts downloading `VSCodeUserSetup-x64-1.147.0.exe` (or the latest `VSCodeUserSetup-x64-*.exe`), and your browser's download indicator becomes active.




### Wait for the installer download to finish

Press `Ctrl+J` in your browser to view the **Downloads** panel. Wait until ① shows `VSCodeUserSetup-x64-1.147.0.exe` completed at about **276 MiB**, then click the file to run the installer.

![Browser Downloads panel showing the completed VSCodeUserSetup-x64-1.147.0.exe installer around 276 MiB](https://docs.qcode.cc/static/images/tut/vscode/202611/en/03-download-done.webp)

**Stuck? The download is slow or stalls**

The 1.147.0 User Installer is about 276 MiB. If the download stalls, cancel it and restart later, switch networks, or install from PowerShell with `winget install Microsoft.VisualStudioCode`. Do not rename a partial `.crdownload` file.



Done right you will see: ① displays the finished `.exe` file with an **Open file** action and no progress bar remaining.




### Accept the license agreement

When the **Setup - Microsoft Visual Studio Code** wizard opens (no UAC or SmartScreen prompt appears for User Setup), select ① **I accept the agreement**, then click ② **Next**.

![VS Code Setup License Agreement screen with I accept the agreement and Next highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/04-installer-license.webp)


Done right you will see: ② **Next** becomes clickable after ① is selected, and clicking it moves to **Select Destination Location**.




### Keep the default install location

Leave the default per-user path (`%LOCALAPPDATA%\Programs\Microsoft VS Code`) unchanged so no administrator rights are needed, and click ① **Next**. On the next screen (**Select Start Menu Folder**), keep the default and click **Next** again.

![VS Code Setup Select Destination Location screen with default user AppData path and Next highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/05-installer-location.webp)


Done right you will see: after clicking **Next** past the destination and Start Menu screens, the wizard opens **Select Additional Tasks**.




### Keep the default additional tasks

On **Select Additional Tasks**, leave ① the default options checked — including **Register Code as an editor for supported file types** and **Add to PATH** — so you can launch VS Code from terminals too, then click ② **Next**.

![VS Code Setup Select Additional Tasks screen with Add to PATH checked and Next highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/06-installer-tasks.webp)


Done right you will see: ① remains checked and clicking ② advances to the GitHub Copilot CLI page.




### Skip the GitHub Copilot CLI option

VS Code 1.147.0 adds a **GitHub Copilot CLI** screen that is not needed for Claude Code. Choose ① **Don't add the copilot command**, then click ② **Next**.

![VS Code 1.147.0 GitHub Copilot CLI installer page with Don't add the copilot command selected and Next highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/07-installer-copilot-cli.webp)


Done right you will see: ① is selected and clicking ② opens the **Ready to Install** summary screen.




### Start the installation

Review the destination folder and selected tasks on **Ready to Install**, then click ① **Install**.

![VS Code Setup Ready to Install summary screen with the Install button highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/08-installer-ready.webp)


Done right you will see: the wizard switches immediately to the **Installing** progress screen.




### Wait for installation to finish

Let the installer extract and copy files. This usually takes about 30 seconds and needs no input.

![VS Code Setup Installing screen showing the green extraction progress bar](https://docs.qcode.cc/static/images/tut/vscode/202611/en/09-installer-installing.webp)


Done right you will see: the green progress bar fills completely and the wizard advances automatically to the completion screen.




### Launch VS Code

On **Completing the Visual Studio Code Setup Wizard**, keep ① **Launch Visual Studio Code** checked and click ② **Finish**.

![VS Code Setup completion screen with Launch Visual Studio Code checked and Finish highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/10-installer-finish.webp)


Done right you will see: the setup window closes and Visual Studio Code opens a few seconds later.




### Skip GitHub sign-in on first launch

On first launch, VS Code shows a **Welcome to VS Code / Sign in to use GitHub Copilot** screen. You do not need a GitHub account — click ① **Continue without Signing In** at the bottom right, then pick a theme on **Make It Yours** (or keep the default) to reach the editor.

![VS Code first-run GitHub sign-in screen with Continue without Signing In highlighted at bottom right](https://docs.qcode.cc/static/images/tut/vscode/202611/en/11-first-run-signin.webp)


Done right you will see: the sign-in screen closes and the standard VS Code workbench appears with the Activity Bar on the far left.




### Open the Extensions panel

Press `Ctrl+Shift+X` (or click ① the blocks **Extensions** icon in the left Activity Bar). The Extensions sidebar opens with ② the search box focused at the top.

![VS Code Extensions view showing the Activity Bar Extensions icon and the search box at top](https://docs.qcode.cc/static/images/tut/vscode/202611/en/12-extensions-panel.webp)


Done right you will see: ① the Extensions icon is highlighted in the Activity Bar and ② the cursor is ready inside the **Search Extensions in Marketplace** box.




### Search for Claude Code for VS Code and verify the publisher

Type `Claude Code for VS Code` into the search box and select ① **Claude Code for VS Code** from the results. Before installing, check ③ in the details pane to confirm the publisher is **Anthropic** (`anthropic.com` with the blue verified checkmark) so you do not install a lookalike extension, then click ② **Install**.

![VS Code Extensions search for Claude Code for VS Code highlighting the result row, the Install button, and the verified Anthropic publisher badge](https://docs.qcode.cc/static/images/tut/vscode/202611/en/13-extension-search.webp)


Done right you will see: ① matches `Claude Code for VS Code`, ③ shows verified `anthropic.com`, and clicking ② starts the install flow.




### Trust the Anthropic publisher and install

The first time you install an extension from Anthropic, VS Code pops up ① `Do you trust the publisher "Anthropic"?`. Click ② **Trust Publisher & Install** to begin downloading and installing the extension.

![VS Code publisher trust dialog asking Do you trust the publisher Anthropic with Trust Publisher and Install highlighted](https://docs.qcode.cc/static/images/tut/vscode/202611/en/14-trust-publisher.webp)

**Stuck? The extension install hangs or says aborted**

If VS Code stalls while downloading from the Marketplace or fails with `aborted`, check your network or proxy settings and click **Install** again. On a restricted network, switch connections or install a `.vsix` package obtained on a working connection with `code --install-extension <path-to-vsix>`.



Done right you will see: the trust dialog closes and the extension button changes from **Install** to **Installing**, then to management actions once finished.




### Confirm the Claude icon appears

Wait for installation to finish. ① a new **Claude** icon appears in the left Activity Bar (below Extensions), and ② the **Claude Code for VS Code** row in the Extensions sidebar no longer shows an **Install** button.

![VS Code after installing Claude Code showing the new Claude icon in the Activity Bar and the installed extension in the sidebar](https://docs.qcode.cc/static/images/tut/vscode/202611/en/15-extension-installed.webp)


Done right you will see: ① the Claude icon sits in the Activity Bar and ② the extension is listed as installed.




### Open the `.claude` folder

Press `Win+R`, type `%USERPROFILE%\.claude`, and press `Enter`. File Explorer opens ① your `.claude` folder, which already holds folders created by the CLI (`backups`, `ide`, `plugins`, `projects`, `sessions`, and `.last-cleanup`). There is no `settings.json` here by default; you will create `config.json` in this folder next.

![Windows File Explorer open to the user .claude directory showing the address bar path and CLI subfolders](https://docs.qcode.cc/static/images/tut/vscode/202611/en/16-dotclaude-folder.webp)

**Stuck? Windows says it cannot find %USERPROFILE%\.claude**

That means Claude Code CLI has not created the folder yet. Run `claude --version` (or one short `claude` command) in PowerShell, or create a folder named `.claude` directly inside `C:\Users\<YourUsername>`.



Done right you will see: ① the address bar ends in `.claude` inside your user profile directory, with the CLI subfolders listed below.




### Create `config.json` with `primaryApiKey`

Press `Win+R`, run `notepad %USERPROFILE%\.claude\config.json`, and click **Yes** when Notepad asks to create a new file (launching Notepad with the full filename avoids Windows' hidden `.txt` extension trap). Enter ① the JSON below and press `Ctrl+S` to save:

```json
{
  "primaryApiKey": "qcode"
}
```

The value of `primaryApiKey` can be any non-empty string such as `"qcode"`; actual API authentication uses the QCode key in your `ANTHROPIC_AUTH_TOKEN` environment variable. Make sure the file is named `config.json`, **not** `settings.json`.

![Notepad editing config.json inside the .claude folder with primaryApiKey set to qcode](https://docs.qcode.cc/static/images/tut/vscode/202611/en/17-config-json.webp)

**Need an API Key?**

The extension uses your `ANTHROPIC_AUTH_TOKEN` environment variable to authenticate with QCode. If you do not have a QCode account yet, [Sign up](https://qcode.cc/en/auth/sign-up?utm_source=docs.qcode.cc&utm_medium=tut_key_step&utm_campaign=knowledge_base&src=docs-ide-vscode-key) first, buy a pack on the [Pay-as-you-go packs](https://qcode.cc/en/pay-as-you-go?utm_source=docs.qcode.cc&utm_medium=tut_key_step&utm_campaign=knowledge_base&src=docs-ide-vscode-key) page to get started, then create a `cr_` key in your [Dashboard](https://qcode.cc/en/dashboard) and save it in `ANTHROPIC_AUTH_TOKEN` (see [Environment Configuration](/docs/getting-started/environment)). You can pay by credit or debit card (Visa / Mastercard) — see [Payment methods](/docs/reference/payment-methods).



Done right you will see: Notepad's title bar reads `config.json` (with no `*` unsaved marker after `Ctrl+S`) and ① holds the valid two-line JSON object.




### Verify `config.json` is in the `.claude` folder

Close Notepad, switch back to File Explorer, and press `F5` to refresh. Confirm ① `config.json` sits directly inside `.claude` alongside ② the existing CLI folders (`backups`, `ide`, `plugins`, `projects`, `sessions`).

![File Explorer showing config.json alongside the CLI folders inside .claude](https://docs.qcode.cc/static/images/tut/vscode/202611/en/18-config-file-exists.webp)

**Stuck? The file was saved as config.json.txt**

Windows hides known file extensions by default. In File Explorer click **View → Show → File name extensions** to check the real name. If it ends in `.txt`, rename it to `config.json` and confirm the rename prompt.



Done right you will see: ① reads `config.json` (not `config.json.txt` and not `settings.json`) below ② the `.claude` subfolders.




### Restart VS Code and trust your project folder

Quit VS Code completely (**File → Exit**, not just closing a tab) so it picks up `config.json` and your user environment variables, then launch VS Code again and open a project folder (**File → Open Folder**). If the bottom-left status bar shows **Restricted Mode**, click **Restricted Mode → Manage → Trust** (`Ctrl+Enter`) and close the Workspace Trust tab. Once trusted, ① the **Claude** icon appears enabled in the Activity Bar.

![Restarted VS Code with a trusted project folder showing the active Claude icon in the Activity Bar](https://docs.qcode.cc/static/images/tut/vscode/202611/en/19-vscode-restart.webp)

**Stuck? The Claude icon disappeared after opening a folder**

VS Code opens new folders in **Restricted Mode**, which disables extensions (`12 extensions are disabled or have limited functionality`). Click **Restricted Mode** in the bottom-left status bar, choose **Manage**, and click **Trust** (`Ctrl+Enter`). Note that opening a single file instead of a folder does not persist trust across restarts — always open a folder.



Done right you will see: **Restricted Mode** is gone from the status bar and ① the **Claude** icon is visible in the Activity Bar.




### Open the Claude Code chat panel

Click the **Claude** icon in the Activity Bar to open the Claude Code sidebar, then click **+ New session** (you can also press `Ctrl+Shift+P` and run **Claude Code: Open**). ① the Claude Code chat panel opens on the right side of the editor with ② the message input box at the bottom. If Claude Code asks **Trust this folder in Claude Code?** on your first session in a folder, click **Trust folder**.

![VS Code showing the Claude Code chat panel tab on the right and the message input box at the bottom](https://docs.qcode.cc/static/images/tut/vscode/202611/en/20-claude-panel.webp)

**Stuck? Pressing Ctrl+Esc opens the Windows Start menu**

Although the panel hints `ctrl esc to focus or unfocus Claude`, Windows reserves `Ctrl+Esc` for the Start menu. On Windows, always open the panel by clicking the **Claude** icon in the Activity Bar and clicking **+ New session**, or via `Ctrl+Shift+P` → **Claude Code: Open**.



Done right you will see: ① the Claude Code tab is open in the right editor group and ② the message input box is ready to type in with no Anthropic sign-in blocker.




### Send a test message and get your first reply

Click the message input box, type `Hello! Introduce yourself in one sentence.`, and press `Enter`. ① your prompt appears in the conversation, followed immediately by ② Claude Code's streamed response routed through QCode.

![Claude Code chat panel showing the test prompt and a streamed one-sentence reply through QCode](https://docs.qcode.cc/static/images/tut/vscode/202611/en/21-first-reply.webp)

**Stuck? The reply fails with 401 or 404, or asks to sign in**

1. Open PowerShell under the **same Windows user** and run `claude -p "Reply with OK"` to confirm the CLI works.
2. Check that `ANTHROPIC_BASE_URL` is `https://api.qcode.cc/api` (no `/v1` or trailing `/`) and `ANTHROPIC_AUTH_TOKEN` holds a valid `cr_` key.
3. Confirm `%USERPROFILE%\.claude\config.json` contains valid JSON (`{"primaryApiKey": "qcode"}`), then quit VS Code completely and relaunch it.



Done right you will see: ① your question and ② a complete streamed reply in the same panel, with no authentication error or login prompt.




### Use Claude from the editor right-click menu

Open any code file, select a few lines, and right-click inside the editor. ① the top of the context menu displays the Claude command group: **Add Selection to Chat**, **Open Inline Chat** (`Ctrl+I`), **Explain**, **Fix**, and **Code Review**.

![VS Code editor context menu with the Claude command group at the top: Add Selection to Chat, Open Inline Chat, Explain, Fix, and Code Review](https://docs.qcode.cc/static/images/tut/vscode/202611/en/22-context-menu.webp)


Done right you will see: ① all five Claude actions appear at the top of the right-click menu, ready to send selected code straight to Claude Code.




## Verify it works

Your setup is complete when all five checks pass:

- The Extensions panel shows **Claude Code for VS Code** (`anthropic.claude-code`, publisher **Anthropic**) installed, and the **Claude** icon appears in the Activity Bar.
- `%USERPROFILE%\.claude\config.json` exists, is named `config.json` (not `config.json.txt` or `settings.json`), and contains valid JSON (`{"primaryApiKey": "qcode"}`).
- Your project folder is trusted (no **Restricted Mode** indicator on the bottom-left status bar).
- Clicking the **Claude** icon → **+ New session** opens the chat panel, and sending a short prompt streams a normal reply without an authentication error or login prompt.
- Selecting code in an open file and right-clicking shows the Claude command group (**Add Selection to Chat**, **Open Inline Chat**, **Explain**, **Fix**, **Code Review**) at the top of the menu.


### All done

You now have the Claude Code extension running inside VS Code and answering through QCode. From here you can:

- [CLI Tips](/docs/usage/cli-tips) — shortcuts and workflows for Claude Code
- [Workflow Tips](/docs/usage/workflow-tips) — everyday patterns for larger projects
- [GitHub Copilot Integration](/docs/ide/github-copilot) — connect QCode via custom endpoints in VS Code
- [Troubleshooting](/docs/reference/troubleshooting) — fix common connection and key issues
- Compare the plans on the [pricing page](https://qcode.cc/en/pricing?utm_source=docs.qcode.cc&utm_medium=tut_done&utm_campaign=knowledge_base&src=docs-ide-vscode-done)
- Go back to your [Dashboard](https://qcode.cc/en/dashboard) to check usage and balance


## Common errors

| Error message | Why | What to do |
|---|---|---|
| `12 extensions are disabled or have limited functionality` | VS Code opened the folder in **Restricted Mode**, which disables the Claude Code extension and hides the **Claude** icon from the Activity Bar | Open the workspace with **File → Open Folder**, click **Restricted Mode** on the bottom-left status bar → **Manage** → **Trust** (`Ctrl+Enter`), then close the Workspace Trust tab |
| `Do you trust the publisher "Anthropic"?` | VS Code blocks first-time extension installs from Anthropic until you explicitly approve the publisher; dismissing the prompt cancels installation | Confirm the publisher shows verified `anthropic.com`, then click **Trust Publisher & Install** |
| `Trust this folder in Claude Code?` | Opening a Claude Code session in a new folder triggers a folder-trust prompt that covers the message input box until accepted | Click **Trust folder** in the prompt so Claude Code can run in that workspace and send requests to QCode |
| `ctrl esc to focus or unfocus Claude` | Windows reserves `Ctrl+Esc` to open the Start menu, so the shortcut hinted inside the panel cannot open or focus Claude Code on Windows | Click the **Claude** icon in the Activity Bar and then **+ New session**, or open the Command Palette (`Ctrl+Shift+P`) and run **Claude Code: Open** |
| `aborted` | VS Code's Marketplace download for `anthropic.claude-code` stalled or timed out over the current network | Check your network or proxy settings and click **Install** again; if it keeps aborting, switch networks or install a `.vsix` package with `code --install-extension <path-to-vsix>` |

## FAQ

### What happens when my QCode API key expires?

It depends on how you purchased QCode. A key from a **personal plan** cannot be renewed once it expires — reopen a plan, create a new key in your [Dashboard](https://qcode.cc/en/dashboard), update `ANTHROPIC_AUTH_TOKEN`, and restart VS Code. A key from a **pay-as-you-go pack** comes back when you buy another pack: the same key starts working again, so you do not need to change your environment variables or `config.json`.

### Why do I need `primaryApiKey` in `config.json` if my key is in environment variables?

The Claude Code VS Code extension requires a `primaryApiKey` field in `%USERPROFILE%\.claude\config.json` (or `~/.claude/config.json` on macOS/Linux). The value can be any non-empty string such as `"qcode"`, while actual API authentication and routing continue to use `ANTHROPIC_AUTH_TOKEN` and `ANTHROPIC_BASE_URL` from your environment variables. Make sure the file is named `config.json` rather than `settings.json`.

### Why do I get 401 or 404 errors even though the Claude panel opens?

VS Code inherits user environment variables when it starts. If you edited `ANTHROPIC_BASE_URL` or `ANTHROPIC_AUTH_TOKEN` after launching VS Code, quit VS Code completely (**File → Exit**) and reopen it. Also verify in PowerShell under the **same Windows user** that `claude -p "Reply with OK"` succeeds, that `ANTHROPIC_BASE_URL` is `https://api.qcode.cc/api` (no `/v1` or trailing `/`), and that `ANTHROPIC_AUTH_TOKEN` starts with `cr_`.

### Why is the Claude icon missing after I open a folder or file?

Check two common causes:

1. **Restricted Mode**: Look at the bottom-left status bar for **Restricted Mode**, click it → **Manage** → **Trust** (`Ctrl+Enter`). Opening a single file instead of a folder does not persist Workspace Trust across restarts, so open your project with **File → Open Folder**.
2. **Multiple VS Code installations**: If a PC has both User Setup and System Setup installed, the extension may be installed in the other VS Code instance. Check which installation you launched.

### Can I use another QCode access point instead of `api.qcode.cc`?

Yes. QCode also provides `asia.qcode.cc` (Asia) and `us.qcode.cc` (North America). Replace only the hostname in `ANTHROPIC_BASE_URL` — for example `https://asia.qcode.cc/api` or `https://us.qcode.cc/api` — and restart VS Code. All three domains offer the same capabilities and differ only in network routing.

### Do I need a GitHub or Anthropic account?

No. On VS Code's first-run screen, click **Continue without Signing In** to skip GitHub login. With `config.json` and your QCode environment variables configured, Claude Code routes straight through QCode without requiring an Anthropic sign-in.

## At a glance

| Item | Details |
|---|---|
| Models you can use | Claude (Claude Code extension via Anthropic protocol / Copilot custom endpoint via Messages) · GPT (Copilot custom endpoint) · Chinese models (Copilot custom endpoint) · QCode does not offer the Gemini series |
| Protocol & Base URL | Claude Code extension: environment variable `ANTHROPIC_BASE_URL=https://api.qcode.cc/api` (root path) · Copilot custom endpoint: full URL `https://api.qcode.cc/api/v1/messages` in `chatLanguageModels.json` |
| Where to configure | Windows: `%USERPROFILE%\.claude\config.json` (`C:\Users\<YourUsername>\.claude\config.json`) + user environment variables · macOS/Linux: `~/.claude/config.json` + shell environment variables · Copilot: `chatLanguageModels.json` |
| Minimum VS Code version | **1.94.0 or higher** for the Claude Code extension · **1.122 or higher** for built-in GitHub Copilot custom endpoints |
| Official docs | [Claude Code extension](https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code) · [VS Code language models](https://code.visualstudio.com/docs/agent-customization/language-models) |

> **Using Trae IDE?** Trae is a VS Code fork, so many steps are similar. For Trae-specific marketplace details, offline `.vsix` installation, and coexisting with Trae's built-in AI, see the [Trae Integration Guide](/docs/ide/trae).

## Usage and shortcuts

### Opening the panel and running commands

| Action | Shortcut / Entry |
|---|---|
| Open Claude Code panel (Windows) | Click the **Claude** icon in the Activity Bar → **+ New session** (Windows reserves `Ctrl+Esc` for the Start menu) |
| Open Claude Code panel (macOS) | `Cmd+Esc` or click the **Claude** icon in the Activity Bar |
| Open Command Palette for Claude commands | `Ctrl+Shift+P` / `Cmd+Shift+P` → search **Claude Code: Open** |
| Open Inline Chat on selected code | `Ctrl+I` (or right-click → **Open Inline Chat**) |
| Open VS Code Settings for Claude Code | `Ctrl+,` / `Cmd+,` → search `Claude Code` |

### Common workflows

1. **Code Explanation** — Select code in the editor, right-click, and choose **Explain** (or **Add Selection to Chat** to ask a custom question).
2. **Code Generation** — Open the Claude Code chat panel, describe the feature or file you need, and review or apply the proposed edits.
3. **Code Refactoring** — Select the code block, right-click → **Open Inline Chat** (`Ctrl+I`) or **Add Selection to Chat**, describe the refactor, and preview changes before applying.
4. **Error Fixing and Code Review** — Select code with errors or changes to check, then right-click → **Fix** or **Code Review**.

## macOS and Linux setup

The screenshots above cover Windows 11, and the same extension (`anthropic.claude-code`, requiring **VS Code 1.94.0 or higher**) works on macOS and Linux once Claude Code CLI and its environment variables (`ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`) are configured. You can install the extension from the Extensions panel or via the command line:

```bash
code --install-extension anthropic.claude-code
```

Then create `~/.claude/config.json` (not `settings.json`) and restart VS Code:

<div data-os="macos" markdown="1">

### macOS

```bash
mkdir -p ~/.claude
cat > ~/.claude/config.json << 'EOF'
{
  "primaryApiKey": "qcode"
}
EOF
```

</div>

<div data-os="linux" markdown="1">

### Linux

```bash
mkdir -p ~/.claude
cat > ~/.claude/config.json << 'EOF'
{
  "primaryApiKey": "qcode"
}
EOF
```

</div>

## Using with Terminal CLI

The VS Code extension and the terminal CLI read the same QCode environment variables and can be used side by side:

| Scenario | Recommended Tool |
|---|---|
| Quick code edits | VS Code extension |
| Complex project analysis | Terminal CLI |
| Code review | Either |
| Git operations | Terminal CLI |
| File generation | Either |

## GitHub Copilot custom endpoints

> **Requires VS Code 1.122 or higher** (separate from the 1.94.0 minimum for the Claude Code extension).

VS Code's built-in Copilot Custom Endpoint lets you plug QCode straight into GitHub Copilot via `chatLanguageModels.json` (open Command Palette → **Chat: Manage Language Models**). Unlike the Claude Code extension, which takes the root URL `https://api.qcode.cc/api` in `ANTHROPIC_BASE_URL`, Copilot Custom Endpoint requires the **full messages URL** (`https://api.qcode.cc/api/v1/messages` for Claude via `messages`):

```json
[
  {
    "name": "QCode Claude",
    "vendor": "customendpoint",
    "apiKey": "cr_xxxxxxxx",
    "apiType": "messages",
    "url": "https://api.qcode.cc/api/v1/messages",
    "toolCalling": true,
    "models": [
      { "id": "claude-opus-5-5" }
    ]
  }
]
```

To use the Asia or North America access point here as well, replace `api.qcode.cc` with `asia.qcode.cc` or `us.qcode.cc` while keeping `/api/v1/messages`. For all three protocols, Copilot CLI BYOK, and known limits (inline completions still run through GitHub), see [GitHub Copilot Integration](/docs/ide/github-copilot).

## Related docs

- [Installation Guide](/docs/getting-started/installation) — install Claude Code CLI first
- [Environment Configuration](/docs/getting-started/environment) — set `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`
- [Endpoints and API paths](/docs/getting-started/endpoints-and-api-paths) — QCode protocols and access domains
- [GitHub Copilot Integration](/docs/ide/github-copilot) — full custom endpoint setup in VS Code
- [Trae Integration Guide](/docs/ide/trae) — Trae-specific marketplace and `.vsix` notes
- [Troubleshooting](/docs/reference/troubleshooting) — general connection and authentication checks