OmniscioGuidescommand not found: claude
"command not found: claude" after installing Claude Code
The install finished and the command does not run. Your shell looks for a program in a list of folders called PATH, and the folder the installer used is not on that list. This page covers the Windows wording as well, the check and the fix for each shell, how the answer changes with the way Claude Code was installed, and the cases that look like this error but are something else. Everything comes from Anthropic's own installation and terminal documentation, read on the date in the Sources section, and the one terminal capture was run on an isolated cloud test machine.
Last tested on Claude Code 2.1.310, October 24, 2026. By the Omniscio team. Updated .
Find your case
The message changes with the shell you are in and the operating system, and the fix changes with the way Claude Code was installed. Start with the meaning, then take the section that matches what you see.
- What the error means, and the line the installer prints
- Check your PATH, then add the folder
- Which install method you used, and why it decides the fix
- permission denied when adding to your PATH
- A second claude, or one you cannot see
- When it is not a PATH problem
- What does not help
- Several sessions on one machine
How this page was checked
Anthropic documents this error in three places, and all three were downloaded in their Markdown form on October 24, 2026: the install and login troubleshooting page, which carries it in its own table of symptoms and then a section of its own; the terminal guide, which answers it under a heading for each operating system; and the setup page, which gives the install command for each platform and the alternative methods. Every message and command block on this page was found word for word in one of the three, and the Sources section names which.
The one terminal capture was run on an isolated cloud test machine running Claude Code 2.1.310 on Linux x64, on October 24, 2026, and its output is quoted verbatim. Every other command block on this page is Anthropic's own, shown as that page prints it; those carry no output here, because what each is for is the command rather than what this machine happened to answer.
One thing this page cannot give you is a machine that is genuinely missing the install; whether yours is one is what the checks in the next section are for.
What the error means, and the line the installer prints
Anthropic's troubleshooting page gives the same error four official spellings, one per platform:
zsh: command not found: claudebash: claude: command not found'claude' is not recognized as an internal or external commandclaude : The term 'claude' is not recognized as the name of a cmdletWhat it means. The install finished and the folder it put the program in is not on your PATH. PATH is the list of folders your shell searches when you type a command name, and the installer places claude at ~/.local/bin/claude on macOS and Linux or %USERPROFILE%\.local\bin\claude.exe on Windows. The installer does not edit PATH itself, so on a machine whose shell never had that folder the program is present and unreachable at the same time.
The installer says so itself
Its page notes that the installer detects this case and reports it under Setup notes: at the end of its output. The line names the folder and the platform:
Native installation exists but ~/.local/bin is not in your PATH.Native installation exists but C:\Users\you\.local\bin is not in your PATH.The installer prints the fix beside that note. It does not apply it, which is the whole reason this error exists as a separate problem from a failed install. If you still have the terminal window you installed from and it is still scrollable, that note is the shortest path on this page: run the command it printed, then open a new terminal.
How to fix it
- Check the program is on the machine at all. On macOS and Linux run
ls -la ~/.local/bin/claude; in PowerShell runTest-Path "$env:USERPROFILE\.local\bin\claude.exe". A listing, orTrue, means only PATH needs fixing. - Add the install folder to your shell's PATH. This is treated as a permanent change, so you apply it once. The commands for each shell are in the next section.
- Open a new terminal window and run
claude --version. A working install prints a version number such as2.1.211 (Claude Code). - If it still is not found, work through the three causes at the end of that same section before you reinstall anything.
Check your PATH, then add the folder
The order the page sets out is the one that saves time: first ask whether the program is there, then ask whether its folder is on PATH, and only then change anything. The PATH change is permanent, so it is worth being sure it is the right one.
macOS and Linux
Check the program first:
$ ls -la ~/.local/bin/claudeThen list your PATH entries and filter them for the install folder:
$ echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"If that prints /home/you/.local/bin or /Users/you/.local/bin, the folder is already on your PATH and you can move on to a second claude. If it prints nothing, add the folder with the two commands for your shell. The first saves the setting for every new terminal and prints nothing when it succeeds; the second applies it to the window you are in.
For Zsh, the default on macOS:
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
$ source ~/.zshrcFor Bash on Linux, where it is the default on most distributions:
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
$ source ~/.bashrcFor Bash on macOS the file is different, and Anthropic explains why: Terminal on macOS starts Bash as a login shell, which ignores ~/.bashrc and reads only the first of ~/.bash_profile, ~/.bash_login or ~/.profile that exists. If you already have one of the last two and no ~/.bash_profile, put the line in the file you have rather than creating a new one:
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile
$ source ~/.bash_profileFor other shells such as fish or Nushell, Anthropic's instruction is to add ~/.local/bin using that shell's own configuration syntax and restart the terminal. Verify with claude --version.
Windows PowerShell
Check the program with Test-Path "$env:USERPROFILE\.local\bin\claude.exe", then filter your PATH for the folder:
$env:PATH -split ';' | Select-String '\.local\\bin'If that prints C:\Users\you\.local\bin, the folder is on your PATH. If there is no output, add it to your User PATH with the two lines Anthropic gives:
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')Restart your terminal, then run claude --version.
Windows CMD
Check the program with dir "%USERPROFILE%\.local\bin\claude.exe", then filter your PATH:
echo %PATH% | findstr /i "local\bin"With no output, open System Settings, go to Environment Variables, and add %USERPROFILE%\.local\bin to your User PATH variable, then restart the terminal. There is no command-line equivalent for CMD here; the environment-variable dialog is the route it sets out.
If it still is not found
The page names three causes, and all three look the same from the prompt. A terminal window that was already open keeps the PATH it had when it opened, and a terminal inside an editor takes its PATH from the editor, so the fix has to be met with a new window or a reopened editor. The line may not have saved: grep -n '.local/bin' ~/.zshrc, using your own shell's file name, prints the line and its line number when it is there, and nothing when it is not. Or the line went into another shell's configuration file, which echo $0 will identify so you can repeat the two commands for the right shell. On Windows the equivalent check is [Environment]::GetEnvironmentVariable('PATH', 'User'), where you look for .local\bin in what it prints.
Reproduced
$ env -i PATH=/usr/bin:/bin bash -c 'claude --version'
bash: line 1: claude: command not foundThat is Claude Code installed and working on this machine, run with a PATH that leaves out the folder it lives in. Each shell phrases an unknown command its own way, which is why the four lines at the top of this page differ between Zsh, Bash, CMD and PowerShell. The command uses bash -c and a stripped environment rather than a login shell: a login shell re-reads the profile, which on many machines puts the install folder back and hides the thing this is showing you. Claude Code 2.1.310 on Linux x64, October 24, 2026.
Which install method you used, and why it decides the fix
The PATH fix above is the one for Anthropic's own installer, the method the setup page recommends. The other methods put claude somewhere else and are usually already on your PATH, so the same error from one of those means something different. Anthropic documents which locations a claude binary can come from, and this is how to tell them apart.
Native installation
This is the recommended method, installed with curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux and WSL, irm https://claude.ai/install.ps1 | iex in Windows PowerShell, or curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd in CMD. It is the method that produces the Setup notes: line and the location every check on this page is written for, and native installations update themselves in the background.
npm
An npm global install is a method of its own, and it gets a line of its own in the checks: the npm global list is one of the three locations a claude binary can come from. If the PATH check above found nothing, a second claude is the section that lists every claude on your PATH and reads that list. One npm failure is different enough to have its own name, and it is in when it is not a PATH problem. To upgrade an npm install, Anthropic's setup page gives npm install -g @anthropic-ai/claude-code@latest and warns against sudo npm install -g.
Homebrew, WinGet, and the Linux package managers
Homebrew installs with brew install --cask claude-code, WinGet with winget install Anthropic.ClaudeCode, and on Debian, Fedora, RHEL and Alpine there are apt, dnf and apk packages. None of these update themselves by default, and Anthropic's PATH check names the folder the native installer uses rather than theirs, so a machine installed this way may find nothing at that path. After a Homebrew or WinGet install, the next step Anthropic gives is claude --version, and if the shell reports it is not found, a new terminal window, because a window that was already open does not pick the change up.
Homebrew offers two casks: claude-code tracks the stable channel, which is typically about a week behind and skips releases with major regressions, and claude-code@latest tracks the latest channel.
The check that covers all of them
On macOS and Linux, which -a claude prints the path of every claude your shell can find, in the order it would run them. With no output, nothing on your PATH is called claude, and the next question is whether anything on the machine is. Anthropic names the three places to look: ~/.local/bin/claude for the native installer, ~/.claude/local/ for a legacy local npm install created by older versions of Claude Code, and npm -g ls @anthropic-ai/claude-code for a global npm install. On Windows the equivalents are where.exe claude, which prints INFO: Could not find files for the given pattern(s). when nothing is on your PATH, and Test-Path "$env:USERPROFILE\.local\bin\claude.exe" for the native installer.
permission denied when adding to your PATH
This is the fix failing rather than the error, and it happens at the step where you save the line. If the echo command prints one of these, your user cannot write to that file and nothing was saved:
zsh: permission denied: /Users/you/.zshrcbash: /home/you/.bashrc: Permission deniedHow to fix it
- Check who owns the file, using your own shell's file name in place of
~/.zshrc:ls -l ~/.zshrc. The third field of the output is the owner. - If the owner is another user, such as
root, take ownership withsudo chown $(whoami) ~/.zshrc, which needs administrator rights. - If the owner is you, the file is read-only. Make it writable with
chmod u+w ~/.zshrc. - Run the two PATH commands for your shell again, then open a new terminal and run
claude --version.
A second claude, or one you cannot see
The PATH check on this page answers one question: can your shell find the folder the native installer uses. Two other situations sit beside it, and both produce a claude that is either the wrong one or invisible.
More than one installation
The page warns that multiple Claude Code installations cause version mismatches and unexpected behaviour, and which -a claude is what shows them. The page's advice is to keep one, and it names the native install at ~/.local/bin/claude, or %USERPROFILE%\.local\bin\claude.exe on Windows, as the recommended one.
Removing the extras
Check before you remove anything. Two of these delete a folder outright rather than unregistering a package, and if the legacy local install is the only claude you have, removing it leaves you with none. Run which -a claude on macOS and Linux, or where.exe claude in PowerShell, and read what it lists. If the native install is among them, go ahead. If it is not, keep what you have and leave this until it is: the folder you were about to delete may be the only claude on the machine, and removing a second install is safe only once another one runs.
An npm global install:
$ npm uninstall -g @anthropic-ai/claude-codeThe legacy local npm install that older versions of Claude Code created:
$ rm -rf ~/.claude/localThe same folder in PowerShell:
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local"The two package-manager installs, on macOS and Windows: brew uninstall --cask claude-code, using claude-code@latest instead if that is the cask you installed, and winget uninstall Anthropic.ClaudeCode.
The VS Code extension does not put claude on your PATH
If you installed the Claude Code extension for VS Code and never installed the CLI, ~/.local/bin/claude will not exist, and that is by design rather than a broken install. It states that the extension bundles a private copy of the CLI inside the extension directory for its own chat panel and does not add it to PATH. If you want claude in a terminal, the standalone installer is the step Anthropic gives, and the PATH check above applies to that.
When it is not a PATH problem
Three situations can look like this one and are worth ruling out before you edit anything. None of them is answered by a PATH change.
On Windows, right after an update
If the error started right after Claude Code updated, the page sends you to a different check first: look in %USERPROFILE%\.local\bin for claude.exe. If that directory is on your PATH and the program is missing from it, this is the update failure rather than the PATH one. To update on Windows, Claude Code renames the existing claude.exe aside to a backup and moves the new version into its place, and an interrupted run can leave the backup there with no program beside it. The file to look for begins claude.exe.old. followed by a numeric timestamp, and this is the command Anthropic gives to rename the newest one back:
Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exeRun claude --version afterwards to confirm it worked. If there is no claude.exe.old.* file, or claude still fails after the rename, the step Anthropic gives is to reinstall with irm https://claude.ai/install.ps1 | iex.
After an npm install, claude runs but does not start
The @anthropic-ai/claude-code npm package delivers the real program as a per-platform optional dependency, and its postinstall step copies that into place. If the download or that step is skipped, claude is a placeholder script instead of the program, and on macOS and Linux it prints this when you run it:
Error: claude native binary not installed.The rest of the message names the two causes, --ignore-scripts style flags and --omit=optional style flags, and the command to run the postinstall step by hand. On Windows the same placeholder is bin/claude.exe and the shell reports that it cannot run the file rather than printing the message above. This is a different error with a different fix, and it is not the one this page is about.
claude is found and the version prints
If claude --version gives you a version but claude crashes or hangs, PATH is settled and the next step is not here. Its page says so directly: the checks that follow assume claude is on your PATH, and they start with confirming the binary exists and is executable. Claude Code error messages explained is the index for that side of the problem.
What does not help
Three things this error tempts people into, none of which the page asks for.
- Reinstalling before you check. The error is about where the shell looks, and a reinstall puts the program in the same folder with the same PATH underneath it. Anthropic's own order is first check, then edit PATH. Reinstalling is not the first step anywhere in Anthropic's order, and it is given for two cases under this message: when the check shows nothing installed at any of the locations a
claudebinary comes from, and when a Windows update leftclaude.exemissing with no backup file beside it. - Running the installer again from the same window. An open terminal holds the PATH from before the change, and so does one inside an editor. The fix is applied in the file, but the window that was already open will not see it, which is why every step on this page ends with a new terminal.
- Assuming the extension installed the CLI. Installing the VS Code extension gives that panel a private copy and deliberately leaves your PATH alone. If
~/.local/bin/claudeis missing and the extension is the only thing you installed, there is nothing broken to repair; the standalone installer is the step that putsclaudewhere a terminal can reach it.
Several sessions on one machine
PATH is read when a shell starts, so a machine running many terminals is a machine where one of them can be out of step with the rest. That is usually harmless, and it becomes something to think about when the shells are not all yours: a build server, a container, or a service that runs a command without ever reading your shell profile will not see a line you added to ~/.zshrc, because nothing reads it.
Omniscio, the desktop app we make for running many Claude Code sessions at once, installs Claude Code itself during first-time setup, through Anthropic's own installer and on every platform. Git is the other tool setup requires, and it comes the way each platform expects: the per-user Git for Windows installer, Homebrew on macOS, or the distribution's package manager. Anything that did not install can be added later from Settings, under Connected Tools.
Where to go next
Claude Code error messages explained is the index for the error families on this site, and its own section for this message is the short version of what you have just read. Claude Code on Windows covers the Windows install end to end, including the Git and PowerShell setup the installer expects. If the installer itself failed rather than the PATH, Anthropic's setup page carries the install command for each platform and the alternative methods.
Sources
Every message, meaning and step on this page rests on one of these. The date beside each one is the day it was read.
- Anthropic, Claude Code install and login troubleshooting, for the four platform spellings of the error, the
Setup notesline the installer prints, the PATH check and fix for each shell, the three causes to check when the fix did not take, thepermission deniedcase, the three locations aclaudebinary comes from, the note that the VS Code extension does not add it to PATH, the npm placeholder-binary failure, the Windowsclaude.execase, and the version number a working install prints. Read October 24, 2026. - Anthropic, Terminal guide for new users, for the install command per platform, the
command not found: claudeandclaude is not recognizedanswers under each operating system's troubleshooting heading, and the instruction to run the command the installer printed underSetup notesor the one for your shell. Read October 24, 2026. - Anthropic, Advanced setup, for the install commands, which method is recommended, the macOS and Windows versions each supports, the npm install, the Homebrew casks and the WinGet package, and what the installer does about PATH. Read October 24, 2026.
- Terminal capture on this page: the reproduction of the error, run on an isolated cloud test machine on Claude Code 2.1.310, Linux x64, October 24, 2026.
Anthropic's install troubleshooting page changes with most Claude Code releases. Read it again before you trust a copy of this page from a few months back.
Common questions
What does "command not found: claude" mean?
The install finished and the folder it put the claude program in is not on your PATH. PATH is the list of folders your shell searches for a command, and the installer places claude at ~/.local/bin/claude on macOS and Linux or %USERPROFILE%\.local\bin\claude.exe on Windows. The installer does not edit PATH itself.
Is Claude Code installed or not?
Usually it is installed. The error says the command cannot be found, which is about where the shell looks, not about whether the program is there. Check the file first: ls -la ~/.local/bin/claude on macOS and Linux, or Test-Path "$env:USERPROFILE\.local\bin\claude.exe" in PowerShell. A listing means the program is there and only PATH needs fixing.
Why does Windows say "'claude' is not recognized"?
It is the same problem in Windows wording. Windows reports an unknown command differently from a Unix shell, and CMD and PowerShell add their own phrasing. One Windows case is different: if the error started right after Claude Code updated, check whether claude.exe is still in %USERPROFILE%\.local\bin, because an interrupted update can leave the backup file there instead of the program.
Do I need to reinstall Claude Code?
Not for this error. Anthropic's fix is a PATH change, and it is permanent, so you apply it once. Reinstalling is given for two cases instead: when ls or Test-Path shows nothing is installed at any of the locations a claude binary comes from, and when a Windows update left claude.exe missing with no claude.exe.old. file there to put it back.
Why did claude work before and stop now?
Two different problems land here. On Windows, if the error started right after Claude Code updated, the program can be gone from the folder with a claude.exe.old. backup beside it, and that is an interrupted update rather than PATH. The other is a terminal rather than the machine, and it shows up as claude working in one terminal and not another: a window keeps the PATH it had when it opened, and a terminal inside an editor takes its PATH from the editor, so a fix you have just applied stays invisible there until you open a fresh window.
Does fixing PATH affect anything else on my computer?
The command adds one line to your own shell configuration file, either ~/.zshrc, ~/.bashrc or ~/.bash_profile, or sets your user PATH on Windows. On macOS and Linux it puts ~/.local/bin at the front of the search order; on Windows the folder goes on the end of your User PATH. Either way it leaves the folders already on that list alone, and it changes your own account only, not other users on the machine.