Finds the claude executable and reads its version.
resolve/1 returns an absolute path, so the transport starts that exact file and never searches PATH again. It checks, in order:
CLAUDE_BRIDGE_CLI, which must be an absolute path to an executable file.claudeonPATH.~/.local/bin/claude, then~/.claude/local/claude, where the Claude Code installers put it.
version/2 runs claude --version with a timeout. It is for diagnostics only; the session checks the version Claude Code reports in its initialize answer.
Summary
Functions
Returns true when path is a regular file (or a link to one) with an execute bit set.
Resolves the claude executable.
Runs path --version and returns the version number from its first line, for example "2.1.330". Kills the process after timeout milliseconds.
Types
Functions
Returns true when path is a regular file (or a link to one) with an execute bit set.
Resolves the claude executable.
Options, for tests:
:env- the environment map to readCLAUDE_BRIDGE_CLIfrom. Defaults toSystem.get_env/0.:find_executable- a function that searchesPATH. Defaults toSystem.find_executable/1.:home- the home directory. Defaults toSystem.user_home/0.
@spec version(Path.t(), timeout()) :: {:ok, String.t()} | {:error, :timeout | {:exit_status, integer()} | :unparsable}
Runs path --version and returns the version number from its first line, for example "2.1.330". Kills the process after timeout milliseconds.