claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Native Windows(Powershell) install of Claude Code is not viable

Open Priyabhunia opened this issue 3 weeks ago • 16 comments

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

when downloading claude code from windows Windows + PowerShell combinations, the redirect chain fails silently. The script finishes, but the binary is never downloaded.

TLS works

PowerShell works

Defender is not blocking

The binary endpoint does not resolve correctly

claude.exe never appears The installer script “succeeds” but produces no binary I have uv.exe, hf.exe, but no claude.exe

so thats why the claude starting command is also not working

What Should Happen?

after download I should be able to use (claude or claude -v) like command or I should see claude.exe file

Error Messages/Logs

C:\WINDOWS\system32>
>> irm https://claude.ai/install.ps1 | iex
Setting up Claude Code...

√ Claude Code successfully installed!

  Version: 2.0.67

  Location: C:\Users\priya\.local\bin\claude.exe


  Next: Run claude --help to get started

‼ Setup notes:
  • installMethod is native, but claude command not found at C:\Users\priya\.local\bin\claude.exe


✅ Installation complete!

PS C:\WINDOWS\system32> claude --version
>>
claude : The term 'claude' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ claude --version
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (claude:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

Steps to Reproduce

just try to download claude code in windows powershell(administrator mode ) and try to use it

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

letest version from docs . maybe v2.0.74

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

https://openrouter.ai/docs/guides/guides/claude-code-integration following this docs right now . but the command is same for powershell

OK THE CMD COMMAND FROM CLAUDE WEBSITE IS WORKING PROPERLY , BUT THE POWERSHELL ONE IS NOT

Priyabhunia avatar Dec 20 '25 19:12 Priyabhunia

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9281
  2. https://github.com/anthropics/claude-code/issues/9238
  3. https://github.com/anthropics/claude-code/issues/9436

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 20 '25 19:12 github-actions[bot]

I can also verify that this works with the Windows CMD, but not with Windows PowerShell. I ran into the same issues.

xeokeri avatar Dec 20 '25 20:12 xeokeri

I can also verify that this works with the Windows CMD, but not with Windows PowerShell. I ran into the same issues.

I already mentioned that in capital

Priyabhunia avatar Dec 20 '25 21:12 Priyabhunia

@Priyabhunia I was just verifying that I too saw the same, and was just agreeing with you that it is a valid bug. I was going to report it myself, until I saw that you already did.

xeokeri avatar Dec 20 '25 21:12 xeokeri

& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) latest

this worked for me in powershell

meesp123 avatar Dec 21 '25 14:12 meesp123

Ran into this same issue tonight. Found workarounds that might help others:

The binary does exist

It's bundled inside the VS Code extension:

%USERPROFILE%\.vscode\extensions\anthropic.claude-code-<version>-win32-x64\resources\native-binary\claude.exe

Workaround

# Create the directory the installer claims to use
New-Item -ItemType Directory -Path "$env:USERPROFILE\.local\bin" -Force

