How to install Claw Code on Windows
This guide explains how to install and run Claw Code on Windows. It is written for beginners and uses Windows Terminal and PowerShell.
Open Windows Terminal
You can use any of the following methods.
Method 1: Open from the Run dialog
- Press Windows + R.
- Type
wtorwt.exe. - Press Enter.
Method 2: Open from the Start menu
- Press the Windows key.
- Open the list of all installed apps.
- Search for
Terminal. - Click Terminal.
Open as administorator
Note: If you open Windows Terminal once as an administrator, you won't be prompted by UAC for each
winget install during that elevated session — you only approve the UAC once when opening the
administrator terminal.
Method 3: Open as administrator from the Run dialog
- Press Windows + R.
- Type
wtorwt.exe. - Press Ctrl + Shift + Enter.
- When the User Account Control (UAC) prompt appears, approve it.
Method 4: Open as administrator from the Start menu
- Press the Windows key.
- Open the list of all installed apps.
- Search for
Terminal. - Right-click Terminal.
- Select Run as administrator.
- When the User Account Control (UAC) prompt appears, approve it.
Method 5: Open an administrator tab from Windows Terminal
- Open Windows Terminal normally.
- Click the down arrow (
∨) next to the tab bar. - Right-click PowerShell.
- Select Run as administrator.
- When the User Account Control (UAC) prompt appears, approve it.
Install Claw Code
1. Install or update PowerShell
- Open Windows Terminal with Command Prompt.
- Click the down arrow (
∨) and choose Command Prompt.
- Click the down arrow (
-
Run the following command:
If PowerShell is not installed yet, run this instead:
-
Restart Windows Terminal.
- Open Settings from the down arrow (
∨) menu. -
In Startup, set Default profile to PowerShell.
Note
Choose PowerShell, not Windows PowerShell. Windows PowerShell is the older version included with Windows.
-
Open a new PowerShell tab and confirm that it shows PowerShell 7 or newer.
2. Install Git
Run the following command:
After installation, restart Windows Terminal.
3. Clone the repository
-
Move to the directory where you want to place the source code. This guide uses the
Documentsfolder: -
Clone the repository:
-
Move into the cloned repository:
4. Install Rust
Run the following command:
After installation, restart Windows Terminal.
5. Build Claw Code from source
From the cloned claw-code\rust directory, run one of the following commands.
If you are not already in that directory, run:
For a debug build:
For an optimized release build:
The build may take about 5 to 15 minutes.
cargo build --workspaceis usually faster to build, but the executable is a debug build.cargo build --releasetakes longer, but the executable starts faster and has a smaller file size.
Set API keys
Claw Code needs API credentials for the model provider you want to use.
Method 1: Set environment variables for the current terminal only
This method is safer because the values disappear when you close the terminal.
For Anthropic Claude models, run one of the following commands:
or:
For OpenAI-compatible APIs, run:
Examples of OpenAI-compatible API endpoints:
https://openrouter.ai/api/v1https://api.cerebras.ai/v1http://127.0.0.1:8000/v1for local models such as Ollama, llama.cpp, or LM Studio
If you are not already in the Claw Code rust directory, change to it first. For example:
Or, if you are in the repository parent folder, use a relative path:
Then start Claw Code. Use the command that matches the build type you created.
For a debug build:
For a release build:
Example model names:
openai/gpt-5.5anthropic/claude-opus-4-7deepseek/deepseek-v4-pro
Method 2: Save environment variables permanently
This method is convenient for daily use, but it stores your credentials in your user environment variables. Use it only if you understand the security risk.
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "SET YOUR API KEY HERE", "User")
[Environment]::SetEnvironmentVariable("OPENAI_BASE_URL", "SET YOUR API ENDPOINT HERE", "User")
Open a new terminal after setting permanent environment variables.
If you opened a new terminal (for example after setting persistent env vars), make sure you're in the rust directory before running Claw. Example:
For a debug build:
For a release build:
Add claw.exe to your PATH
If you want to run claw from any directory, add the build output directory to your user Path environment variable.
For a debug build:
$newPath = "$env:USERPROFILE\Documents\claw-code\rust\target\debug"
$oldPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$oldPath;$newPath", "User")
For a release build, use target\release instead:
$newPath = "$env:USERPROFILE\Documents\claw-code\rust\target\release"
$oldPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$oldPath;$newPath", "User")
Open a new terminal after updating Path.
Start Claw Code in your project
-
Move to your own project repository:
-
Start Claw Code:
Replace the model name with the model you want to use.