From 584175351ae2f3ceb04b5766e7de1cfcdc4f6c1a Mon Sep 17 00:00:00 2001 From: Zhiqiang ZHOU Date: Tue, 9 Sep 2025 13:39:00 -0700 Subject: [PATCH] fix: support Claude CLI installed via migrate-installer After running `claude migrate-installer`, the Claude executable is moved from PATH to ~/.claude/local/claude. This change updates check_tool() to prioritize checking this local path before falling back to PATH lookup. Fixes: #123 Co-Authored-By: Claude --- src/specify_cli/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index aa3cf3c..7991a64 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -332,6 +332,17 @@ def run_command(cmd: list[str], check_return: bool = True, capture: bool = False def check_tool(tool: str, install_hint: str) -> bool: """Check if a tool is installed.""" + + # Special handling for Claude CLI after `claude migrate-installer` + # See: https://github.com/github/spec-kit/issues/123 + # The migrate-installer command REMOVES the original executable from PATH + # and creates an alias at ~/.claude/local/claude instead + # This path should be prioritized over other claude executables in PATH + if tool == "claude": + claude_local_path = Path.home() / ".claude" / "local" / "claude" + if claude_local_path.exists() and claude_local_path.is_file(): + return True + if shutil.which(tool): return True else: