claude-code - 💡(How to fix) Fix [BUG] /effort session command does not override effortLevel in settings.json [2 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#47820Fetched 2026-04-15 06:41:23
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5commented ×2closed ×1cross-referenced ×1

Fix Action

Fix / Workaround

Workaround: Remove effortLevel from settings.json entirely, so /effort commands can take effect during sessions.

Code Example

function resolveEffort():
  if env.CLAUDE_CODE_EFFORT_LEVEL:    return env value
  if session.effortLevel:              return session value   // ← this check is missing or broken
  if cli.effort:                       return cli value
  if settings.effortLevel:             return settings value
  return model default

---

{ "effortLevel": "high" }
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When effortLevel is set in ~/.claude/settings.json (e.g., "high"), using the /effort max slash command during a session has no effect — the status line continues to display the value from settings.json, and the API calls appear to use the settings file value rather than the session override.

The /effort command exists specifically to allow per-session overrides, but the current precedence logic appears to resolve settings.json at a higher priority than the in-session command, making the slash command a no-op whenever a persistent setting exists.

This is distinct from #30726 (which is about the max value being silently downgraded by the UI). This bug affects any effort level transition via /effort when settings.json defines effortLevel — not just max.

What Should Happen?

The /effort session command should take precedence over settings.json for the duration of the session. The expected precedence (highest to lowest) should be:

  1. Environment variable (CLAUDE_CODE_EFFORT_LEVEL)
  2. Session-level /effort command
  3. CLI flag (--effort)
  4. settings.json / settings.local.json
  5. Model default

Fix Proposal

The effort level resolution likely reads from a single source (settings file) without checking for a session-scoped override. The fix would be:

  1. When /effort <level> is invoked, store the value in session-scoped state (not in settings.json)
  2. In the effort resolution logic, check session state before falling back to settings.json
  3. Ensure the status line reads from the same resolved value

Pseudocode:

function resolveEffort():
  if env.CLAUDE_CODE_EFFORT_LEVEL:    return env value
  if session.effortLevel:              return session value   // ← this check is missing or broken
  if cli.effort:                       return cli value
  if settings.effortLevel:             return settings value
  return model default

Steps to Reproduce

  1. Set effortLevel to "high" in ~/.claude/settings.json:
    { "effortLevel": "high" }
  2. Start a new Claude Code session
  3. Run /effort max
  4. Observe the status line — still shows effort: high
  5. Remove effortLevel from settings.json and repeat — /effort max now works as expected

Claude Model

Opus

Is this a regression?

I don't know

Claude Code Version

2.1.107

Platform

Anthropic API (Max subscription)

Operating System

macOS (Darwin 25.3.0, arm64)

Terminal/Shell

zsh / iTerm2

Additional Information

Related issues:

  • #30726 — max effort silently downgraded by the UI (different: UI overwrites settings value)
  • #37303 — effort not persisted for Max mode, no per-session isolation
  • #40093 — banner shows max but runtime uses medium

Workaround: Remove effortLevel from settings.json entirely, so /effort commands can take effect during sessions.

extent analysis

TL;DR

The issue can be fixed by modifying the effort level resolution logic to prioritize session-scoped overrides over settings.json values.

Guidance

  • The current implementation reads from a single source (settings file) without checking for a session-scoped override, causing the /effort command to be ignored when effortLevel is set in settings.json.
  • To fix this, store the /effort command value in session-scoped state and check this state before falling back to settings.json in the effort resolution logic.
  • Ensure the status line reads from the same resolved value to reflect the correct effort level.
  • As a temporary workaround, removing effortLevel from settings.json allows the /effort command to take effect during sessions.

Example

def resolve_effort():
  if 'CLAUDE_CODE_EFFORT_LEVEL' in os.environ:
    return os.environ['CLAUDE_CODE_EFFORT_LEVEL']
  if hasattr(session, 'effortLevel'):
    return session.effortLevel
  # ... (rest of the resolution logic)

Notes

The provided pseudocode suggests the correct approach, but the actual implementation may vary depending on the programming language and framework used. Additionally, the issue may be related to other reported issues (#30726, #37303, #40093), but the proposed fix focuses on the specific problem described.

Recommendation

Apply the proposed workaround by removing effortLevel from settings.json or implement the fix by modifying the effort level resolution logic to prioritize session-scoped overrides. This will ensure that the /effort command takes precedence over settings.json values during sessions.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING