diff --git a/crates/goose/src/providers/claude_code.rs b/crates/goose/src/providers/claude_code.rs index 73e5205ad8b9..89fe6fef4482 100644 --- a/crates/goose/src/providers/claude_code.rs +++ b/crates/goose/src/providers/claude_code.rs @@ -198,6 +198,8 @@ impl ClaudeCodeProvider { fn build_stream_json_command(&self) -> Command { let mut cmd = Command::new(&self.command); configure_subprocess(&mut cmd); + // Allow goose to run inside a Claude Code session. + cmd.env_remove("CLAUDECODE"); cmd.arg("--input-format") .arg("stream-json") .arg("--output-format")