# `MingaClaudeBridge.Binary`
[🔗](https://github.com/jsmestad/minga-claude-bridge/blob/main/lib/minga_claude_bridge/binary.ex#L1)

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:

  1. `CLAUDE_BRIDGE_CLI`, which must be an absolute path to an executable file.
  2. `claude` on `PATH`.
  3. `~/.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.

# `error`

```elixir
@type error() ::
  :claude_not_found | {:invalid_cli_override, :not_absolute | :not_executable}
```

# `executable?`

```elixir
@spec executable?(Path.t()) :: boolean()
```

Returns true when `path` is a regular file (or a link to one) with an execute bit set.

# `resolve`

```elixir
@spec resolve(keyword()) :: {:ok, Path.t()} | {:error, error()}
```

Resolves the `claude` executable.

Options, for tests:

  * `:env` - the environment map to read `CLAUDE_BRIDGE_CLI` from. Defaults to `System.get_env/0`.
  * `:find_executable` - a function that searches `PATH`. Defaults to `System.find_executable/1`.
  * `:home` - the home directory. Defaults to `System.user_home/0`.

# `version`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
