Skip to content

Fix Claude CLI well-known path fallback precedence#675

Merged
ratulsarna merged 4 commits intomainfrom
codex/pr-640-audit
Apr 9, 2026
Merged

Fix Claude CLI well-known path fallback precedence#675
ratulsarna merged 4 commits intomainfrom
codex/pr-640-audit

Conversation

@ratulsarna
Copy link
Copy Markdown
Collaborator

Preserves the Claude CLI well-known path fallback from #640 while keeping normal precedence when multiple installs exist.

  • add well-known Claude CLI fallback locations for Finder-launched apps
  • prefer ~/.claude/bin/claude and native Homebrew installs before the bundled cmux.app binary in fallback mode
  • add regression coverage for the fallback ordering

Supersedes #640.

Thanks @claw-explorer for the original PR and investigation.

claw-explorer and others added 4 commits April 9, 2026 01:31
…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 #599
# Conflicts:
#	CHANGELOG.md
@ratulsarna ratulsarna marked this pull request as ready for review April 9, 2026 09:23
@ratulsarna ratulsarna merged commit 6665a27 into main Apr 9, 2026
4 checks passed
@ratulsarna ratulsarna deleted the codex/pr-640-audit branch April 9, 2026 09:32
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.

2 participants