[BUG] Installing native binary via PowerShell script installs 0KB claude.exe

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 9 comments · opened Oct 9, 2025 · closed Oct 10, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

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?

Claude updated itself to 2.0.12 then 2.0.13 and now when I try to run "claude" I get :

Program 'claude.exe' failed to run: The specified executable is not a valid application for this OS platform.At line:1 char:1
+ claude
+ ~~~~~~.
At line:1 char:1
+ claude
+ ~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : NativeCommandFailed

Looking in the install directory ([UserProfile]\.local\bin there is a claude.exe file that is 0KB in size

I tried installing directly from provided powershell script and get the same result

What Should Happen?

Claude should install correctly and be accessible via "claude" command without error

Error Messages/Logs

Steps to Reproduce

  1. Run irm https://claude.ai/install.ps1 | iex in PowerShell
  2. Run claude
  3. Fails

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.11

Claude Code Version

2.0.13

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

9 Comments

ant-kurt collaborator · 10 months ago

Can you check the contents of %USERPROFILE%\.local\share\claude\versions and see what files are in there?

You may need to delete %USERPROFILE%\.local\share\claude\ and %USERPROFILE%\.local\bin\claude, then re-run the installation script.

GSonofNun · 10 months ago

%USERPROFILE%\.local\share\claude\versions had 2.0.12 and 2.0.13.

  • .12 -> 130,967 KB
  • .13 -> 0 KB

I tried deleting .13 and installing again, but it just added another 0 KB .13 file.

I just tried deleting %USERPROFILE%\.local\share\claude\ and %USERPROFILE%\.local\bin\claude and re-running the installation script and it has the same results.

  • %USERPROFILE%\.local\bin\claude\claude.exe -> 0 KB
  • %USERPROFILE%\.local\share\claude\2.0.13 -> 0 KB

I even tried restarting my PC to see if something needed to be cleared/released.

My co-worker was able to successfully update to 2.0.13, so I'm able to work around this for now by using his .exe.

oasis1701 · 10 months ago

same exact issue. can't run claude code on powershell anymore

GSonofNun · 10 months ago
same exact issue. can't run claude code anymore

Good to know it's not just me 😂
But sorry you're having the same issue.

ElliotDrel · 10 months ago

I'm having the same issue.

BlindGuyNW · 10 months ago

This also repros for me.

moutayam · 10 months ago

Hey everyone!
After some debugging adventures, I found what's causing the 0-byte issue and how to fix it!

The Fix:

# Download the install script 
Invoke-WebRequest -Uri "https://claude.ai/install.ps1" -OutFile "install-fixed.ps1"
# Open it in notepad 
notepad install-fixed.ps1 
# Find these lines (line 73, 76 respectively): 
# & $binaryPath install $Target  
# & $binaryPath install
# 
# Add --force to both: 
# & $binaryPath install --force $Target 
# & $binaryPath install --force 
# Save and run 
.\install-fixed.ps1

Fair warning: The installer will weirdly download itself _twice_ (once to %USERPROFILE%\.claude\downloads\, then again to %USERPROFILE%\.cache\claude\staging\2.0.13\)

While adding --force to the PowerShell script resolves the immediate user-facing issue, this appears to be masking an underlying bug in the claude.exe install command itself.

Root Cause Analysis: I think that the installer's update logic attempts to replace the running executable when an existing installation is detected, which fails on Windows due to file handle restrictions. This results in:

  • New file created but never populated: claude.exe (0 bytes)
  • Installation reports success despite the corruption

Request for Access to Build Scripts:
To properly diagnose and fix the root cause rather than applying workarounds, it would be helpful to review:

  1. The installer build pipeline - Where is install.ps1 generated/hosted? (It's served from claude.ai/install.ps1 but doesn't appear in the main repository)
  2. The native installer source code - The logic in claude.exe install that handles updates and self-replacement
  3. The update mechanism - Why does it download to both %USERPROFILE%\.claude\downloads\ and %USERPROFILE%\.cache\claude\staging\{version}\?

Access to these would enable the community (or internal team) to:

  • Fix the self-replacement logic to work correctly on Windows
  • Optimize the double-download behavior
  • Implement proper update mechanisms that don't rely on replacing running executables

Happy to help debug further if given access to the relevant codebases.

ant-kurt collaborator · 10 months ago

This is broken for Windows single-file executable versions 2.0.12-2.0.13, and will be fixed in the next release.

As a workaround, you can add --force to the install script as mentioned above (& $binaryPath install --force)

github-actions[bot] · 10 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.