fix(proxy): unset CLAUDECODE env vars before spawning CLI

Allows the proxy to spawn claude CLI even when the dev server was
started from within a Claude Code session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-04 08:17:32 +00:00
co-authored by Claude Opus 4.6
parent b08fd86f41
commit 82718a3453
+5
View File
@@ -355,6 +355,11 @@ const server = createServer((req, res) => {
console.log(`[proxy] → claude -p --model ${modelFlag}${webSearch ? ' [WebSearch]' : ''} "${lastUserMsg.slice(0, 60)}..."`)
const procEnv = { ...process.env, NO_COLOR: '1', TERM: 'dumb' }
// Allow CLI to spawn even when dev server is started from inside Claude Code
delete procEnv.CLAUDECODE
delete procEnv.CLAUDE_CODE
delete procEnv.ANTHROPIC_CLAUDE_CODE
delete procEnv.CLAUDE_CODE_ENTRYPOINT
if (webSearch === true) {
delete procEnv.DISALLOWED_TOOLS
}