Windows
Install Claude Code on Windows
Five steps with separate PowerShell and Command Prompt paths, from Anthropic’s native installer to verified StartupAPI routing.
Identify your shell
Use the path that matches the prompt in front of your cursor. Do not paste commands from the other shell.
| Shell | Prompt example | Use this path |
|---|---|---|
| PowerShell | PS C:\Users\Name> | PowerShell path |
| Command Prompt | C:\Users\Name> | Command Prompt (CMD) path |
Install Claude Code
Choose one native installer. Administrator access is not required.
PowerShell path
Downloads and runs Anthropic's official PowerShell installer.
irm https://claude.ai/install.ps1 | iexCommand Prompt (CMD) path
Downloads Anthropic's official CMD installer, runs it, and deletes the temporary install.cmd file after success.
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdWinGet alternative
Installs the official Claude Code WinGet package. WinGet installs require manual upgrades.
winget install Anthropic.ClaudeCodeConnect StartupAPI
Use the configuration block for the same shell you chose above.
PowerShell path
This saves the minimum gateway and Bearer-token settings, then pins main, alias, background, and subagent model selection to examples enabled in the current StartupAPI catalog. Replace YOUR_STARTUPAPI_API_KEY with your key.
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://startupapi.io", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "YOUR_STARTUPAPI_API_KEY", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", $null, "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "claude-sonnet-4-6", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_SONNET_MODEL", "claude-sonnet-4-6", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_OPUS_MODEL", "claude-opus-4-6", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_DEFAULT_HAIKU_MODEL", "claude-haiku-4-5", "User")
[Environment]::SetEnvironmentVariable("CLAUDE_CODE_SUBAGENT_MODEL", "claude-sonnet-4-6", "User")Command Prompt (CMD) path
These CMD-compatible SETX commands persist the StartupAPI base URL, Bearer token, and current catalog-derived model example for your Windows user. Replace YOUR_STARTUPAPI_API_KEY with your key.
setx ANTHROPIC_BASE_URL "https://startupapi.io"
setx ANTHROPIC_AUTH_TOKEN "YOUR_STARTUPAPI_API_KEY"
setx ANTHROPIC_MODEL "claude-sonnet-4-6"Open a new shell and verify
Persistent user variables appear in new processes. Close the shell you used, reopen the same shell, then run its verification block.
PowerShell verification
Reads the values in the new PowerShell process and checks the Claude Code installation.
$env:ANTHROPIC_BASE_URL
$env:ANTHROPIC_MODEL
claude --versionCMD verification
Reads the values in the reopened CMD process and checks the Claude Code installation.
echo %ANTHROPIC_BASE_URL%
echo %ANTHROPIC_MODEL%
claude --versionOpen your project, launch, and verify the gateway
Change to your project folder, run claude, then enter /status inside Claude Code.
The cd command works in both PowerShell and CMD. Claude Code then opens an interactive session in that project.
cd "C:\path\to\your-project"
claudeCommon mistakes
- Mixing shell syntaxPowerShell uses irm, iex, [Environment], and $env:. CMD uses install.cmd, setx, and %VARIABLE% syntax.
- Not reopening the shellPowerShell user-variable changes and CMD SETX changes apply to new terminal processes.
- Running from the wrong folderStart claude from your project folder, not your home folder.
Troubleshooting
Hit an error during install or your first prompt? Match the message to a fix.
Open Troubleshooting