Bug
filterCLIEnv in internal/providers/claude_cli_session.go strips all CLAUDE_* env vars (except CLAUDE_CODE_OAUTH_TOKEN) before launching claude-cli subprocesses. This was a deliberate defensive measure to prevent session identity vars from leaking into child processes.
However, it also strips behavioral tuning vars:
CLAUDE_CODE_EFFORT_LEVEL — controls adaptive reasoning depth (low/medium/high/max)
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING — disables dynamic thinking allocation
These are not session identity vars — they're performance/cost tuning knobs. Stripping them means:
- No way to control thinking depth per agent
- All agents run at the same global default regardless of task complexity
- Significant token waste on simple tasks (e.g. Scout doing lookups at full thinking depth)
Additionally, ClaudeCLIProvider doesn't wire the existing reasoning config (OptThinkingLevel) into --effort CLI flags, so the DB-level per-agent effort config is dead code for claude-cli agents.
Expected Behavior
- Behavioral tuning env vars should pass through to claude-cli
- Per-agent effort level from DB config should map to
--effort CLI flag
- When explicit
--effort is set, CLAUDE_CODE_EFFORT_LEVEL env should be stripped to avoid precedence ambiguity
Versions Affected
Present since claude-cli provider was introduced (the original filterCLIEnv stripped everything).
Bug
filterCLIEnvininternal/providers/claude_cli_session.gostrips allCLAUDE_*env vars (exceptCLAUDE_CODE_OAUTH_TOKEN) before launching claude-cli subprocesses. This was a deliberate defensive measure to prevent session identity vars from leaking into child processes.However, it also strips behavioral tuning vars:
CLAUDE_CODE_EFFORT_LEVEL— controls adaptive reasoning depth (low/medium/high/max)CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING— disables dynamic thinking allocationThese are not session identity vars — they're performance/cost tuning knobs. Stripping them means:
Additionally,
ClaudeCLIProviderdoesn't wire the existing reasoning config (OptThinkingLevel) into--effortCLI flags, so the DB-level per-agent effort config is dead code for claude-cli agents.Expected Behavior
--effortCLI flag--effortis set,CLAUDE_CODE_EFFORT_LEVELenv should be stripped to avoid precedence ambiguityVersions Affected
Present since claude-cli provider was introduced (the original
filterCLIEnvstripped everything).