Skip to content

Native Windows installer (install.ps1) does not add installation directory to PATH #21365

Description

@edwinpope

Preflight Checklist

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

What's Wrong?

The native PowerShell installer (irm https://claude.ai/install.ps1 | iex) completes successfully and displays "Installation complete!" but does not add the installation directory to the user's PATH environment variable. The claude command fails immediately after installation with "CommandNotFoundException". The installer itself identifies this problem in a yellow "Setup notes" warning but leaves it to the user to fix manually.

What Should Happen?

The installer should automatically add C:\Users<username>.local\bin to the user's PATH environment variable, or at minimum update the current session's PATH so claude is immediately usable after installation without manual intervention.

Error Messages/Logs

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
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (claude:String) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException



Installer output showed:
!! Setup notes:
  • Native installation exists but C:\Users\da-edwin.RENLIB\.local\bin is not in your PATH. Add it by opening: System Properties → Environment Variables → Edit User PATH → New → Add the path above. Then restart your terminal.

Steps to Reproduce

Open PowerShell (Administrator or regular user)
Run: irm https://claude.ai/install.ps1 | iex
Wait for installation to complete (shows "Installation complete!")
Run: claude
Observe CommandNotFoundException error

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown - previous winget installation was functional

Claude Code Version

2.1.20

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

This is a domain-joined Windows machine
Previous attempt using winget install Anthropic.ClaudeCode had the same PATH issue
The workaround is to manually add the path:

powershell [Environment]::SetEnvironmentVariable("PATH", "$([Environment]::GetEnvironmentVariable('PATH', 'User'));C:\Users\da-edwin.RENLIB.local\bin", "User")
Then restart the terminal.

The installer detecting the problem but not automatically fixing it creates a poor user experience, especially for users who may not be comfortable editing environment variables manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions