Mission SEO
Get Your Free SEO Strategy
Windows PowerShell showing claude : The term 'claude' is not recognized as the name of a cmdlet, function, script file, or operable program, and after the fix, in a new window, claude --version returning 2.1.304 (Claude Code) from %USERPROFILE%\.local\bin on the PATH

'claude' is not recognized as the name of a cmdlet? Fix it

By Momin Malik · 10 min read

Published · Updated

"'claude' is not recognized as the name of a cmdlet, function, script file, or operable program" is PowerShell telling you it can't find the Claude Code program. Install Claude Code with Anthropic's Windows installer, add %USERPROFILE%\.local\bin to your user PATH if the installer says it's missing, then close PowerShell and open a new window. If you only use the Claude desktop app, that's the cause: the app never puts a claude command in your terminal.

This is the exact error we got in October 2026 while connecting Claude to a client's WordPress site. The setup steps said to run claude mcp add in a terminal. We'd used Claude Code inside the Claude desktop app for weeks, so we assumed the command existed. PowerShell disagreed:

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.Windows PowerShell, October 2026

The desktop app had Claude Code, just not anywhere PowerShell looks. That's one of several causes, and the table below matches each message to its fix.

What "'claude' is not recognized as the name of a cmdlet" means

When you type a command, Windows searches a list of folders called PATH. Anthropic's native installer puts Claude Code at %USERPROFILE%\.local\bin\claude.exe and doesn't add that folder to PATH. So the error means one of two things: the program isn't there, or Windows isn't looking where it is. Command Prompt reports the same problem as "'claude' is not recognized as an internal or external command, operable program or batch file."

Example of the folders on a Windows PATH, searched in order: C:\Windows\system32, C:\Windows, C:\Windows\System32\WindowsPowerShell\v1.0\ and C:\Users\you\AppData\Local\Microsoft\WindowsApps hold no claude.exe. With C:\Users\you\.local\bin added, where claude.exe lives, PowerShell finds it in a new window.
PowerShell only runs claude if a folder on your PATH holds claude.exe.

What you see

What it means

Fix

PowerShell: The term 'claude' is not recognized as the name of a cmdlet

Claude Code isn't installed, or its folder isn't on PATH

Install it, then fix PATH

Command Prompt: 'claude' is not recognized as an internal or external command

The same, in a different shell

Install it, then fix PATH

You only use the Claude desktop app or the VS Code extension

Both run a private copy of Claude Code and don't add a command

Install the CLI or skip it

The installer printed "Native installation exists but … is not in your PATH."

The install worked; PATH didn't change

Fix PATH

It works in one window but not another

That window, or the editor it runs in, opened before PATH changed

Open a new window

"Not recognized" right after Claude Code updated

The update set claude.exe aside as a backup and didn't finish

Rename the backup

Typing claude opens the Claude desktop app

An older desktop app registered its own Claude.exe ahead of the CLI

Update the desktop app

Mac or Linux: zsh: command not found: claude

The same problem on another system

Mac and Linux fix

Install Claude Code on Windows

Anthropic recommends its native installer, which updates itself and doesn't need Node.js. You need Windows 10 version 1809 or later, and no administrator rights. In PowerShell:

irm https://claude.ai/install.ps1 | iex

In Command Prompt:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Use PowerShell or Command Prompt, not Git Bash: the Mac and Linux installer stops there with "Windows is not supported by this script." Then read the end of the output. If it shows Setup notes saying the installation "is not in your PATH", do the next step; if not, skip to checking it works.

WinGet (winget install Anthropic.ClaudeCode) works too but doesn't update automatically. The npm package still installs, but Anthropic's README says installation via npm is deprecated.

Add the folder to your PATH

First check the program is there, because adding a folder to PATH won't help if the install failed. In PowerShell:

Test-Path "$env:USERPROFILE\.local\bin\claude.exe"

False means there's nothing to find, so install it first. True means the install worked and only PATH needs fixing. These two lines, from Anthropic's troubleshooting page, add the folder to your user PATH without touching the system-wide one:

$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

Close PowerShell and open it again afterwards. In Command Prompt, use the Windows settings instead: search the Start menu for "environment variables", open Edit environment variables for your account, select Path under your user variables, click Edit, then New, and enter %USERPROFILE%\.local\bin. Click OK in each window.

Illustration of the Windows Edit environment variable dialog for your account's Path, listing %USERPROFILE%\AppData\Local\Microsoft\WindowsApps and a new entry, %USERPROFILE%\.local\bin, with New, Edit, Browse, Delete, Move Up and Move Down buttons and OK and Cancel.
Illustration: add %USERPROFILE%\.local\bin with New, then click OK in each window.

Open a new window and check it works

A window keeps the PATH it started with, and a terminal inside VS Code or another editor takes its PATH from the editor. Open a new window, or quit and reopen the editor, then run claude --version. A version number means it worked.

To see which copy runs, use where.exe claude. If more than one shows up, such as an old npm install next to the native one, keep one and remove the others. For a full check, claude doctor prints read-only diagnostics; if claude still isn't found, run it by its full path: & "$env:USERPROFILE\.local\bin\claude.exe" doctor.

Fix two Windows-only problems

"Not recognized" right after an update

To update itself, Claude Code renames claude.exe to a backup, then moves the new version into place. If that move fails, the folder can be left with only the backup, a file whose name starts with claude.exe.old.. This line from Anthropic's docs renames the newest backup back:

Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe

If there's no backup file, run the installer again.

Typing claude opens the desktop app

