command not found: claude
You'll see the 'command not found: claude' error when your terminal application can't access the Claude Code program, usually because it is not installed or shell activation is missing. Here's how to fix it.
Claude Code is an AI coding tool that runs in your terminal with the claude command. It reads your codebase, edits files (with your permission), and runs commands so you can develop software with AI assistance.
The error zsh: command not found: claude means either Claude Code is not installed or your shell doesn't know where to find it. That can happen if the folder that holds the claude binary is not on your PATH. A misconfigured install from either Homebrew or the native installer can cause the error, and this page shows how to fix it.
I recommend using our free app to install Claude Code on your Mac, so this error does not come up. It is a FREE Mac app that installs Claude Code, configures the shell, and verifies the claude command works. It does everything this guide covers, but easier and faster. Here are all the details about the app before you download. Then:
Getting Claude Code working is one step in setting up your Mac for development. See the full roadmap to set up a Mac for software development.
What 'command not found' means
The terminal shell program searches a list of folders (set by the PATH environment variable) for every command you type. The message zsh: command not found: claude means none of those folders holds the claude binary. If Claude Code is actually installed, you'll see the error if its folder is missing from your PATH. Mac PATH explains how the PATH works and Shell Configuration explains how to set it.
Which folder is missing, and how to set the PATH, depends on how you installed Claude Code:
- Homebrew installs the
claudecommand into Homebrew's own bin folder (/opt/homebrew/binon Apple Silicon,/usr/local/binon Intel). Ifclaudeis not found, Homebrew itself is usually not on your PATH. - The native installer puts
claudein~/.local/bin. Ifclaudeis not found, that folder is not on your PATH.
The two cases have different fixes. Because most developers install Claude Code with Homebrew, I'll show that first.
Restart your terminal first
Before you change anything, rule out the simplest cause. After an install, a PATH change only takes effect in a new shell. Quit your terminal application, open it again, and try:
$ claude --version
If a version string appears, the install was fine and the previous terminal session had not reloaded your PATH. If you still get zsh: command not found: claude, continue.
Fix a Homebrew install
A Homebrew cask installs the claude command into Homebrew's bin folder, so claude runs only when two things are true: Homebrew's bin folder is on your PATH, and the Claude Code cask is actually installed. Diagnose them in that order.
First, check whether Homebrew itself is on your PATH:
$ brew --version
If you get zsh: command not found: brew, Homebrew is not on your PATH, which is why claude is not found either. Fixing Homebrew's PATH fixes claude at the same time: follow zsh: command not found: brew, which sets it with eval "$(/opt/homebrew/bin/brew shellenv)" in your ~/.zprofile (the .zshrc or .zprofile guide explains which file, and Shell Configuration shows how to edit it). Open a new terminal afterward and run claude --version. If Homebrew is not installed at all, see Install Homebrew on Mac, then Brew Install Claude Code.
If brew --version shows a version, Homebrew is on your PATH, so a missing PATH is not the cause. Check whether the Claude Code cask is actually installed:
$ brew info --cask claude-code@latest
The output reports whether the cask is installed and where (use claude-code instead if you installed the stable channel). If it is not installed, install it with brew install --cask claude-code@latest, then open a new terminal; see Brew Install Claude Code for the details. If it reports as installed but claude is still not found, reinstall the cask to relink the command:
$ brew reinstall --cask claude-code@latest
Then open a new terminal and run claude --version.
Fix a native installer install
The native installer puts claude in ~/.local/bin. Confirm the binary is there:
$ ls -la ~/.local/bin/claude
If a file is listed, the install is fine and the folder just needs to be on your PATH. Check whether it already is:
$ echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin"
You'll see /Users/you/.local/bin if the folder is on your PATH. No output means it is missing. Add it by appending a line to your shell startup file. On macOS, set PATH in ~/.zprofile, not ~/.zshrc (the .zshrc or .zprofile guide explains why, and Shell Configuration shows how to edit it):
$ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zprofile
Reload the shell, or open a new terminal window, then confirm:
$ source ~/.zprofile
$ claude --version
A version string means claude is on your PATH. If ls showed No such file or directory instead, Claude Code is not installed there: see Install Claude Code on Mac.
When the version is wrong instead
If claude --version runs but reports a version you did not expect, the problem is not your PATH. It is conflicting installs: more than one copy of Claude Code on your Mac, with the shell launching whichever comes first. List every copy:
$ which -a claude
More than one line means you have conflicting installs. Update Claude Code walks through finding the extra copies and removing all but one.
Continue setting up your Mac
Don't miss the full visual roadmap and checklist that shows how to set up a Mac for software development, with all the essential tools and settings you might not yet know about.