[BUG] Claude Installer suggests `setx PATH` which destroys the PATH

Resolved 💬 3 comments Opened Sep 5, 2025 by JayBazuzi Closed Sep 8, 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 Claude Code installer suggests running a command that will corrupt the user's PATH environment variable.

This is broken in two ways:

PowerShell

If you run this command in PowerShell, it destroys the users PATH.

In PowerShell, %PATH% has no special meaning, so the above setx command overwrites the user's Path with the literal text %PATH%, destroying the user's setup.

<img width="754" height="828" alt="Image" src="https://github.com/user-attachments/assets/29b9a4a8-ff7c-4b24-a3bc-9b8f94a504c4" />

This is confusing to diagnose because if you open a new prompt and examine the value of PATH at the command line, the %PATH% value will have been expanded to its current value - you won't see the literal %PATH% string any more:

> $env:PATH
C:\Program Files\Parallels\Parallels Tools\Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Parallels\Parallels Tools\Applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jaybazuzi\.local\bin

CMD

If you run this command in CMD, it makes a mess of the user's PATH.

In CMD %PATH% expands to the current value of PATH. This includes both system and user PATH values, and expands all variables used in PATH. This isn't quite as harmful as the PowerShell case, but it's still broken.

Before

<img width="994" height="828" alt="Image" src="https://github.com/user-attachments/assets/33662057-ee78-4b56-89f0-fbc118520921" />

After

<img width="754" height="828" alt="Image" src="https://github.com/user-attachments/assets/55cd6c30-e2a6-414d-b7c0-0d710c603b8e" />

What Should Happen?

Don't suggest using setx

Error Messages/Logs

Steps to Reproduce

  1. Run irm https://claude.ai/install.ps1 | iex in a Windows PowerShell prompt. It suggest using setx to update `PATH.
  2. Run the suggested setx command, setx PATH "%PATH%;C:\Users\jaybazuzi\.local\bin"

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.108 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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