{"record":{"id":"2491d01ba9a2e298","repo":"tinyhumansai/openhuman","slug":"claude-code-claude-cli-not-installed-install","errorCode":null,"errorMessage":"[claude-code] `claude` CLI not installed. Install Claude Code CLI ({}) >= {} and retry.","messagePattern":"\\[claude-code\\] `claude` CLI not installed\\. Install Claude Code CLI \\((.+?)\\) >= (.+?) and retry\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/inference/provider/claude_code/mod.rs","lineNumber":135,"sourceCode":"    /// in. Errors when the CLI is not installed or below `MIN_CLI_VERSION`.\n    pub fn from_env(\n        model: impl Into<String>,\n        workspace_dir: PathBuf,\n        project_dir: PathBuf,\n    ) -> anyhow::Result<Self> {\n        match version_check::probe() {\n            types::CliStatus::Ok { path, .. } => {\n                let (_, key) = auth::resolve();\n                Ok(Self::new(\n                    model,\n                    PathBuf::from(path),\n                    workspace_dir,\n                    project_dir,\n                    key,\n                ))\n            }\n            types::CliStatus::NotInstalled => {\n                anyhow::bail!(\n                    \"[claude-code] `claude` CLI not installed. Install Claude Code CLI \\\n                     ({}) >= {} and retry.\",\n                    \"https://docs.anthropic.com/en/docs/claude-code\",\n                    types::MIN_CLI_VERSION\n                )\n            }\n            types::CliStatus::Outdated {\n                version,\n                min_required,\n                path,\n            } => anyhow::bail!(\n                \"[claude-code] `claude` CLI at {} is version {}; require >= {}\",\n                path,\n                version,\n                min_required\n            ),\n            types::CliStatus::Unusable { path, reason } => anyhow::bail!(\n                \"[claude-code] `claude` CLI at {} unusable: {}\",","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/inference/provider/claude_code/mod.rs#L117-L153","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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`.","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).","After installing, retry the chat request — the factory re-probes on each provider construction.","Alternatively switch the role's provider to a hosted provider that needs no local CLI."],"exampleFix":"# shell — install and verify\nnpm install -g @anthropic-ai/claude-code\nclaude --version   # must print >= MIN_CLI_VERSION","handlingStrategy":"validation","validationCode":"// Pre-flight before selecting the claude-code provider:\nuse claude_code::version_check;\nif matches!(version_check::probe(), types::CliStatus::NotInstalled) {\n    return fallback_or_prompt_install(); // don't route workloads here\n}","typeGuard":"fn claude_cli_available() -> bool {\n    std::process::Command::new(\"claude\")\n        .arg(\"--version\")\n        .stdout(std::process::Stdio::piped())\n        .stderr(std::process::Stdio::null())\n        .output()\n        .is_ok_and(|o| o.status.success())\n}","tryCatchPattern":null,"preventionTips":["Install the CLI as part of environment provisioning (npm global or native installer).","For GUI-launched apps, ensure the CLI's bin dir is on the launched process's PATH.","Offer a hosted-provider fallback when the CLI is absent."],"tags":["claude-code","cli-not-found","installation","path"],"backgroundTag":"cli-binary-not-found","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}