derive-strips-claudecode-env
IN premise
`_derive_one_round` explicitly removes the `CLAUDECODE` environment variable before spawning the model subprocess, preventing recursive Claude Code invocation.
Summary
The derive command intentionally prevents the AI model it calls from launching another instance of Claude Code inside itself. It does this by stripping out the environment variable that would signal "you're running inside Claude Code," which stops infinite nesting where a derive call could accidentally trigger another derive call.
Dependents
These beliefs depend on this one:
- derive-pipeline-is-defensive — The derive pipeline applies multiple defensive measures: fail-soft validation, Jaccard-based retraction guard, and environment variable stripping to prevent recursive spawning
- llm-integration-is-bounded-fail-soft-and-process-isolated — LLM integration achieves three independent safety properties across all modules: execution bounds (iteration caps and timeouts), fail-soft error handling (always returns usable results on failure), and process isolation (subprocess invocation with CLAUDECODE environment stripping to prevent recursive entry)
Details
| Source | entries/2026/04/23/reasons_lib-cli.md |