zsh:1: command not found: claude - Claude Code
Quick fix
Upgrade cc-switch to v3.16.4 or newer, fixing PATH not loading when the terminal launches, or switch to the system default terminal for now.
Symptom
Section titled “Symptom”zsh:1: command not found: claudeAs a GUI application, cc-switch inherits the system's trimmed PATH at launch (the macOS launchd environment, for instance). On Linux, older launch scripts used `--norc --noprofile`, skipping `.bashrc`; in the Alacritty terminal on macOS, the launch command omitted the `-l` (login) argument so `~/.zprofile` was never loaded. Both lose your custom PATH (`~/.local/bin`) and leave the `claude` command unfound.
Launch logic also differs across terminals. The Ghostty terminal, for example, also has a problem where command arguments are not quoted correctly, so `--resume` is treated as a shell positional argument rather than an argument to `claude`.
Upgrade cc-switch to v3.16.4 or newer. That version fixed the forced `--norc --noprofile` on Linux, running through an interactive shell (`bash -ic`) instead and probing the default shell so environment variables load normally.
For third-party terminals on macOS such as Alacritty or Ghostty, if it persists after upgrading, switch the preferred terminal in cc-switch settings to the macOS default (Terminal.app) or Kitty for now.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 3 real issues
- Why does switching to the Mac default terminal let me resume sessions normally?
- The macOS default terminal (Terminal.app) launcher is configured with the login shell argument correctly in cc-switch, so it loads PATH from `~/.zprofile` and similar files. The older Alacritty and Ghostty launch logic is defective.
- Why does the Alacritty terminal window close immediately after opening?
- Alacritty launches in `-e` mode, so when the `claude` command is not found and returns exit code 127, the terminal closes with it. Adding `-l` to load PATH resolves it.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.