[BUG] Windows Installation Script Does Not Add PATH Environment Variable

Resolved 💬 3 comments Opened Nov 10, 2025 by chrism544 Closed Nov 14, 2025

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?

The Windows installation script (irm https://claude.ai/install.ps1 | iex) successfully installs Claude Code to C:\Users\[username]\.local\bin but does not add this directory to the Windows PATH environment variable. This causes the claude command to be unrecognized in new terminal sessions, even though the installation reports success.

The installer detects the missing PATH (shows truncated warning) but doesn't fix it automatically, requiring users to manually configure their PATH before they can use Claude Code globally.

What Should Happen?

After running the installation script, the C:\Users\[username]\.local\bin directory should be automatically added to the user's PATH environment variable. When opening a new terminal session, the claude command should be mmediately available and recognized without any manual configuration required.

Error Messages/Logs

1. Initial error when trying to run `claude` after installation:

PS C:\scripts> claude
claude: The term 'claude' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

2. Output from running `claude.exe install stable`:

Claude Code successfully installed!
Version: 2.0.36
Location: C:\Users\%username%\.local\bin\claude.exe

Next: Run claude --help to get started
• Native installation exists but C:\Users\%username%\.local\bin is not in

[Note: The warning message appears to be truncated and doesn't complete the sentence or provide instructions on how to fix the PATH issue]

3. Verification that PATH is missing the installation directory:

PS> [Environment]::GetEnvironmentVariable('Path', 'User' C:\Users\%username%\AppData\Local\Microsoft\WindowsApps;
C:\Users\%username%\AppData\Roaming\npm

[The .local\bin directory is not present in the PATH]

This shows both the symptom (command not found) and the installer's incomplete warning about the issue.

Steps to Reproduce

  1. Open PowerShell as a regular user (not administrator)
  1. Run the Claude Code installation command:

irm https://claude.ai/install.ps1 | iex

  1. Wait for the installation to complete successfully
  1. Close the PowerShell window completely
  1. Open a new PowerShell window
  1. Try to run the claude command:

claude --version

  1. Observe that PowerShell reports the command is not recognized
  1. Verify the installation exists:

Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
(Returns: True - the file exists)

  1. Check if the installation directory is in PATH:

[Environment]::GetEnvironmentVariable('Path', 'User') -split ';' |
Where-Object { $_ -like "\.local\bin" }
(Returns: Nothing - the directory is not in PATH)

  1. Run the direct executable with install command:

& "$env:USERPROFILE\.local\bin\claude.exe" install stable

  1. Observe the truncated warning message that indicates PATH is not configured

but provides no clear instructions on how to fix it

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.0.36

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

System Information:

  • Claude Code Version: 2.0.36
  • OS: Windows 10 Build 26200
  • PowerShell Version: 5.1
  • Installation Path: C:\Users\chris.malbon\.local\bin\claude.exe

Analysis:
The bootstrap script (https://storage.googleapis.com/.../bootstrap.ps1) delegates PATH configuration to the native binary by running & $binaryPath install $Target. However, the claude.exe install command only detects and warns about the missing PATH but doesn't actually modify the Windows environment variables.

This may be due to:

  • Lack of permissions to modify user environment variables
  • Missing implementation for Windows PATH modification
  • Intentional design requiring manual setup

Workaround:
Users must manually add the directory to PATH after installation:

```powershell [Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + ';' + (Join-Path $env:USERPROFILE '.local\bin'), 'User')

Then restart the terminal.

Impact:
This creates a poor first-run experience on Windows. The installation appears successful, but the claude command doesn't work, causing confusion. Other package managers (npm, pip, cargo) successfully add their bin directories to PATH during installation on Windows.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