{"record":{"id":"152d20868813202a","repo":"tinyhumansai/openhuman","slug":"failed-to-spawn-claude-e","errorCode":null,"errorMessage":"failed to spawn `claude`: {e}","messagePattern":"failed to spawn `claude`: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/inference/provider/claude_code/driver.rs","lineNumber":391,"sourceCode":"        (ctx.bin_path.clone(), args.clone())\n    };\n    #[cfg(not(target_os = \"macos\"))]\n    let (program, final_args): (PathBuf, Vec<String>) = (ctx.bin_path.clone(), args.clone());\n\n    let mut cmd = Command::new(&program);\n    cmd.args(&final_args)\n        .current_dir(&ctx.project_dir)\n        .stdin(Stdio::piped())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped())\n        .kill_on_drop(true);\n    if let Some(key) = &ctx.anthropic_api_key {\n        cmd.env(\"ANTHROPIC_API_KEY\", key);\n    }\n\n    let mut child = cmd\n        .spawn()\n        .map_err(|e| anyhow::anyhow!(\"failed to spawn `claude`: {e}\"))?;\n    if let Some(mut stdin) = child.stdin.take() {\n        stdin\n            .write_all(&stdin_bytes)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"write stdin: {e}\"))?;\n        stdin\n            .shutdown()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"close stdin: {e}\"))?;\n    }\n\n    let mut stdout = child\n        .stdout\n        .take()\n        .ok_or_else(|| anyhow::anyhow!(\"claude child stdout missing\"))?;\n    let mut stderr = child\n        .stderr\n        .take()","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/inference/provider/claude_code/driver.rs#L373-L409","documentation":"Spawning the `claude` CLI process failed at the OS level (command not found, permission denied, exec format error). The binary path was resolved earlier, so this is exec-time failure: the resolved path is not executable or the environment cannot launch it.","triggerScenarios":"Thrown at src/openhuman/inference/provider/claude_code/driver.rs:391 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the claude CLI binary exists and is executable at the resolved path","Reinstall or re-link the Claude Code CLI","Check the exec error kind in the wrapped error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}