diff --git a/cross_eval/runtime_env.py b/cross_eval/runtime_env.py index caa5a77..6e5cc62 100644 --- a/cross_eval/runtime_env.py +++ b/cross_eval/runtime_env.py @@ -94,6 +94,9 @@ def build_runtime_environment( ) -> tuple[dict[str, str], list[Path], dict[str, str]]: """Build subprocess env plus metadata about loaded files and names.""" env = os.environ.copy() if execution.inherit_env else {} + # Remove CLAUDECODE to avoid "nested session" errors when spawning + # Claude Code as a subprocess from within a Claude Code session. + env.pop("CLAUDECODE", None) loaded_files = resolve_env_files(execution, project_root) loaded_values: dict[str, str] = {} for path in loaded_files: