fix: read live effort level from stdin JSON (effort.level)#42
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The statusline currently resolves the reasoning-effort label from two
sources only:
CLAUDE_CODE_EFFORT_LEVELenvironment variable.effortLevelinsettings.json.Neither is updated when the user changes effort with the in-session
/effort <level>slash command. After running/effort max, thestatusline keeps rendering the previously persisted value (e.g.
xhigh) until the next process restart andsettings.jsonedit.Fix
Claude Code already pipes the live effort to the statusline command
under
effort.levelin the stdin JSON (see the official statuslineschema: https://code.claude.com/docs/en/statusline.md#available-data).
Prefer that field on both the Bash and PowerShell entrypoints, then
fall back through the existing chain so behaviour is unchanged when the
field is absent (older Claude Code versions or models without an
effort parameter):
Changes
statusline.sh— read.effort.levelviajqbefore consulting envand settings.
statusline.ps1— same priority order using$data.effort.level.No new dependencies; both scripts already use
jq/ConvertFrom-Jsonfor other fields.
Verification
PowerShell, on Windows 11:
Removing
effortfrom the JSON falls back tosettings.json'seffortLevel(verified: still rendersxhigh).The Bash variant mirrors the PowerShell logic line-for-line and uses
the same
jqinvocation pattern as the rest of the file.