Skip to content

Commit c8ccc28

Browse files
committed
fix: strip CLAUDECODE env vars to allow running inside Claude Code session
When the Electron app is launched from inside another Claude Code session (e.g. Conductor), CLAUDECODE=1 is inherited into process.env and forwarded to the spawned Claude binary, which detects the parent marker and exits with the nested-session guard. Strip CLAUDECODE and CLAUDE_CODE_SSE_PORT from both the captured shell env and the merged final env.
1 parent 86067f7 commit c8ccc28

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/lib/claude/env.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ const STRIPPED_ENV_KEYS_BASE = [
2424
"OPENAI_API_KEY",
2525
"CLAUDE_CODE_USE_BEDROCK",
2626
"CLAUDE_CODE_USE_VERTEX",
27+
// Strip nested-session markers so the spawned Claude binary doesn't detect
28+
// a parent Claude Code session and refuse to start. This happens when the
29+
// Electron app itself is launched from inside Claude Code (e.g. Conductor).
30+
"CLAUDECODE",
31+
"CLAUDE_CODE_SSE_PORT",
2732
]
2833

2934
// In dev mode, also strip ANTHROPIC_API_KEY so OAuth token is used instead

0 commit comments

Comments
 (0)