From 095233172213366c3350322f2ed826733768b289 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sat, 14 Feb 2026 11:56:50 -0500 Subject: [PATCH] fix(claude-code): allow goose to run inside a Claude Code session Claude Code 2.1.42+ refuses to start when CLAUDECODE is set. Remove it from the child process environment. Signed-off-by: Adrian Cole --- crates/goose/src/providers/claude_code.rs | 2 ++ 1 file changed, 2 insertions(+) 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")