claude-code - 💡(How to fix) Fix BUG: Opus 4.7 ignores CLAUDE_CODE_EFFORT_LEVEL and settings.json effortLevel on session start [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52534Fetched 2026-04-24 06:04:37
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Root Cause

Root cause (from binary analysis)

Fix Action

Fix / Workaround

Any multi-agent setup on Opus 4.7 runs at maximum effort + maximum thinking cost on every session start. For a 3-agent team running 24/7, this is 3x the intended quota burn with no programmatic workaround. The only fix is a human typing /effort in each terminal after every restart.

Code Example

# Set via env var
CLAUDE_CODE_EFFORT_LEVEL=high claude

# Or set in settings.json
echo '{"effortLevel": "high"}' > ~/.claude/settings.json
claude
RAW_BUFFERClick to expand / collapse

Opus 4.7 sessions always start at xhigh effort regardless of CLAUDE_CODE_EFFORT_LEVEL env var or effortLevel in ~/.claude/settings.json. Only the interactive /effort command changes it. This breaks autonomous multi-agent workflows where agents restart without human intervention.

Repro

# Set via env var
CLAUDE_CODE_EFFORT_LEVEL=high claude

# Or set in settings.json
echo '{"effortLevel": "high"}' > ~/.claude/settings.json
claude

Both result in xhigh on Opus 4.7. Session starts at max burn rate.

Root cause (from binary analysis)

The uEH() resolver honors the env var, but a UI-level code path forces xhigh for Opus 4.7 when unpinOpus47LaunchEffort is false — which it is on every fresh session start, regardless of persisted state. The flag is only set to true when the user interactively uses /effort, creating a chicken-and-egg: the programmatic setting works at the API level but the UI overrides it before the first API call.

Additionally, CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING only matches opus-4-6 and sonnet-4-6 model strings — it silently does nothing on opus-4-7. Users who set this env var expecting it to work on 4.7 (as we did) are running at full adaptive thinking cost without knowing it.

Impact

Any multi-agent setup on Opus 4.7 runs at maximum effort + maximum thinking cost on every session start. For a 3-agent team running 24/7, this is 3x the intended quota burn with no programmatic workaround. The only fix is a human typing /effort in each terminal after every restart.

Related: #49538 (UI display bug), #49809 (closed as dup), #50309 (per-teammate effort feature request). This issue is about the env var and settings.json being ignored at the runtime level, not just the UI display.

Expected behavior

CLAUDE_CODE_EFFORT_LEVEL=high and settings.json effortLevel: "high" should be respected on session start for all models including Opus 4.7. The unpinOpus47LaunchEffort gate should not override explicit user configuration.

extent analysis

TL;DR

Set unpinOpus47LaunchEffort to true or use the /effort command interactively to override the default xhigh effort level for Opus 4.7 sessions.

Guidance

  • Investigate modifying the code to respect the CLAUDE_CODE_EFFORT_LEVEL env var and effortLevel in ~/.claude/settings.json for Opus 4.7 sessions.
  • Consider adding a programmatic way to set unpinOpus47LaunchEffort to true to avoid the UI-level override.
  • Verify that the CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING env var is not set or is set to a correct model string to avoid unintended adaptive thinking costs.
  • Test the /effort command as a temporary workaround to change the effort level after session start.

Example

No code snippet is provided as the issue does not imply a specific code change.

Notes

The provided information suggests a code-level issue with the unpinOpus47LaunchEffort flag and the UI-level override. Without access to the codebase, it's challenging to provide a definitive fix. The guidance points are intended to help investigate and potentially mitigate the issue.

Recommendation

Apply workaround: Use the /effort command interactively to change the effort level after session start, as a programmatic fix may require code changes that are not immediately available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

CLAUDE_CODE_EFFORT_LEVEL=high and settings.json effortLevel: "high" should be respected on session start for all models including Opus 4.7. The unpinOpus47LaunchEffort gate should not override explicit user configuration.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING