Claude Code Installation Guide: Manual Setup on Windows 11 with QCode
Install Node.js and Claude Code on Windows 11, set QCode environment variables, and run your first prompt—23 steps with 21 English screenshots.
Need an API key? Sign up →Endpoints & base URLs →
On This Page
- Download and install
- Step-by-step on Windows 11
- Open the Node.js website
- Select Windows x64 and download the installer
- Confirm the download finished and open the installer
- Click Next on the Welcome screen
- Accept the License Agreement
- Keep the default folder and verify Add to PATH
- Skip Tools for Native Modules
- Click Install and approve UAC
- Click Finish to close the wizard
- Open Windows Terminal, enter a project folder, and check node
- Run npm --version and expect an execution policy error
- Allow PowerShell scripts for your user account
- Type the Claude Code install command
- Press Enter and wait for the installation to finish
- Verify that Claude Code is installed
- Save the QCode base URL to your user environment
- Save your QCode API key from the clipboard
- Reopen PowerShell and verify both environment variables
- Launch claude for the first time and pick a text style
- Trust your project folder
- Check the main screen
- Send your first message
- Ask Claude Code to create a file
- Verify it works
- Common errors
- FAQ
- macOS and Linux installation
- Advanced configuration (optional environment variables)
- Installing Node.js with a package manager (optional)
- Next steps
Short answer: Install Node.js and Claude Code in Windows Terminal on Windows 11, set user environment variables ANTHROPIC_BASE_URL to https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN to cr_xxxxxxxx, reopen the terminal, and run claude.
| Setting | Value |
|---|---|
| Base URL | https://api.qcode.cc/api |
| API Key | cr_xxxxxxxx |
| Install command | npm install -g @anthropic-ai/claude-code |
| Launch command | claude |
Verified on 2026-11-22 · Claude Code 2.1.330 · Windows 11
By the end of this guide, your Windows 11 PC will have Node.js and Claude Code installed and connected to QCode—just open Windows Terminal, cd into any project folder, and run claude to chat and edit project files without an Anthropic account.
Prefer to configure everything automatically in one command? Use the One-Click Setup Script. If you want to install each piece manually and see every screen along the way, keep reading.
- A 64-bit Windows 10 or Windows 11 PC that can open Windows Terminal or Windows PowerShell
- A QCode.cc account with an API key starting with
cr_copied from the Dashboard. Don't have an account yet? Sign up for QCode, pick a plan on the Pricing page, and create your key in the Dashboard. - Access to
nodejs.org(if it does not load, check the regional tabs under Download and install below) - About 20 uninterrupted minutes to download and install Node.js and Claude Code
Download and install¶
Manual installation only needs two pieces:
- Node.js: Download the Windows
.msiinstaller from nodejs.org/en/download. Pick x64 for standard Intel or AMD PCs, or ARM64 for Windows on ARM devices. - Claude Code: Installed globally via npm with
npm install -g @anthropic-ai/claude-code(requires Node.js 22 LTS or newer).
Using Claude Code through QCode only requires a QCode API key—no Anthropic account is needed. Set your base URL to https://api.qcode.cc/api (Anthropic-compatible). If you also configure tools that expect the OpenAI-compatible format, use https://api.qcode.cc/openai/v1. Two optional regional endpoints, https://asia.qcode.cc/api and https://us.qcode.cc/api, work identically—use whichever gives you lower latency. See Endpoints & API Paths for full details.
Want to skip manual downloads and run the automated script instead? Run the command for your OS (see One-Click Setup Script for flags and rollback):
# Windows PowerShell
irm https://qcode.cc/install/claude-code.ps1 | iex
# macOS / Linux
curl -fsSL https://qcode.cc/install/claude-code.sh | bash
Download access differs slightly by region—choose your region below:
Global (US / Europe / Japan)
- Open nodejs.org/en/download, select Windows and x64 (or ARM64), and download Windows Installer (.msi).
- Use the default official npm registry (
registry.npmjs.org) when installing Claude Code.
Mainland China
- Access to
nodejs.orgcan be intermittent. If it opens, follow the screenshots below; otherwise download the matching.msifrom nodejs.cn ornpmmirror.com/mirrors/node/. - If
npm installstalls, switch to the mirror registry first withnpm config set registry https://registry.npmmirror.com, then run the install command again. - Installing the npm package does not require an Anthropic account.
Arab Countries
- Use the same download path as Global (US / Europe / Japan): download the Windows
.msifrom nodejs.org/en/download and install Claude Code from the default npm registry.
Russia / Iran
nodejs.orgusually loads directly; if it does not, download the matching.msifrom nodejs.cn ornpmmirror.com/mirrors/node/.- If npm downloads time out or hang, run
npm config set registry https://registry.npmmirror.comand retry the install command.
If you already use winget, you can also install Node.js in PowerShell with winget install OpenJS.NodeJS.LTS, then jump straight to Step 10 below.
Step-by-step on Windows 11¶
The 23 steps below do one thing per step. The orange circled numbers (①, ②, ③) match the exact callouts on each screenshot.
Open the Node.js website¶
Open Microsoft Edge and go to https://nodejs.org/en/. In the middle of the page, ① is the green "Get Node.js" button, and the footer at ② shows the current LTS version v26.13.1 (seeing a newer LTS number is normal). Click ① to open the download page.

You did it right when the address bar shows nodejs.org/en/, the green "Get Node.js" button is visible in the center, and the footer lists v26.13.1 Latest LTS (or newer).
Stuck? The page keeps spinning or will not load
Download the same Windows .msi from nodejs.cn or npmmirror.com/mirrors/node/ instead. Once Node.js is installed, continue from Step 10.
Select Windows x64 and download the installer¶
On the download page, confirm the version selector at ① shows v26.13.1 with LTS, and that the prebuilt package section below it is set to Windows and x64 (switch x64 to ARM64 on Windows on ARM PCs). Click "Windows Installer (.msi)" at ② to start the download.

You did it right when the selectors show v26.13.1 LTS, Windows, and x64, and Edge starts downloading the .msi file in the top-right corner.
Confirm the download finished and open the installer¶
Edge's Downloads panel shows node-v26.13.1-x64.msi (about 34.9 MB) at ①. Click the file name (or "Open file" below it) to launch the installer; if the panel has already closed, double-click the file in your Downloads folder. ② is the "Windows Installer (.msi)" button on the page if you need to trigger the download again.

You did it right when node-v26.13.1-x64.msi appears in the Downloads panel and clicking it opens the Node.js Setup window.
Click Next on the Welcome screen¶
The installer opens on the Welcome screen showing Welcome to the Node.js Setup Wizard at ①. Click "Next" at ② to continue; you will keep the default choices through the rest of the wizard.

You did it right when the window title reads Node.js Setup and the heading shows Welcome to the Node.js Setup Wizard.
Accept the License Agreement¶
Check "I accept the terms in the License Agreement" at ①, then click "Next" at ②.

You did it right when the checkbox has a checkmark and the "Next" button becomes clickable.
Keep the default folder and verify Add to PATH¶
On the Destination Folder page, keep the default path C:\Program Files\nodejs\ and click "Next". On Custom Setup, verify that "Add to PATH" at ① stays enabled (no red X icon) so new terminals can find node and npm, then click "Next" at ②.

You did it right when "Add to PATH" displays a drive icon (not a red X) and the installation folder is C:\Program Files\nodejs\.
Skip Tools for Native Modules¶
The Tools for Native Modules page offers to install Chocolatey and Visual Studio build tools. Claude Code does not need them—leave the checkbox at ① unchecked and click "Next" at ②.

You did it right when the checkbox remains empty and clicking "Next" moves straight to the confirmation screen.
Click Install and approve UAC¶
The Ready to install Node.js confirmation page is shown at ①. Click "Install" at ②. Windows then shows a User Account Control (UAC) prompt—verify the publisher is OpenJS Foundation and click "Yes" (or press Alt+Y). This is the only step in the tutorial that requires administrator permission.

You did it right when the UAC dialog shows publisher OpenJS Foundation and clicking "Yes" starts the installation progress bar.
Stuck? You clicked "No" on the UAC prompt by mistake
The installer cancels without changing your system. Double-click the downloaded .msi file again, click through to this screen, click "Install", and choose "Yes" when UAC appears.
Click Finish to close the wizard¶
When installation finishes, ① shows Completed the Node.js Setup Wizard. Click "Finish" at ② to close the setup window.

