Skip to content

Fix live effort display in statusline - #39

Open
mpiton wants to merge 2 commits into
nilbuild:mainfrom
mpiton:fix-effort-statusline
Open

Fix live effort display in statusline#39
mpiton wants to merge 2 commits into
nilbuild:mainfrom
mpiton:fix-effort-statusline

Conversation

@mpiton

@mpiton mpiton commented Jun 25, 2026

Copy link
Copy Markdown

What

Fix the statusline effort indicator so it reflects the live Claude Code session effort level.

The script now reads effort.level from the JSON payload Claude Code sends to the statusline command, then falls back to ~/.claude/settings.json for older payloads or models that do not report effort. It also renders the supported xhigh and session-only max levels explicitly.

Why

max effort can be selected for the current session with /effort or --effort, but it is not persisted in settings.effortLevel. The previous implementation only read settings.effortLevel, so a session running at max could still show the persisted/default level in the custom statusline.

Changes

  • Prefer live .effort.level from statusline stdin over persisted settings.
  • Keep settings.effortLevel as a fallback for compatibility.
  • Add display cases for max and xhigh.
  • Add a shell regression test where settings contain xhigh, stdin contains max, and the statusline must display max.
  • Add npm test as the project test entrypoint.

How to Review

Start with bin/statusline.sh: the effort resolution block is the behavior change, and the display case adds the new supported levels.

Then review test/statusline.test.sh: it captures the regression by proving live stdin effort overrides persisted settings.

Testing

  • npm test
  • bash -n bin/statusline.sh test/statusline.test.sh

Risk / Deployment Notes

Low risk. This is a display-only change in the statusline script. No settings migration, dependencies, or runtime service changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant