Lesson: Claude CLI PATH Issues on Windows PowerShell

Date: 2026-05-01 Context: Attempting to run claude from PowerShell after installing OBSIDIAN Status: ⚠️ UNRESOLVED — handed to new chat session for fix


What Happened

Claude Code 2.1.119 was confirmed installed via claude --version from Desktop Commander’s PowerShell process, but Damien’s open PowerShell terminal returned “command not found” / “‘claude.exe’ is not recognized”.


Debugging Steps Taken

StepFinding
where.exe claudeFound at C:\Users\DamienGoBeyond\AppData\Roaming\npm\claude.cmd and C:\Users\DamienGoBeyond\.local\bin\claude.cmd
Check PATHBoth npm and .local\bin were in system PATH
Full path call& 'C:\Users\DamienGoBeyond\AppData\Roaming\npm\claude.cmd' --version returned 2.1.119 correctly
Root cause (phase 1)Terminal was opened before PATH was set — stale session
Fix attemptWrote PowerShell profile to add npm to PATH on load
New problemProfile stored in Cloudflare R2 — treated as remote/unsigned by PowerShell
FixSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
Unblock-File on profileRun — confirmed IsBlocked = False
Profile loaded (. $PROFILE)Succeeded — no error
claude --version after profileStill failed: “The system cannot find the path specified. ‘claude.exe’ is not recognized”
Likely root causeclaude.cmd invokes claude.exe via a path that doesn’t exist, or the cmd/bat context inside .cmd files doesn’t inherit the same PATH as PowerShell

What We Know

  • The .cmd file exists and is reachable
  • Running it with a full path works from Desktop Commander’s shell but not from the user’s PowerShell
  • The error message references claude.exe — the .cmd wrapper likely calls an .exe via a relative or baked-in path
  • The npm global install may have placed binaries expecting a different Node/npm layout

Suspected Fix Directions (for next session)

  1. Check what’s inside claude.cmd — does it reference a path that doesn’t exist?
  2. Check if claude.exe actually exists anywhere on the system
  3. Try npx @anthropic-ai/claude-code as an alternative invocation
  4. Reinstall Claude Code: npm install -g @anthropic-ai/claude-code
  5. Check Node.js version compatibility

See Also