You did it right when the wizard closes and C:\Program Files\nodejs\node.exe exists on your PC.
Open Windows Terminal, enter a project folder, and check node¶
Close Edge and open Windows Terminal from the Start menu (it opens in a Windows PowerShell tab by default). Run ① cd C:\demo-hello to enter an empty project folder (or cd into your own existing project folder), then run node --version at ②—it prints v26.13.1, confirming Node.js is installed and on PATH.

You did it right when the prompt shows PS C:\demo-hello> and node --version prints v26.13.1 (or any version v22 or higher).
Stuck? PowerShell says node is not recognized
The new PATH entry only loads in terminal windows opened after installation. Close Windows Terminal, open a fresh window, and run node --version again. If it still fails, rerun the Node.js .msi and verify "Add to PATH" is enabled on the Custom Setup page.
Run npm --version and expect an execution policy error¶
Next, run npm --version. At ③, PowerShell displays a red error: File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. This is not a broken install—Windows blocks .ps1 scripts in PowerShell by default, and npm runs through a .ps1 wrapper. You will fix it with one command in the next step.

You did it right when the red message mentions npm.ps1 and running scripts is disabled on this system, then returns to the PS C:\demo-hello> prompt. (If npm --version already prints a version number like 11.20.0, your execution policy is already configured—skip ahead to Step 13.)
Stuck? The red error names claude.ps1 instead
It has the exact same cause. Running the Set-ExecutionPolicy command in Step 12 fixes both npm.ps1 and claude.ps1 without reinstalling anything.
Allow PowerShell scripts for your user account¶
In the same PowerShell window, run ① Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser and press Enter. This only applies to your Windows account, needs no administrator rights, and only has to be run once. Run npm --version again—at ② it now prints 11.20.0.

You did it right when Set-ExecutionPolicy finishes with no red error and npm --version outputs 11.20.0.
Stuck? Access denied when changing execution policy
Check that -Scope CurrentUser is at the end of the command. Do not omit it—with -Scope CurrentUser, the command runs in a regular PowerShell window with no administrator prompt.
Type the Claude Code install command¶
At the prompt ①, type npm install -g @anthropic-ai/claude-code (do not press Enter yet until you double-check the package name). This command downloads Claude Code from npm and installs the claude CLI globally so you can run it from any folder.

You did it right when the line reads npm install -g @anthropic-ai/claude-code exactly, with the cursor at the end.
Press Enter and wait for the installation to finish¶
Press Enter to run the command at ①. npm downloads the package and finishes with added 2 packages at ② (the time varies by network). You can safely ignore the yellow npm warn install-scripts lines underneath—they are an npm 11 informational warning and do not affect claude.

You did it right when the output shows added 2 packages, followed by the yellow npm warn lines and a fresh PowerShell prompt.
Stuck? The download hangs with no progress
Switch npm to a mirror registry with npm config set registry https://registry.npmmirror.com, then run npm install -g @anthropic-ai/claude-code again. On a corporate network or behind antivirus inspection, hanging output or TLS errors may require switching networks.
Verify that Claude Code is installed¶
Run claude --version. At ①, PowerShell prints 2.1.330 (Claude Code), confirming both the global npm package and PATH are working. The first run can take 10–20 seconds before printing output—that is normal.

You did it right when you see a single line reading 2.1.330 (Claude Code).
Save the QCode base URL to your user environment¶
Run the command at ① to save ANTHROPIC_BASE_URL permanently for your Windows user account so every future terminal window inherits it:
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.qcode.cc/api", [System.EnvironmentVariableTarget]::User)
No output and an immediate return to the prompt means it succeeded.

