ask-strips-claudecode-env
IN premise
`_invoke_claude` removes the `CLAUDECODE` environment variable to prevent recursive invocation when running inside Claude Code.
Summary
When the system calls Claude, it deliberately clears a marker that would tell Claude it is already running inside Claude Code. This prevents an infinite loop where Claude Code spawns itself repeatedly, but it also means the inner Claude session loses awareness that it was launched from an outer one.
Dependents
These beliefs depend on this one:
- 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/29/reasons_lib-ask.md |