Skip to content

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.

Error output
zsh:1: command not found: claude

As 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`.

  1. 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.

  2. 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.

ToolClaude Code
Version<= 3.16.3
PlatformsLinuxmacOS
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.

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.