You did it right when PowerShell returns directly to PS C:\demo-hello> with no error text.
Stuck? Want to test in the current window only first?
You can set a temporary session-only variable with $env:ANTHROPIC_BASE_URL = "https://api.qcode.cc/api". It disappears when you close the window, so use the permanent [System.Environment]::SetEnvironmentVariable command above for daily work.
Save your QCode API key from the clipboard¶
First copy your cr_xxxxxxxx API key from the Dashboard to your clipboard. Then run the command at ② to store it in ANTHROPIC_AUTH_TOKEN without ever showing the key on screen:
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", (Get-Clipboard), [System.EnvironmentVariableTarget]::User)
Reading from (Get-Clipboard) keeps your real key out of terminal history and screenshots. Never paste your key into chats or screenshots.

You did it right when PowerShell returns to the prompt with no output and no cr_ string visible on screen.
Need an API Key?
Sign up for QCode, purchase a pay-as-you-go pack if you want to start without a recurring plan, and create your API key in the Dashboard. Copy the cr_ key and run the command above. For supported payment options, see Payment Methods.
Reopen PowerShell and verify both environment variables¶
User-level environment variables only apply to newly opened windows. Type exit to close Windows Terminal, open a new Windows Terminal window, and run cd C:\demo-hello. At ①, echo $env:ANTHROPIC_BASE_URL prints https://api.qcode.cc/api. At ②, run echo $env:ANTHROPIC_AUTH_TOKEN.Length to confirm the key is loaded (it prints a number such as 67) without printing the secret itself.

You did it right when the first output line is https://api.qcode.cc/api and the second line is a non-zero number (for example 67).
Stuck? The first line prints nothing
Either the variable was not saved with [System.EnvironmentVariableTarget]::User, or the terminal was not fully closed and reopened. Repeat Steps 16 and 17, close all Windows Terminal windows, open a new one, and check again.
Launch claude for the first time and pick a text style¶
Inside C:\demo-hello, type claude and press Enter. The welcome screen shows Claude Code v2.1.330 at ① and asks you to Choose the text style that looks best with your terminal at ②. The default option "Auto (match terminal)" at ③ works cleanly with Windows Terminal—just press Enter.

You did it right when you see Claude Code v2.1.330 and the text style list with "Auto (match terminal)" selected.
Stuck? Claude Code asks you to log in to an Anthropic account
You do not need an Anthropic account when using QCode. A login prompt means your environment variables were not loaded—press Ctrl+C or type /exit, then return to Step 18 and confirm both ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.Length print values.
Trust your project folder¶
Press Enter to pass the Security notes screen. Next, Claude Code displays Accessing workspace: C:\demo-hello and Quick safety check: Is this a project you created or one you trust? at ① and ②. The cursor starts on "No, exit"—press the Down arrow (↓) once to highlight "Yes, I trust this folder" at ③, then press Enter.

You did it right when the selection cursor moves to "Yes, I trust this folder" and pressing Enter opens the main screen.
Check the main screen¶
At ①, the header displays Claude Code v2.1.330 and Opus 5.5 · API Usage Billing—seeing API Usage Billing confirms Claude Code is using your API key rather than a web login. ② explains that auto mode is now the default permission mode, and ③ is the prompt box at the bottom where you type requests.

You did it right when the header shows Claude Code v2.1.330 and Opus 5.5 · API Usage Billing, and the cursor is ready in the input box.
Send your first message¶
In the input box at ①, type Hello, please introduce yourself in one sentence. and press Enter. Claude responds in one sentence at ② and prints a timing line at ③, proving your API key, base URL, and network connection to QCode all work end to end.

You did it right when your prompt appears at the top, followed by a reply and a timing line—with no 401, 404, or timeout error.
Stuck? You get a 401 or 404 error instead of a reply
A 401 means your key was not loaded or was copied with extra spaces—return to Step 18 to verify ANTHROPIC_AUTH_TOKEN.Length and recopy the key if needed. A 404 means the base URL is wrong: it must be https://api.qcode.cc/api with no trailing / and no /v1.
Ask Claude Code to create a file¶
Send one more test prompt at ①: Create a file hello.txt in the current folder with the content hello. Claude Code calls the Write(hello.txt) tool at ② and prints a completion summary at ③. Because auto mode is active by default, low-risk file writes run without asking for confirmation each time.

