Fixing "claude is not recognized" After Installing Claude Code on Windows with irm
Hello!
Sometimes, even after installing Claude Code with the official PowerShell installer (irm https://claude.ai/install.ps1 | iex), running claude --version gets you scolded with "The term 'claude' is not recognized as a name of a cmdlet..."
This is a known bug reported on Anthropic's official GitHub: the installer forgets to add the PATH entry. We hit this ourselves during an actual install, so here is the shortest path to a fix.
Environment
- Windows 11
- PowerShell 7.x (the code works the same on PowerShell 5.1 / Windows PowerShell)
- An Anthropic account (Pro / Max / Team / Enterprise)
Prerequisite: Install Git for Windows
When Claude Code runs natively on Windows, it uses Git Bash internally. Without it you will run into problems after installation, so check for it first
git --version
If that returns an error, install it with winget
winget install Git.Git --source winget
After installing, be sure to close and reopen PowerShell.git will then be on your PATH.
Step 1: Install Claude Code with the Official Installer
Run the following in PowerShell (no administrator rights needed)
irm https://claude.ai/install.ps1 | iex
On success you will see a message like this
Setting up Claude Code...
✓ Claude Code successfully installed!
Version: 2.x.x
Location: C:\Users\<username>\.local\bin\claude.exe
Next: Run claude --help to get started
At this point you will be tempted to run claude --help, but it probably won't work.
Step 2: Confirm the Error
claude --version
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.
If you see this error, the cause is almost certainly a missing PATH entry.
Step 3: Verify That claude.exe Exists
Just to be safe, confirm that it really was installed
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
True coming back means the file exists. All that's left is to put it on the PATH.
Step 4: Add It to PATH
Permanently add ~\.local\bin to the user PATH environment variable
[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$env:USERPROFILE\.local\bin", [EnvironmentVariableTarget]::User)
This command takes effect in future sessions, so if you also want it in the current session, run the following as well
$env:PATH = "$env:PATH;$env:USERPROFILE\.local\bin"
Step 5: Verify It Works
claude --version
If a version number appears, you're done.
If it still fails, close the PowerShell window completely and reopen it. Closing just a tab sometimes doesn't pick up the change. If that still doesn't work, restart Windows.
Step 6: First Launch and Authentication
claude
A browser opens and takes you into the OAuth flow. Sign in with your Anthropic account (Pro / Max, etc.) and a token is saved to ~\.claude\session.json, so you won't need to log in again.
Troubleshooting
Get-Command to locate the actual binary
To check which claude.exe PowerShell is resolving, run
Get-Command claude | Format-List
To check whether it is installed in more than one place, run
Get-Command claude -All
The winget Version and the Official Installer Coexisting
winget install Anthropic.ClaudeCode and irm — if you have tried both, there are cases where both are installed and the older one takes precedence. This is also a bug filed on the official GitHub.
Remove the one you don't need
# To remove the winget version
winget uninstall Anthropic.ClaudeCode
Self-Diagnosis Command
When in doubt, run this — it detects installation state, version, authentication, Git, and PATH problems all at once
claude doctor
Why This Happens
irm https://claude.ai/install.ps1 | iex places claude.exe in C:\Users\<username>\.local\bin\, but the step that adds this folder to PATH is not included in the current installer. The installer itself is aware of this — it shows a yellow "Setup notes" warning — but it does not fix it automatically, so for now the user has to handle it manually.
An issue has been filed with Anthropic, so it should be fixed eventually, but until then the manual workaround is required.
Summary: The Shortest Command Set
For when you get stuck, here is the whole flow in one place
# 1. Install
irm https://claude.ai/install.ps1 | iex
# 2. Verify the binary exists
Test-Path "$env:USERPROFILE\.local\bin\claude.exe"
# 3. Add to PATH (persistent)
[Environment]::SetEnvironmentVariable("PATH", "$env:PATH;$env:USERPROFILE\.local\bin", [EnvironmentVariableTarget]::User)
# 4. Add to PATH (current session)
$env:PATH = "$env:PATH;$env:USERPROFILE\.local\bin"
# 5. Verify
claude --version
If that doesn't do it, close and reopen PowerShell; failing that, restart Windows. That gets you through in almost every case.
You lost time to environment setup — make up for it with what comes next.
Once Claude Code is running, the next phase is mastering it. There is no established playbook yet for agent-first development. We push Claude Code hard in our own product work, and have systematized what works and where the pitfalls are.
Our engineers, with decades on the front lines of software engineering, have taken this on in earnest — and we pass that battle-tested knowledge on to you.
Explore our Claude Code enablement services →