DEV Community

Cover image for Claude Code Stopped Working on Windows? Here's the Quick Fix
Yuto Takashi
Yuto Takashi

Posted on

Claude Code Stopped Working on Windows? Here's the Quick Fix

Why You Should Care

If you're using Claude Code on Windows and suddenly got this error this morning:

claude: The term 'claude' is not recognized...
Enter fullscreen mode Exit fullscreen mode

Don't panic. It's not your fault. Claude Code auto-migrated to a new installation method, and you just need to add one PATH.

Time to fix: 2 minutes.

What Happened?

Claude Code automatically migrated from npm-based installation to native installation. The executable moved to a new location that's not in your PATH.

Before: C:\Users\[username]\AppData\Roaming\npm\

After: C:\Users\[username]\.local\bin\

The Quick Fix

Open PowerShell and run:

[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Users\[username]\.local\bin", "User")
Enter fullscreen mode Exit fullscreen mode

Replace [username] with your actual Windows username.

Restart PowerShell. Done.

Verify It Works

claude --version
Enter fullscreen mode Exit fullscreen mode

If you see the version number, you're good to go.

Need It Working Right Now?

If you can't restart PowerShell yet, use the full path:

C:\Users\[username]\.local\bin\claude.exe
Enter fullscreen mode Exit fullscreen mode

Or add it to PATH for the current session only:

$env:Path += ";C:\Users\[username]\.local\bin"
claude
Enter fullscreen mode Exit fullscreen mode

GUI Method (If You Prefer)

  1. Press Win + R
  2. Type sysdm.cpl and hit Enter
  3. Go to "Advanced" tab → "Environment Variables"
  4. Select "Path" under User variables → "Edit"
  5. Click "New"
  6. Add C:\Users\[username]\.local\bin
  7. Click OK on everything
  8. Restart PowerShell

Why Did This Happen?

According to the official docs:

"Some users may be automatically migrated to an improved installation method."

The native installation has benefits:

  • No Node.js dependency
  • More stable auto-updates
  • Single executable file

Makes sense technically, but the surprise migration on a Monday morning? Not ideal.

A Note on Tool Updates

Here's the thing about auto-updates: they're great until they're not.

As a user, I don't check release notes for every tool I use daily. That's just reality. We only notice changes when something breaks.

The good news? The error message actually tells you what to do. I just needed to slow down and read it carefully.

Troubleshooting

Still not working?

Check if the path is correct:

where.exe claude.exe
Enter fullscreen mode Exit fullscreen mode

Want to verify PATH was added?

$env:Path -split ';' | Select-String "\.local\\bin"
Enter fullscreen mode Exit fullscreen mode

Last resort - reinstall:

irm https://claude.ai/install.ps1 | iex
Enter fullscreen mode Exit fullscreen mode

Takeaway

If Claude Code suddenly stops working on Windows:

  1. It probably auto-migrated to native installation
  2. Add C:\Users\[username]\.local\bin to PATH
  3. Restart PowerShell

Two minutes to fix, but 30 minutes to figure out why it happened in the first place.

Hope this saves you some time.


More thoughts on technical decision-making processes at:
https://tielec.blog/

Top comments (0)