You did it right when you see the Write(hello.txt) block and a summary confirming creation, and C:\demo-hello\hello.txt contains hello.
Verify it works¶
Your installation is complete when all three checks pass:
node --versionprintsv26.13.1(any versionv22or newer works) andnpm --versionprints11.20.0(or newer).- In a newly opened PowerShell window,
echo $env:ANTHROPIC_BASE_URLreturnshttps://api.qcode.cc/api. - Running
claudeopens the main screen, answers a prompt cleanly, and createshello.txtin your project folder.
If you want extra confirmation that requests are routing through QCode, open https://probe.qcode.cc/ and check with your API key.
All set¶
Node.js and Claude Code are installed on Windows 11 and connected to QCode. Next time, just open Windows Terminal, cd into your project folder, and run claude. Where to go next:
- Claude Code Tutorial
- Quick Start
- CLI Tips
- Troubleshooting
- Next: compare plans on the Pricing page
- Return to the Dashboard to check usage and balance
Common errors¶
| Error message | Cause | Fix |
|---|---|---|
File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. |
PowerShell's default execution policy blocks .ps1 script shims, including npm.ps1 and claude.ps1. |
Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser once in PowerShell, then retry npm --version. |
npm warn install-scripts 1 package has install scripts not yet covered by allowScripts: @anthropic-ai/[email protected] (postinstall: node install.cjs) |
An informational npm 11 warning for packages with postinstall scripts—not an installation failure. | No action needed. Run claude --version; if it prints the version, installation succeeded. |
claude : The term 'claude' is not recognized as the name of a cmdlet |
The terminal was opened before installation or the npm global bin folder is not on PATH. |
Close and reopen Windows Terminal, then run claude --version. If it still fails, ensure node --version is v22 or newer and rerun npm install -g @anthropic-ai/claude-code. |
Not logged in · Please run /login |
ANTHROPIC_AUTH_TOKEN or ANTHROPIC_BASE_URL was not loaded in the current terminal session. |
Close and reopen Windows Terminal, check echo $env:ANTHROPIC_BASE_URL and echo $env:ANTHROPIC_AUTH_TOKEN.Length, and repeat Steps 16 and 17 if either is empty. |
Please run /login API Error: 401 Invalid authentication credentials |
The API key is truncated, has leading/trailing spaces, or has expired. | Copy the full cr_ key again from the Dashboard, rerun Step 17, and reopen Windows Terminal. If the key expired, see What happens when my API key expires? below. |
{"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"}} |
The key was stored in ANTHROPIC_API_KEY (sent as x-api-key) instead of ANTHROPIC_AUTH_TOKEN (sent as Authorization: Bearer). |
Unset ANTHROPIC_API_KEY, store your QCode key in ANTHROPIC_AUTH_TOKEN, keep ANTHROPIC_BASE_URL set to https://api.qcode.cc/api (no /v1), and reopen PowerShell. |
FAQ¶
Running claude says the command is not recognized¶
Newly installed commands and updated PATH entries only load in newly opened terminals. Close Windows Terminal, open a fresh window, and run claude again. If it still fails, check that node --version is v22 or newer and reinstall Node.js with "Add to PATH" enabled.
Do I need to install Git?¶
No. Installing Node.js, npm, and Claude Code and connecting to QCode does not require Git. You only need Git later if you want Claude Code to inspect repository history or diffs.
Do I have to cd into a project folder every time?¶
Yes. Claude Code treats the folder you launch it from as its workspace for reading and writing files. To switch projects, type /exit, cd into the other folder, and run claude again.
What happens when my API key expires?¶
It depends on which type of key you have:
- Personal plan keys cannot be renewed after they expire. You need to start a new plan, create a new API key in the Dashboard, and update
ANTHROPIC_AUTH_TOKENto the new key. - Pay-as-you-go pack keys reactivate automatically after you purchase another pack—the same key resumes working and you do not need to change your environment variables.
I changed environment variables, but Claude Code still connects to the old endpoint¶
If you previously configured another provider in C:\Users\<username>\.claude\settings.json, values inside its env block take precedence over Windows environment variables. Update or remove ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in that file, then restart claude.
How do I use the OpenAI-compatible format?¶
For tools that require an OpenAI-compatible endpoint, set the base URL to https://api.qcode.cc/openai/v1 and keep the same QCode API key. See Endpoints & API Paths for full details.
macOS and Linux installation¶
The Windows walkthrough ends above. On macOS or Linux, the QCode configuration is identical—only the Node.js install and shell export commands differ. Node.js 22 LTS or newer is recommended on all platforms.
macOS¶
# With Homebrew (recommended)
brew update
brew install node
brew install --cask claude-code
# Or download the macOS .pkg installer from:
# https://nodejs.org/en/download
You can also install Claude Code via npm (same as Windows):
npm install -g @anthropic-ai/claude-code
claude --version
Save the environment variables permanently in ~/.zshrc (macOS default) or ~/.bash_profile for bash:
# For zsh (macOS default)
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.bash_profile
echo 'export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"' >> ~/.bash_profile
source ~/.bash_profile
For a temporary current-session test only:
export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"
export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"
Replace cr_xxxxxxxx with your key from the Dashboard. If npm install -g hits a permission error, either run sudo npm install -g @anthropic-ai/claude-code or set a user-local prefix with npm config set prefix ~/.npm-global and add ~/.npm-global/bin to your PATH. If macOS blocks an installer or binary, open System Settings → Privacy & Security and click "Open Anyway" or "Allow".
Linux / WSL2¶
# Ubuntu / Debian (NodeSource LTS repository)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
npm install -g @anthropic-ai/claude-code
claude --version
On Fedora / RHEL / CentOS you can also run sudo dnf install nodejs npm (verify node --version is v22 or newer afterward).
Save the environment variables permanently in ~/.bashrc (or ~/.zshrc if you use zsh):
# For bash (default)
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"' >> ~/.bashrc
source ~/.bashrc
# For zsh
echo 'export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="cr_xxxxxxxx"' >> ~/.zshrc
source ~/.zshrc
If native build dependencies are missing, install them first: sudo apt install build-essential (Ubuntu / Debian) or sudo dnf groupinstall "Development Tools" (CentOS / RHEL / Fedora).
Verify on macOS and Linux¶
echo "$ANTHROPIC_BASE_URL"
cd /path/to/your/project
claude
The first command should print https://api.qcode.cc/api, and claude should open and reply to a prompt. Avoid echoing $ANTHROPIC_AUTH_TOKEN directly so your key never appears in terminal logs or screenshots.
Advanced configuration (optional environment variables)¶
Beyond the two required variables, you can customize Claude Code with these optional settings:
ANTHROPIC_MODEL¶
Specify the default model. We recommend setting Sonnet 5 explicitly. If unset, Claude Code uses its own built-in default for that CLI version—do not rely on a historical default name from this page. 4.x IDs such as claude-sonnet-4-6 and claude-opus-4-8 remain available.
# Daily recommendation (Sonnet 5)
export ANTHROPIC_MODEL=claude-opus-5-5
# Heavy work (Opus 5, higher cost)
export ANTHROPIC_MODEL=claude-opus-5-5
On Windows PowerShell (permanent user variable):
[System.Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-opus-5-5", [System.EnvironmentVariableTarget]::User)
MAX_THINKING_TOKENS¶
Control the maximum tokens for the model's thinking process (set to 0 to disable):
export MAX_THINKING_TOKENS=16000
CLAUDE_CODE_EFFORT_LEVEL¶
Adjust Claude's effort level:
# Options: low / medium / high
export CLAUDE_CODE_EFFORT_LEVEL=high
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC¶
Disable non-essential network requests (such as telemetry):
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
Installing Node.js with a package manager (optional)¶
If you already use Chocolatey, Scoop, or winget on Windows, you can skip the .msi wizard (advanced option—beginners can skip this section):
# Chocolatey
choco install nodejs
# Scoop
scoop install nodejs
# winget
winget install OpenJS.NodeJS.LTS
After installing, close and reopen Windows Terminal, then continue from Step 10 above.
Next steps¶
Congratulations—you have installed Claude Code and connected it to QCode. Next:
- Check out Quick Start to learn everyday workflows.
- Explore CLI Tips to work faster in the terminal.
- Visit Troubleshooting if you run into issues later.
Get started with QCode
One API key for Claude Code, Codex and more — billed per token, per-model prices on qcode.cc/models