diff --git a/README.md b/README.md index 55389041..b234b704 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,8 @@ Detailed guide: [`docs/cursor-integration.md`](./docs/cursor-integration.md) Run multiple terminals with different providers: +> Delegation compatibility: when CCS spawns child Claude sessions, it strips the `CLAUDECODE` guard variable to avoid nested-session blocking in Claude Code v2.1.39+. + ```bash # Terminal 1: Planning (Claude Pro) ccs work "design the authentication system" @@ -283,6 +285,8 @@ export CCS_CLAUDE_PATH="/path/to/claude" # Unix $env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows ``` +CCS sanitizes child Claude spawn environments by stripping `CLAUDECODE` (case-insensitive) to prevent nested-session guard failures during delegation. `CCS_CLAUDE_PATH` is still respected after this sanitization step. +
diff --git a/docs/code-standards.md b/docs/code-standards.md index 94ef0f8d..8d6182ba 100644 --- a/docs/code-standards.md +++ b/docs/code-standards.md @@ -429,6 +429,15 @@ if (needsShell) { This pattern is used in both `ClaudeAdapter` and `DroidAdapter` to ensure cross-platform consistency. +For all Claude child-process launches (delegation, adapters, proxies, helper spawners), sanitize env before spawn: + +```typescript +const cleanEnv = stripClaudeCodeEnv(mergedEnv); // case-insensitive remove of CLAUDECODE +spawn(binaryPath, args, { env: cleanEnv, stdio: 'inherit' }); +``` + +This prevents Claude Code nested-session guard failures when CCS runs inside parent Claude sessions. + --- ## React Component Standards (UI)