not compatible with claude after `claude migrate-installer`
Background
I used to execute claude migrate-installer for auto-upgrading of the claude cli;
which would remove the claude from $PATH, but add an alias entry to all shell (bash/zsh/etc.)
What I expected
speckit could find the correct claude executable binary file and complete the init procesure properly
What I see
speckit does not works well;
$ uvx --from git+https://github.com/github/spec-kit.git specify init --here --ai claude
Updated https://github.com/github/spec-kit.git (fc8eb0434a0ac7d49be17b574fa104677dc47f0f)
Built specify-cli @ git+https://github.com/github/spec-kit.git@fc8eb0434a0ac7d49be17b574fa104677dc47f0f
Installed 18 packages in 21ms
███████╗██████╗ ███████╗ ██████╗██╗███████╗██╗ ██╗
██╔════╝██╔══██╗██╔════╝██╔════╝██║██╔════╝╚██╗ ██╔╝
███████╗██████╔╝█████╗ ██║ ██║█████╗ ╚████╔╝
╚════██║██╔═══╝ ██╔══╝ ██║ ██║██╔══╝ ╚██╔╝
███████║██║ ███████╗╚██████╗██║██║ ██║
╚══════╝╚═╝ ╚══════╝ ╚═════╝╚═╝╚═╝ ╚═╝
Spec-Driven Development Toolkit
Warning: Current directory is not empty (22 items)
Template files will be merged with existing content and may overwrite existing files
Do you want to continue? [y/N]: y
╭───────────────────────────────────────────────────────────────────────────╮
│ Specify Project Setup │
│ Initializing in current directory: cloudflare-tunnel-ingress-controller │
│ Path: /Users/strrl/playground/GitHub/cloudflare-tunnel-ingress-controller │
╰───────────────────────────────────────────────────────────────────────────╯
⚠️ claude not found
Install with: Install from: https://docs.anthropic.com/en/docs/claude-code/setup
Error: Claude CLI is required for Claude Code projects
Required AI tool is missing!
Tip: Use --ignore-agent-tools to skip this check
$ which claude
claude: aliased to /Users/strrl/.claude/local/claude
Potential Solution
let speckit lookup $HOME/.claude/local/claude; and it should be more prioritized than other claude executables in $PATH, because in a shell environment, alias is preferred over executable;
so speckit should lookup
- firstly
$HOME/.claude/local/claude - otherwise, lookup other exectuable in $PATH
- throw an error
I could open a PR if this solution looks good to you guys :heart:
More References
more info about claude migrate-installer https://docs.anthropic.com/en/docs/claude-code/setup#local-installation
Workaround: Migrate from Alias to PATH Symlink
I was able to get it to work by changing the claude alias to a symlink.
Step-by-Step Instructions
1. Locate the Current Alias
$ type claude
claude is an alias for /Users/username/.claude/local/claude
2. Remove the Alias
Edit your shell configuration file (e.g., ~/.zshrc) and remove the Claude alias line:
# Remove this line from your shell config:
alias claude="/Users/username/.claude/local/claude"
Note: Replace username with your actual username.
3. Create the Symlink
Create a symlink in your ~/bin directory (assuming it's in your PATH):
ln -s ~/.claude/local/claude ~/bin/claude
4. Verify the Setup
Restart your shell.
Verify the new setup:
which claude
# Should output: /Users/username/bin/claude
claude --version
# Should output: 1.0.xxx (Claude Code)
Troubleshooting
If ~/bin is not in your PATH (or use a location you trust)
Add this to your shell configuration file:
mkdir ~/bin
export PATH="$HOME/bin:$PATH"
Then reload your shell configuration.
If the symlink doesn't work
Check that the original executable exists and is executable:
ls -la ~/.claude/local/claude