Direct answer
After a native install on macOS, Linux or WSL, check ~/.local/bin/claude, then ask the current shell which claude it would run. Official (F001): the native installer places the executable at that user-local path. Official (F002): an unrecognized command can mean the install directory is absent from PATH, although that is only one documented cause. Compare the file on disk with shell resolution before reinstalling. A working fix adds the documented directory to the user’s search path and confirms that the resolved executable belongs to the intended installation route. Do not use sudo, mix native and package-manager removal commands, or treat a launch failure as proof of a PATH defect.
Why a missing command costs time
A fresh terminal can make a completed installation look absent. You type claude, the shell reports that it cannot find the command, and attention moves to accounts, networks or the installer itself. Those are plausible areas, but none explains a command that the shell cannot resolve. The first useful question is narrower: did the installer create the expected file, and can this shell see its directory?
A second failure mode is quieter. More than one claude can exist after someone tries native, npm and Homebrew routes in sequence. The command starts, so the installation appears healthy, yet the shell may have selected a different copy from the one the operator intended. Updates, configuration and removal then become uncertain because each route has a different owner.
The practical cost is repeated work. A blind reinstall can add another copy without correcting search order. A package-manager uninstall can leave a native file behind, while a native cleanup can miss a package-owned binary. Neither action proves which executable a future terminal will launch.
A small install audit prevents that confusion. Capture the expected path, the resolved path and the installation owner before changing anything. This guide stays on executable discovery and PATH. Proxy, TLS, account enforcement and browser sign-in belong to separate diagnostics. If the executable resolves correctly but the program fails later, stop calling it a missing-command problem.
What the native installer places on disk
Official (F001): on macOS, Linux and WSL, the native executable belongs at ~/.local/bin/claude. The tilde names the current user’s home directory. Treat it as a location to inspect, not as proof that every machine has the same surrounding files or permissions.
That path gives the audit a fixed starting point. Open a terminal as the user who will run Claude Code. Check the exact file rather than searching the whole home directory. If the file is absent, record that result before changing PATH; adding an empty directory cannot make an uninstalled command appear.
The setup documentation describes Windows binaries as living in user directories, but the fetched page does not provide one exact Windows path. This article therefore does not invent a Windows directory. Windows operators should use the WinGet ownership checks in the WinGet install and binary location guide.
Official (F003): Bash, Zsh, PowerShell and CMD are documented supported shells. That list does not establish support for another shell, and it does not mean every shell uses identical startup files. The Bash and Zsh examples below are operator procedures for inspecting a user-local Unix path, not additional vendor guarantees.
Installation route versus documented executable location
| Installation route | Location supported by this packet | Ownership question | Safe next check |
|---|---|---|---|
| Native on macOS, Linux or WSL | ~/.local/bin/claude (F001) |
Did the native installer create this user-owned file? | Inspect the file, then resolve claude in the current shell |
| Native on Windows | User directories, with no exact path in the fetched page (F009) | Which package or native installation registered the command? | Inspect package records and shell resolution without guessing a folder |
| npm | Global package route, not the native path (F010, F011) | Which npm global prefix owns the command? | Follow the npm global prefix guide |
| Homebrew | Cask-owned application, not a native user binary (F004) | Which cask name is installed? | Follow the Homebrew cask ownership guide |
| Linux system package | Signed repository package (F013) | Which system package manager owns it? | Follow the apt, dnf and apk comparison |
Check the documented install directory
Start with a read-only inspection. The command below asks the filesystem whether the documented native path exists and displays its metadata. It does not execute Claude Code or alter the file.
ls -l "$HOME/.local/bin/claude"Interpret the result literally. A listed file moves the investigation to permissions and shell resolution. A missing-file error moves it back to installation completion. A directory at that exact name is not the expected executable and needs explanation before any launch test.
Next, check whether the current user can execute the file. This is an operator check derived from the documented path, not a claim that execute permission is the cause of a particular failure.
test -x "$HOME/.local/bin/claude"A successful test establishes executability for the current user. A failed test does not authorize a broad permission change. Review ownership and mode first. If the file belongs to another account or a package manager, stop and identify that owner. If it is the expected user-owned native file, follow the current official installer guidance for the user account rather than escalating to an administrator shell.
Keep the home directory explicit in shared notes. Two users on one machine can have different ~/.local/bin directories. A screenshot from an administrator account does not prove what a developer account can execute. Likewise, a terminal inside a container or remote host is inspecting that environment, not the workstation outside it.
Observed file result versus the next installation check
Observation at ~/.local/bin/claude |
What it establishes | Next check | What it does not establish |
|---|---|---|---|
| File is absent | The documented native path is not present for this user | Review whether the native installer completed for this account | That PATH is the only problem |
| File exists but is not executable | The current user cannot pass the execute check | Inspect owner and mode before a user-scoped repair | That sudo is appropriate |
| File exists and is executable | The native file can pass a local execute check | Resolve which claude the shell selects |
That the selected command is this file |
| Path is a symlink | The name points elsewhere | Inspect the link target and its owner | That the target is native, npm or package-owned |
| File exists under another user | A different account has a native path | Repeat the audit as the intended user | That the intended user’s install is complete |
Resolve the executable your shell actually runs
Filesystem existence and command resolution are separate checks. A shell searches directories listed in PATH, meaning its ordered list of executable search locations. If the directory containing claude is missing, the shell can fail even though the file exists. If another directory appears earlier and contains a different claude, the shell can select that copy.
Use a resolution command in the same shell where the failure occurs. Bash provides command -v for the command it would use and type -a for a broader view of matches. Zsh users can inspect command resolution with whence -a claude. These are local shell inspection procedures; their output should be recorded rather than assumed.
command -v claude
type -a claudeA useful record includes the full resolved path, not just the word claude. Compare that path with ~/.local/bin/claude. An exact match supports the native-route hypothesis. A different path means another command is winning, so identify its owner before changing anything. No result means the current shell has not resolved a command, which returns the audit to file existence, PATH and installation completion.
The distinction matters because PATH is ordered. Adding the native directory at the end does not necessarily make it win when an earlier directory already contains claude. Put the intended user-local directory before conflicting user-managed locations only after you understand why those locations exist. System directories should not be rewritten as a shortcut for a user-level install.
PATH entry versus the action it controls
| Search-path state | Shell consequence | Operator action | Verification |
|---|---|---|---|
| Native directory absent | The shell cannot discover the native file through normal lookup | Add the user-local directory for the intended shell | Resolve claude again in a fresh shell |
| Native directory present but later than another copy | Another executable can win | Identify the earlier copy and its installation owner | Compare every reported match, not only the first |
| Native directory present and first | The native file is the expected candidate | Confirm file identity and executability | Run the intended version inspection supported by the installed CLI |
| Directory added only in one terminal | Other terminals keep their previous environment | Persist the change in the correct user startup configuration | Open a new terminal and repeat resolution |
| Relative or malformed entry | Lookup depends on the working directory or may fail | Replace it with the explicit user-local directory | Print and review the effective PATH |
Repair a missing user PATH entry
When the native file exists, is executable and is not resolved, a missing user PATH entry is a documented possibility (F002). Make the smallest reversible change. For the current Bash session, an explicit export can test the hypothesis without editing a startup file.
export PATH="$HOME/.local/bin:$PATH"After that change, run command -v claude again. If it resolves to the documented native file, the immediate session has enough evidence to test a persistent user configuration. If it resolves elsewhere, the added directory did not become the selected location, so inspect earlier entries instead of adding duplicates.
For Zsh, the equivalent current-session operator procedure uses the same explicit directory:
export PATH="$HOME/.local/bin:$PATH"Persistence belongs in the startup file for the shell and account that actually launches Claude Code. Review the existing file before editing it. Avoid appending the same export repeatedly, and avoid replacing the entire PATH with only the native directory. Other tools need their existing search locations.
A fresh terminal is the acceptance test. Environment changes made in one process do not rewrite an already running shell’s environment. If an IDE or terminal multiplexer starts the client through a different environment, verify that launch context separately. The settings env and process replacement guide explains why a settings-file environment entry can differ from an inherited shell value, while the absolute config directory guide covers a different path variable.
A safe user-level sequence
- Inspect
~/.local/bin/claudeas the intended user. - Confirm the current user can execute that exact file.
- Capture the output of
command -v claudeand, in Bash,type -a claude. - Add
$HOME/.local/binonly when the documented native file exists and the directory is missing or loses to an understood conflict. - Test the change in the current shell, then persist it in the reviewed user startup file.
- Open a fresh terminal and repeat the resolution check.
- Save the resolved path and installation owner before any upgrade or removal work.
Separate native and package-manager copies
Binary ownership answers a practical question: which tool should update or remove this executable? A native file under the user’s local directory, an npm global command and a cask or system package are not interchangeable artifacts. The uninstall and configuration retention guide keeps executable removal separate from configuration deletion.
Suppose resolution reports a path outside ~/.local/bin. Do not delete it because it is unfamiliar. Inspect the corresponding package manager or installation route. The Homebrew manual cask update guide, WinGet package maintenance guide, npm global prefix guide and Linux package comparison each explain the matching ownership check.
Multiple copies can also produce misleading version reports. If one terminal resolves the native file and another resolves a package-owned command, both observations can be correct for their environments. Capture the shell, user, resolved path and package owner together. A version string without that context does not identify the installation.
Avoid mixing cleanup commands across routes. Native removal guidance concerns native files. Homebrew, WinGet, npm and Linux system packages each require their own removal method. Configuration is a third decision: deleting settings or history is not required to remove an executable, and it should not be the default troubleshooting step.
Verify the selected installation route
| Evidence | Supported interpretation | Follow-up |
|---|---|---|
Resolved path equals ~/.local/bin/claude |
The shell selected the documented native location | Confirm owner and executability, then test the CLI normally |
| Resolved path is inside an npm global prefix | npm owns the selected command | Use the npm prefix and PATH audit |
| Homebrew reports the selected application as a cask | Homebrew owns the selected installation | Use cask upgrade and verification steps |
| WinGet reports the package identifier | WinGet owns the Windows package | Use WinGet package records and shell resolution |
| A Linux system package owns the resolved file | The distribution package manager owns it | Use the matching apt, dnf or apk workflow |
| No route can be identified | Ownership remains unknown | Stop before update or removal and collect package records |
Handle file permissions without sudo
Permission problems and path problems can produce different symptoms. A file that exists but cannot execute will not be repaired by adding its directory to PATH. Conversely, an executable file in an invisible directory will not be repaired by changing its mode.
Review the owner and permission bits with ls -l. If the expected native file belongs to the current user, keep the repair user-scoped. If it belongs to root, another account or a package manager, identify why before changing it. Broad recursive permission changes are especially inappropriate in a home directory.
Official (F011): the npm installation instructions explicitly say not to use sudo. Although this article’s main path is native installation, the same operational discipline applies: do not use administrator privileges to conceal an ownership mistake. The npm install and global prefix guide explains how a user-writable global prefix avoids that trap.
A failed execute check can also reflect a mounted filesystem, an incompatible launcher or an incomplete download. Those possibilities are not resolved by the three native-install facts in this packet. Note the observed mode and mount context, then consult current troubleshooting guidance rather than asserting a universal permission fix.
Never print credential files while investigating permissions. Executable discovery does not require reading settings, tokens or session history. The credential storage path guide explains where credentials live without making their contents part of an install audit.
Record a repeatable PATH check
A repeatable check fits in a short runbook. Capture the user, shell, documented path, resolved path and installation owner. Add the date and the exact terminal context when the result matters to a team. Do not include secrets or private authentication URLs.
The following read-only sequence is suitable for a macOS, Linux or WSL native-install audit. It inspects the documented file and asks Bash to report resolution. Run each command in the shell where Claude Code is expected to work.
printf 'user=%s
' "$USER"
printf 'shell=%s
' "$SHELL"
printf 'path=%s
' "$PATH"
ls -l "$HOME/.local/bin/claude"
command -v claude
type -a claudeThis sequence is an operator procedure built around F001 and F002. It does not promise a particular version string or output format. If type -a is unavailable because the shell is not Bash, use the resolution inspection appropriate to that documented shell and keep the same evidence fields.
Concrete win, loss and implication
A concrete win is a clean native audit: the documented file exists, the current user can execute it, and a fresh Bash or Zsh session resolves exactly ~/.local/bin/claude. That result removes guesswork before anyone touches authentication or network settings.
A concrete loss is time spent repairing the wrong layer. If the file is absent, editing PATH cannot install it. If another package-owned command resolves first, reinstalling the native binary can leave the real conflict untouched. The packet also provides no measured failure rate for missing PATH entries, so this guide does not claim that one repair solves most startup problems.
The practical implication is operational: keep executable resolution as a required installation check, especially after changing shells or adding another installation route. A path in a runbook is useful only when a fresh shell confirms it. Treat update and removal decisions as consequences of ownership, not as independent cleanup habits.
Worked example: compare file and shell evidence
Consider a user who installed natively and then opened a new Zsh terminal. The documented file is present and executable, but claude is unrecognized. That combination makes a missing search-path entry plausible under F002; it does not prove the cause.
First, inspect ~/.local/bin/claude. Next, print the effective PATH and look for the explicit $HOME/.local/bin directory. If it is absent, add it for the current session and resolve the command again. If the resolved path becomes the documented native path, persist the same user-level entry in the reviewed Zsh startup configuration.
Now change one condition: suppose resolution still reports a different path. The earlier directory contains another claude, so the native directory is visible but not selected. Identify that earlier executable’s owner. Removing or reordering it is a separate decision, preferably after confirming which installation the user intends to keep.
Finally, suppose the documented file is absent. Stop the PATH experiment. A search path cannot point to a missing executable. Review installation completion for the current account, then repeat the same audit. These branches are deliberately small because each one changes only the layer supported by observed evidence.
Decision matrix
| File at native path | Shell resolves native path | Next action |
|---|---|---|
| Absent | No | Review native installation completion before editing PATH |
| Present and executable | No | Inspect PATH order and test the documented user directory |
| Present and executable | Yes | Record native ownership and proceed to normal CLI verification |
| Present, not executable | No or yes | Inspect owner and mode; do not jump to administrator access |
| Present | Another path | Identify the winning executable and its package owner |
| Unknown | Unknown | Collect read-only evidence before update, reinstall or removal |
Practical checklist and controls
- Name the account. Run the audit as the user who will launch Claude Code.
- Name the environment. Record macOS, Linux or WSL, plus the shell and terminal context.
- Inspect the fixed path. Check
~/.local/bin/claudebefore broad searches. - Check executability. Separate current-user execute access from directory visibility.
- Resolve the command. Record the full path selected by the current shell.
- Check search order. Treat an earlier matching executable as ownership evidence, not noise.
- Make a user-scoped change. Add the documented directory without replacing the rest of
PATH. - Persist carefully. Review the correct startup file and avoid duplicate exports.
- Open a fresh shell. Confirm that persistence works outside the modified process.
- Match maintenance to ownership. Use the installation route’s update and removal method.
- Keep configuration separate. Do not delete settings or history to fix command lookup.
- Escalate with evidence. Share redacted paths, shell, user and resolution output, never tokens.
A useful handoff note says: native file present, executable by the intended user, missing from Zsh PATH, current-session test resolves the documented path, persistent change pending fresh-terminal verification. That note is more actionable than a screenshot saying only command not found.
The settings validation status and doctor guide is the next stop when the CLI resolves but configuration is rejected. The browser redirect and logout guide covers first-launch authentication after executable discovery succeeds.
Honest loss and data gap
The documented native path and the missing-PATH possibility are strong starting facts. They are not a complete diagnosis. The fact pack does not provide a universal Windows executable path, a measured incidence of PATH failures, or a guaranteed repair for every shell launcher. It also does not establish that every native installation has identical permissions.
No current release version is asserted here. The setup instructions are a snapshot checked for this batch, and installer commands or paths can change. Recheck the official setup page before publication and before applying this runbook to a new platform. Linked-only quickstart, troubleshooting, terminal and CLI pages are further reading, not independent evidence for additional commands in this article.
A future update should add verified platform-specific launcher behavior if primary documentation provides it. Until then, keep claims at the level supported by F001 through F003: native location, one documented missing-command cause and the supported-shell list.
Continue with the matching batch guide
Installation ownership connects directly to manual Homebrew cask upgrades, WinGet executable and PATH verification, npm Node.js and global-prefix checks, and Linux apt, dnf and apk update ownership. Version policy belongs in the stable, latest and minimumVersion guide.
Removal and identity require separate evidence. Use the uninstall and configuration retention guide, the browser login and logout guide, and the credential precedence audit. Storage questions go to the macOS, Linux and Windows credential path reference.
Configuration paths and enforcement are covered by the absolute CLAUDE_CONFIG_DIR guide, the SSO organization and login-method controls, and the apiKeyHelper refresh-timing guide. Settings investigations can continue through the five-scope precedence map, the project-local versus user merge explanation, the status and doctor validation guide, and the global config versus settings.json reference.
Terminal and IDE launch contexts have their own checks. Consult the Shift+Enter compatibility guide, the tmux passthrough and notification-bell setup, and the terminal theme placement guide. IDE operations continue with the VS Code extension and standalone CLI guide, the VS Code auto-connect and relaunch guide, the JetBrains CLI and Marketplace plugin guide, and the JetBrains external-terminal host and /ide guide.
Container launch contexts are different from a workstation shell. The Dev Container Feature and Node fallback guide, the Dev Container auth volume guide, the Docker config mount permissions guide, the VS Code Dev Containers config alignment guide, and the container user, HOME and workspace guide cover those boundaries.
One AI API Key option for OpenAI-format agents
Claude Code uses an Anthropic-format route, so the One AI free IDs are not a Claude Code model source. For a separate OpenAI-format agent, One AI offers one key with 46 live free IDs through https://api.oneaiapikey.com/v1. Its Claude IDs were unavailable on 2026-11-27, and this article does not claim otherwise. See the current free-model lineup and the OpenAI-format quickstart before choosing a model for that separate agent.
FAQ
Does a native install always put Claude Code on PATH?
No. Official (F002): a missing directory on PATH is one documented reason for an unrecognized command after native installation. Check the file at ~/.local/bin/claude and inspect shell resolution before deciding that PATH is the cause.
What should I compare before reinstalling?
Compare the documented native path with the full path returned by the current shell. If another executable resolves first, identify its installation owner. Reinstalling without that comparison can add a duplicate while leaving the selected command unchanged.
Can I fix a user install with sudo?
Do not use administrator access as the default repair. Review ownership and execute permission first. Official (F011): the npm route explicitly says not to use sudo; native discovery should likewise begin with the intended user’s files and environment.
Why does the command work in one terminal but not another?
Search paths and startup configuration can differ by shell, user or launch context. A current-session export proves only that process. Persist the reviewed user-level entry, open a fresh terminal and repeat command -v claude.
Should I delete configuration when the command is missing?
No. Executable discovery does not require deleting settings, credentials or session history. The uninstall and configuration retention guide treats those as separate decisions.
Sources
- Advanced setup - Claude Code Docs. Official source for F001 through F003 and the native-path boundary.
- Quickstart - Claude Code Docs. Official further reading; linked-only in the research register.
- Terminal guide for new users - Claude Code Docs. Official further reading; linked-only in the research register.
- Troubleshooting - Claude Code Docs. Official further reading; linked-only in the research register.
- CLI reference - Claude Code Docs. Official further reading; linked-only in the research register.
- Environment variables - Claude Code Docs. Official reference for environment behavior, fetched during batch research.