Skip to content

fix: unset CLAUDECODE env var to allow Agent SDK inside Claude Code s…#115

Open
Rahulseh1998 wants to merge 1 commit intoTraderAlice:masterfrom
Rahulseh1998:fix/agent-sdk-nested-claudecode
Open

fix: unset CLAUDECODE env var to allow Agent SDK inside Claude Code s…#115
Rahulseh1998 wants to merge 1 commit intoTraderAlice:masterfrom
Rahulseh1998:fix/agent-sdk-nested-claudecode

Conversation

@Rahulseh1998
Copy link
Copy Markdown

…essions

When OpenAlice is launched from within a Claude Code terminal session, the CLAUDECODE environment variable is inherited by the process. When the Agent SDK then spawns a Claude Code subprocess, it detects this variable and refuses to start with "Claude Code cannot be launched inside another Claude Code session" (exit code 1).

Fix: delete CLAUDECODE from the spawned process environment so the subprocess starts cleanly. This is safe because each Agent SDK query is an independent, non-interactive session.

…essions

When OpenAlice is launched from within a Claude Code terminal session,
the CLAUDECODE environment variable is inherited by the process. When
the Agent SDK then spawns a Claude Code subprocess, it detects this
variable and refuses to start with "Claude Code cannot be launched
inside another Claude Code session" (exit code 1).

Fix: delete CLAUDECODE from the spawned process environment so the
subprocess starts cleanly. This is safe because each Agent SDK query
is an independent, non-interactive session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant