Homebrew cask install: installMethod detected as native, checks wrong binary path
Description
When Claude Code is installed via the Homebrew cask (claude-code), the CLI reports an error on startup:
installMethod is native, but claude command not found at /Users/<user>/.local/bin/claude
Environment
- Install method:
brew install --cask claude-code - Version: 2.1.29
- Platform: macOS (Apple Silicon)
- Binary location:
/opt/homebrew/bin/claude(symlinked from/opt/homebrew/Caskroom/claude-code/2.1.29/)
Context
Claude Code was originally installed using the native (standalone) install method, then removed and reinstalled via Homebrew cask. The ~/.claude/install-method file does not exist, so the stale install method detection may be persisted elsewhere or inferred from leftover native install artifacts.
Root Cause
The CLI detects the install method as native (the standalone installer), which then checks for the binary at ~/.local/bin/claude. Since the native install was removed and replaced with a Homebrew cask install, the binary lives at /opt/homebrew/bin/claude and the check fails.
This appears to be a stale state issue — the install method from the previous native install persists across the reinstall via Homebrew.
Expected Behavior
Switching install methods should not leave the CLI in a broken state. Either:
- The Homebrew cask install should overwrite any persisted install method state from a previous native install, or
- The CLI should detect the actual install method dynamically rather than relying on persisted state.
Steps to Reproduce
- Install Claude Code via the native/standalone installer
- Remove the native install
- Install via Homebrew:
brew install --cask claude-code - Run
claude - Observe the error about
installMethod is nativeand missing binary at~/.local/bin/claude
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