claude-code - 💡(How to fix) Fix Add effort level to statusline JSON input [2 comments, 3 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#52475Fetched 2026-04-24 06:06:13
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2closed ×1

The custom statusline command (statusLine setting) receives a JSON object via stdin with fields like model, workspace, context_window, cost, rate_limits, etc. — but does not include the current effort level.

Root Cause

There's no way to display the per-instance effort level in a custom statusline because:

Fix Action

Fix / Workaround

Reading effortLevel from settings.json is a partial workaround, but breaks when:

  • Multiple Claude Code instances run with different effort levels
  • Effort is set via --effort <level> CLI argument
  • Effort is changed mid-session via /effort <level>

Code Example

{
  "effort_level": "max",
  ...existing fields...
}
RAW_BUFFERClick to expand / collapse

Summary

The custom statusline command (statusLine setting) receives a JSON object via stdin with fields like model, workspace, context_window, cost, rate_limits, etc. — but does not include the current effort level.

Problem

There's no way to display the per-instance effort level in a custom statusline because:

  1. The effort level is not in the statusline JSON input
  2. settings.json only has the global default — not the per-session override
  3. The --effort CLI argument and /effort command both set session-scoped values that are invisible to the statusline script

Reading effortLevel from settings.json is a partial workaround, but breaks when:

  • Multiple Claude Code instances run with different effort levels
  • Effort is set via --effort <level> CLI argument
  • Effort is changed mid-session via /effort <level>

Proposed Solution

Add an effort_level (or effort) field to the JSON object passed to the statusline command:

{
  "effort_level": "max",
  ...existing fields...
}

This should reflect the current session's effective effort level, accounting for CLI args and /effort overrides.

Context

The statusline already exposes output_style.name — effort level is a similar per-session setting that users would want to display.

extent analysis

TL;DR

Add an effort_level field to the JSON object passed to the statusline command to display the current session's effective effort level.

Guidance

  • Verify that the proposed solution is feasible by checking if the statusline command can be modified to include the effort_level field in the JSON object.
  • Consider the implications of adding a new field to the JSON object, such as potential backwards compatibility issues.
  • To implement the solution, update the code that generates the JSON object to include the current session's effort level, taking into account CLI arguments and /effort overrides.
  • Test the updated statusline command with different effort levels and scenarios to ensure it works as expected.

Example

{
  "effort_level": "max",
  "model": "...",
  "workspace": "...",
  "context_window": "...",
  "cost": "...",
  "rate_limits": "..."
}

Notes

The proposed solution assumes that the effort level can be determined at the time the JSON object is generated. If this is not the case, additional modifications may be needed to update the effort level in real-time.

Recommendation

Apply the proposed workaround by adding an effort_level field to the JSON object, as it provides a straightforward solution to display the current session's effective effort level in the custom statusline.

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