tinyhumansai/openhuman · error · anyhow::Error

[claude-code] `claude` CLI not installed. Install Claude Cod

Error message

[claude-code] `claude` CLI not installed. Install Claude Code CLI ({}) >= {} and retry.

What it means

At provider construction, `version_check::probe()` could not find a `claude` executable anywhere on PATH (the `CliStatus::NotInstalled` arm in mod.rs). The claude-code provider shells out to the real Claude Code CLI, so the binary is a hard prerequisite. The message includes the install-docs URL and the minimum required version.

Source

Thrown at src/openhuman/inference/provider/claude_code/mod.rs:135

    /// in. Errors when the CLI is not installed or below `MIN_CLI_VERSION`.
    pub fn from_env(
        model: impl Into<String>,
        workspace_dir: PathBuf,
        project_dir: PathBuf,
    ) -> anyhow::Result<Self> {
        match version_check::probe() {
            types::CliStatus::Ok { path, .. } => {
                let (_, key) = auth::resolve();
                Ok(Self::new(
                    model,
                    PathBuf::from(path),
                    workspace_dir,
                    project_dir,
                    key,
                ))
            }
            types::CliStatus::NotInstalled => {
                anyhow::bail!(
                    "[claude-code] `claude` CLI not installed. Install Claude Code CLI \
                     ({}) >= {} and retry.",
                    "https://docs.anthropic.com/en/docs/claude-code",
                    types::MIN_CLI_VERSION
                )
            }
            types::CliStatus::Outdated {
                version,
                min_required,
                path,
            } => anyhow::bail!(
                "[claude-code] `claude` CLI at {} is version {}; require >= {}",
                path,
                version,
                min_required
            ),
            types::CliStatus::Unusable { path, reason } => anyhow::bail!(
                "[claude-code] `claude` CLI at {} unusable: {}",

View on GitHub (pinned to 7491200858)

Solutions

  1. Install the CLI: `npm install -g @anthropic-ai/claude-code` (or the native installer from the docs URL in the message), verify with `claude --version`.
  2. If already installed, ensure its bin directory is on the PATH of the process launching the core (for GUI launches, launch from a shell or fix the app's environment).
  3. After installing, retry the chat request — the factory re-probes on each provider construction.
  4. Alternatively switch the role's provider to a hosted provider that needs no local CLI.

Example fix

# shell — install and verify
npm install -g @anthropic-ai/claude-code
claude --version   # must print >= MIN_CLI_VERSION
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight before selecting the claude-code provider:
use claude_code::version_check;
if matches!(version_check::probe(), types::CliStatus::NotInstalled) {
    return fallback_or_prompt_install(); // don't route workloads here
}

Type guard

fn claude_cli_available() -> bool {
    std::process::Command::new("claude")
        .arg("--version")
        .stdout(std::process::Stdio::piped())
        .stderr(std::process::Stdio::null())
        .output()
        .is_ok_and(|o| o.status.success())
}

Prevention

When it happens

Trigger: Instantiating the claude-code chat provider via the factory when no `claude` binary resolves on PATH — e.g. the desktop app was launched from a GUI environment whose PATH lacks npm global bins, or the CLI was never installed.

Common situations: Fresh machines without the CLI; CLI installed via npm but npm's global bin dir is not on the PATH of the launching process (common on macOS GUI launches); CLI uninstalled or renamed.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/2491d01ba9a2e298. Report an issue: GitHub.