Older versions of Claude Desktop registered a Claude.exe in Windows' WindowsApps folder, which takes priority over the CLI. Update Claude Desktop to fix it.

Use the Claude desktop app? You may not need the command

The desktop app's Code tab runs its own copy of Claude Code, with its own version number, and updates it separately from any claude command you install. Anthropic's quickstart says to install the CLI separately if you want claude in a terminal. On our Windows machine, the app kept two versions in numbered folders inside its data folder, and where.exe claude found neither.

Comparison of two copies of Claude Code. The Claude desktop app's Code tab runs its own copy, kept in the app's data folder and updated by the app; it isn't on your PATH, so PowerShell can't see it. The Claude Code CLI from Anthropic's installer lives at %USERPROFILE%\.local\bin\claude.exe, updates itself and is on your PATH, so claude mcp add works in any terminal. Updating one doesn't update the other.
The desktop app's copy of Claude Code never adds a claude command to your terminal.

If you only need the command to add an MCP server, which is what setup guides usually want claude mcp add for, there are two ways around it:

  1. Add it as a connector. In a Code session, click + next to the prompt box and choose Add connectors. Connectors are MCP servers with a setup screen.

  2. Write it into a settings file. For servers that aren't in the directory, Anthropic's docs point desktop users to the same settings files the CLI uses. Create .mcp.json in your project folder in this format, start a new session and approve the server when asked.

{
  "mcpServers": {
    "wordpress": {
      "type": "http",
      "url": "https://example.com/wp-json/mcp/mcp-adapter-default-server",
      "headers": {
        "Authorization": "Basic BASE64_OF_USERNAME_AND_APPLICATION_PASSWORD"
      }
    }
  }
}

That example connects a WordPress site in the format Automattic's documentation gives for Claude Code; our WordPress MCP guide shows how to make the base64 line. Keep passwords out of files you share, because .mcp.json is meant to travel with a project. For a server only you use, the same entry can go in the top-level mcpServers section of C:\Users\you\.claude.json, where the CLI's user scope saves servers. That's where we put ours. Back up the file first.

If you installed Claude Code with npm

Older guides use npm install -g @anthropic-ai/claude-code. It still works on Node.js 22 or later, but it puts claude in npm's own folder, so it only works if that folder is on your PATH. To switch, run npm uninstall -g @anthropic-ai/claude-code, then the installer above.

If PowerShell refuses to run claude because running scripts is disabled, that's npm's wrapper script being blocked. Anthropic's fix is Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, or typing claude.cmd instead of claude.

Seeing "claude: command not found" on a Mac instead?

It's the same problem. On a Mac the installer puts Claude Code at ~/.local/bin/claude, and zsh reports zsh: command not found: claude when that folder isn't on PATH. Install with curl -fsSL https://claude.ai/install.sh | bash (without sudo, which the script refuses), then add the folder for zsh, the default shell:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

On bash, use ~/.bashrc on Linux or ~/.bash_profile on a Mac instead (Anthropic's instructions).

Next steps

If you're setting Claude up to make site-wide SEO changes and would rather hand the work off, Mission SEO's technical SEO team makes most fixes inside your stack for you.

Frequently asked questions

How do I add Claude Code to my PATH on Windows?

In PowerShell, run the two [Environment]::SetEnvironmentVariable lines above to add %USERPROFILE%\.local\bin to your user PATH, then close and reopen PowerShell. In Command Prompt, add the same folder to Path under Edit environment variables for your account. Run claude --version in a new window; a version number means it worked.

Why does claude work in one window but not another?

Each window reads PATH when it opens, so a PowerShell or Command Prompt window that was open before you changed PATH keeps the old list. Terminals inside editors such as VS Code take their PATH from the editor, so restart the whole editor rather than just the terminal panel.

Do I need Node.js to install Claude Code?

Not for the native installer, which Anthropic recommends and which runs without Node.js. You need Node.js 22 or later only for the npm package. Some MCP servers still need Node.js because they start with npx, so install it if a setup guide's command begins with npx.

Does the Claude desktop app include Claude Code?

Yes. The desktop app's Code tab runs its own copy of Claude Code, which the app downloads and keeps updated. It doesn't add a claude command to PowerShell or Command Prompt, so commands such as claude mcp add need a separate install of the CLI. Updating one copy doesn't update the other.

Sources

We checked every source below on October 20, 2026, against Claude Code 2.1.304 and Anthropic's current documentation. Claude Code updates often, so if a message on your screen differs, Anthropic's troubleshooting page has the latest wording.

  1. Set up Claude Code, Claude Code docs

  2. Troubleshoot installation: verify your PATH, Claude Code docs

  3. Troubleshoot installation, Claude Code docs

  4. Claude Code desktop app, Claude Code docs

  5. Desktop app quickstart, Claude Code docs

  6. Connect to MCP servers, Claude Code docs

  7. CLI reference, Claude Code docs

  8. anthropics/claude-code README, GitHub

  9. mcp-wordpress-remote README, Automattic, GitHub


Momin Malik

CEO & Founder · 11 articles

Momin Malik is the CEO and founder of Mission SEO, a B2B SEO and AEO agency.

More in Blog

See all →

Work with Mission SEO

Rank #1 on Google and in AI answers

We’re a B2B SEO and AEO agency. Book a free 30-minute call with a senior consultant: we look at your site before we talk, so you leave knowing what to fix first.

Get Your Free SEO Strategy

Book your free audit

30 minutes with a senior consultant, not a sales rep.

  1. Your details
  2. Pick a time