From 37d8ca4129328fdb2510462aff1b3065004c7c8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 16:11:21 +0000 Subject: [PATCH] fix: add command -v happy guard to claude() default-mode branch The claude() function calls `happy` in its default-mode branch without checking whether the binary exists. If `happy` is not installed the user sees a raw 'command not found: happy' error with no guidance. Apply the same guard pattern already used in c() and claude-review() in misc.zsh: check for either `happy` or the external `claude` binary via `whence -p`, and emit the standard install hint on failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- zsh/aliases/claude-copilot.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zsh/aliases/claude-copilot.zsh b/zsh/aliases/claude-copilot.zsh index a256b199..32c173f2 100644 --- a/zsh/aliases/claude-copilot.zsh +++ b/zsh/aliases/claude-copilot.zsh @@ -198,6 +198,10 @@ function claude { if [[ "$mode" == copilot ]]; then claude-copilot "$@" # raw claude binary; NO happy-only flags else + if ! command -v happy &>/dev/null && ! whence -p claude &>/dev/null; then + echo "❌ Neither happy nor claude binary found. Install Claude Code CLI." >&2 + return 1 + fi _claude_copilot_unset_env happy --enable-auto-mode --permission-mode auto "$@" fi