From 30fd2aa59d0d437f44426e47b8325ef86e3543d5 Mon Sep 17 00:00:00 2001 From: deadmanoz Date: Fri, 11 Jul 2025 17:21:06 +0800 Subject: [PATCH 1/2] Improve Claude Code provider error message for missing CLI The previous error "Failed to spawn command: No such file or directory" was unclear for users when the Claude CLI wasn't installed or in PATH. The new error message shows the exact command that failed and provides clear guidance on how to fix the issue, including mentioning the CLAUDE_CODE_COMMAND config option. Signed-off-by: deadmanoz --- crates/goose/src/providers/claude_code.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/goose/src/providers/claude_code.rs b/crates/goose/src/providers/claude_code.rs index 823afb6a71a3..cb8d3d8db96f 100644 --- a/crates/goose/src/providers/claude_code.rs +++ b/crates/goose/src/providers/claude_code.rs @@ -273,7 +273,11 @@ impl ClaudeCodeProvider { let mut child = cmd .spawn() - .map_err(|e| ProviderError::RequestFailed(format!("Failed to spawn command: {}", e)))?; + .map_err(|e| ProviderError::RequestFailed(format!( + "Failed to spawn Claude CLI command '{}': {}. \ + Make sure the Claude CLI is installed and in your PATH, or set CLAUDE_CODE_COMMAND in your config to the correct path.", + self.command, e + )))?; let stdout = child .stdout From c1a00f31b90e7986ba7cb1b4c94a31dc77c5d996 Mon Sep 17 00:00:00 2001 From: deadmanoz <62584182+deadmanoz@users.noreply.github.com> Date: Sat, 12 Jul 2025 11:09:46 +0800 Subject: [PATCH 2/2] Update crates/goose/src/providers/claude_code.rs Review feedback Co-authored-by: Alex Hancock Signed-off-by: deadmanoz --- crates/goose/src/providers/claude_code.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/goose/src/providers/claude_code.rs b/crates/goose/src/providers/claude_code.rs index cb8d3d8db96f..81d45171ec03 100644 --- a/crates/goose/src/providers/claude_code.rs +++ b/crates/goose/src/providers/claude_code.rs @@ -275,7 +275,7 @@ impl ClaudeCodeProvider { .spawn() .map_err(|e| ProviderError::RequestFailed(format!( "Failed to spawn Claude CLI command '{}': {}. \ - Make sure the Claude CLI is installed and in your PATH, or set CLAUDE_CODE_COMMAND in your config to the correct path.", + Make sure the Claude Code CLI is installed and in your PATH, or set CLAUDE_CODE_COMMAND in your config to the correct path.", self.command, e )))?;