# Symlink to VS Code extension's native binary (update version number as needed)
New-Item -ItemType SymbolicLink -Path "$env:USERPROFILE\.local\bin\claude.exe" `
  -Target "$env:USERPROFILE\.vscode\extensions\anthropic.claude-code-2.0.75-win32-x64\resources\native-binary\claude.exe"

# Add to PATH permanently
[Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.local\bin;" + [Environment]::GetEnvironmentVariable("Path", "User"), "User")

Open a new PowerShell window and claude --version should work.

Note: When the VS Code extension updates, you'll need to update the symlink to point to the new version folder.

Additional performance issue

Even when working, startup was slow (~1500ms vs expected ~600ms). Found two culprits:

1. Cache bloat in ~/.claude/

This directory grew to 585MB silently:

127MB   plugins/cache/
145MB   plugins/marketplaces/
255MB   projects/
36MB    debug/
23MB    file-history/

2. Broken plugins

claude doctor showed 5 plugin errors — each failed marketplace lookup adds latency:

Plugin Errors
└ 5 plugin error(s) detected:
  └ blockchain-web3@claude-code-workflows: Plugin not found in marketplace
  └ ...

No built-in way to remove these.

Fix for performance

# Clean cache (safe to delete, regenerates as needed)
Remove-Item -Recurse -Force ~/.claude/debug
Remove-Item -Recurse -Force ~/.claude/projects
Remove-Item -Recurse -Force ~/.claude/file-history
Remove-Item -Recurse -Force ~/.claude/plugins/cache
Remove-Item -Recurse -Force ~/.claude/plugins/marketplaces

# Remove broken plugins from ~/.claude.json
# Open the file and delete the "plugins" section manually

Result: Startup time went from ~1500ms back to ~600ms (expected baseline).


Would be great if:

  1. The native installer actually downloaded the binary
  2. claude cache clean command existed
  3. claude doctor --fix could remove broken plugins

infiniteloop369 avatar Dec 22 '25 05:12 infiniteloop369

Another workaround:

  • Download the install.ps1 file (don't execute it yet).
  • Modify install.ps1 so that it does not remove the downloaded exe file in ~/.claude/downloads/. Comment out line 84 "Remove-Item -Force $binaryPath"
  • Run the modified install.ps1
  • Copy ~/.claude/downloads/claude-[platform].exe to ~/.local/bin/claude.exe
  • Use that claude to (re)install/upgrade itself:
claude install
claude update

cjpeterein avatar Dec 23 '25 19:12 cjpeterein

This certainly appears to be a regression. I used the PowerShell install script successfully on a different machine a few months ago (around September), but it is now failing on a new machine I'm trying.

mt-xing avatar Dec 27 '25 17:12 mt-xing

Windows Native Installation Fix Workaround

[!WARNING] Before running: This script will force-close all running Claude Code processes and uninstall existing Claude installations before reinstalling. Save your work and close Claude Code first. Run at your own risk.

Quick Fix (PowerShell) - No Download Needed

& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) latest

Full Installer Script

View source on GitHub Gist

PowerShell

irm https://gist.githubusercontent.com/fatihaziz/6b6f68e9b5cd2fd7763591f25d97ea54/raw/claude_installer.py -OutFile $env:TEMP\ci.py; python $env:TEMP\ci.py --native-only

Bash / Git Bash / Cygwin

curl -fsSL https://gist.githubusercontent.com/fatihaziz/6b6f68e9b5cd2fd7763591f25d97ea54/raw/claude_installer.py | python - --native-only

Why It Works

The latest argument bypasses the version-check bug in claude.exe install (#14942).

Root cause: The installer checks if runningVersion == targetVersion and skips copying the binary - but doesn't verify the target file actually exists.

What The Script Does

  1. Force-closes all running Claude Code processes
  2. Uninstalls existing Claude installations (npm, bun, deno, native)
  3. Downloads Claude binary directly from GCS bucket
  4. Verifies SHA256 checksum
  5. Runs claude.exe install latest (bypasses the bug)
  6. Verifies installation

Requirements

  • Python 3.6+
  • curl (included in Windows 10+)
  • Internet connection

fatihaziz avatar Dec 27 '25 21:12 fatihaziz

Windows Native Installation Fix Workaround

Warning

Before running: This script will force-close all running Claude Code processes and uninstall existing Claude installations before reinstalling. Save your work and close Claude Code first. Run at your own risk.

Quick Fix (PowerShell) - No Download Needed

& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) latest

Full Installer Script

View source on GitHub Gist

PowerShell

irm https://gist.githubusercontent.com/fatihaziz/6b6f68e9b5cd2fd7763591f25d97ea54/raw/claude_installer.py -OutFile $env:TEMP\ci.py; python $env:TEMP\ci.py --native-only

Bash / Git Bash / Cygwin

curl -fsSL https://gist.githubusercontent.com/fatihaziz/6b6f68e9b5cd2fd7763591f25d97ea54/raw/claude_installer.py | python - --native-only

Why It Works

The latest argument bypasses the version-check bug in claude.exe install (#14942).

Root cause: The installer checks if runningVersion == targetVersion and skips copying the binary - but doesn't verify the target file actually exists.

What The Script Does

  1. Force-closes all running Claude Code processes
  2. Uninstalls existing Claude installations (npm, bun, deno, native)
  3. Downloads Claude binary directly from GCS bucket
  4. Verifies SHA256 checksum
  5. Runs claude.exe install latest (bypasses the bug)
  6. Verifies installation

Requirements

  • Python 3.6+
  • curl (included in Windows 10+)
  • Internet connection

thank you!

llegomark avatar Dec 30 '25 10:12 llegomark

This is work for me: winget install --id Anthropic.ClaudeCode

TimLuong avatar Dec 30 '25 18:12 TimLuong