Skip to content

fix: detect Claude CLI at well-known install paths (cmux.app, ~/.claude/bin)#640

Open
claw-explorer wants to merge 1 commit intosteipete:mainfrom
claw-explorer:fix/claude-detection-paths
Open

fix: detect Claude CLI at well-known install paths (cmux.app, ~/.claude/bin)#640
claw-explorer wants to merge 1 commit intosteipete:mainfrom
claw-explorer:fix/claude-detection-paths

Conversation

@claw-explorer
Copy link
Copy Markdown

Problem

CodexBar shows "Claude CLI is not installed" even when Claude Code is installed and fully functional (fixes #599).

This happens because macOS apps launched from Finder don't inherit the user's shell $PATH. The existing resolution chain tries login shell capture, environment PATH, interactive shell lookup, and alias resolution—but all of these can fail when the Claude CLI is installed via the macOS Terminal installer to a non-standard location like /Applications/cmux.app/Contents/Resources/bin/claude.

Solution

Adds a well-known paths fallback step to BinaryLocator.resolveBinary() that checks common Claude CLI installation locations before the minimal system-path lookup:

Path Source
/Applications/cmux.app/Contents/Resources/bin/claude macOS Terminal installer
~/.claude/bin/claude Manual/script install
/usr/local/bin/claude Homebrew (Intel)
/opt/homebrew/bin/claude Homebrew (Apple Silicon)

The well-known paths are only checked after all dynamic resolution methods fail, so they never override a user's preferred installation or explicit CLAUDE_CLI_PATH override.

Changes

  • PathEnvironment.swift: Added wellKnownPaths parameter to resolveBinary() and claudeWellKnownPaths(home:) static method
  • PathBuilderTests.swift: Added 3 tests verifying well-known path resolution and priority ordering

Testing

  • ✅ Well-known cmux.app path resolves when all shell lookups fail
  • ✅ Well-known ~/.claude/bin path resolves when all shell lookups fail
  • ✅ Shell PATH is still preferred over well-known paths (priority preserved)

Fixes #599

…de/bin)

When CodexBar is launched from Finder (not a terminal), it may not
inherit the user's shell PATH. The existing resolution chain tries
login shell capture, environment PATH, interactive shell lookup, and
alias resolution—but all of these can fail when:

1. The Claude CLI is installed via the macOS Terminal installer to
   /Applications/cmux.app/Contents/Resources/bin/claude
2. The PATH entry was added to the shell profile but the login shell
   capture times out or doesn't pick it up

This adds a well-known-paths step to BinaryLocator.resolveBinary()
that checks common Claude CLI installation locations as a fallback
before the minimal system-path lookup:

- /Applications/cmux.app/Contents/Resources/bin/claude (Terminal installer)
- ~/.claude/bin/claude (manual/script install)
- /usr/local/bin/claude (Homebrew Intel)
- /opt/homebrew/bin/claude (Homebrew Apple Silicon)

The well-known paths are only checked after all dynamic resolution
methods fail, so they never override a user's preferred installation.

Includes tests verifying:
- cmux.app path is found when shell lookups fail
- ~/.claude/bin path is found when shell lookups fail
- Shell PATH is still preferred over well-known paths

Fixes steipete#599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code detected as not installed despite being fully functional

1 participant