Skip to content

statusline: context box format is not configurable #114

Description

@maxwellsdm1867

Problem

The context box rendered by wheeler-statusline.js has no configuration surface. The token count, the percentage, the bar, the element order, and the severity color thresholds are all literals inside the render path. A user who wants any layout other than the shipped one has to hand edit the installed hook at ~/.claude/hooks/wheeler-statusline.js, and the installer overwrites that file on every install and update (wheeler/installer.py:372-380 unlinks the destination and recopies unconditionally), so the customization is silently lost.

Notably, the statusline consumes context_window from the statusline stdin payload but renders only a bar and a percentage. The raw token count is available in that payload and is never shown, which is the single most requested number.

Steps to reproduce

  1. Install Wheeler so that ~/.claude/settings.json has "statusLine": {"type": "command", "command": "node \"~/.claude/hooks/wheeler-statusline.js\""}.
  2. Decide you want the context segment to read 62.7k (7%) ██░░░░░░░░ instead of the shipped ██░░░░░░░░ 7%.
  3. Look for any Wheeler config key, env var, or /wh: command that changes it. There is none.
  4. Hand edit ~/.claude/hooks/wheeler-statusline.js.
  5. Run a Wheeler install or update. The edit is gone.

Error output

There is no error. The failure is silent on both ends: no config surface to discover, and no warning when the hand edit is discarded.

The shipped render path, with every format decision inlined:

const AUTO_COMPACT_BUFFER_PCT = 16.5;
if (used < 50) {
  ctx = ` \x1b[32m${bar} ${used}%\x1b[0m`;
} else if (used < 65) {
  ctx = ` \x1b[33m${bar} ${used}%\x1b[0m`;
} else if (used < 80) {
  ctx = ` \x1b[38;5;208m${bar} ${used}%\x1b[0m`;
} else {
  ctx = ` \x1b[5;31m${bar} ${used}%\x1b[0m`;
}
...
process.stdout.write(
  `${wheelerUpdate}${gsdUpdate}\x1b[2m${model}\x1b[0m │ \x1b[2m${dirname}\x1b[0m${ctx}`
);

Fields available in the statusline stdin payload but unused by the renderer:

"context_window": {
  "total_input_tokens": 52846,
  "context_window_size": 1000000,
  "current_usage": {
    "input_tokens": 2,
    "output_tokens": 443,
    "cache_creation_input_tokens": 770,
    "cache_read_input_tokens": 52074
  },
  "used_percentage": 5,
  "remaining_percentage": 95
}

Expected behavior

A user can change the context box presentation through Wheeler, without editing an installed file, and the choice survives install and update. At minimum the following should be controllable: whether the raw token count is shown, whether the percentage is shown, whether the bar is shown, the order of those elements, and the severity color thresholds.

Actual behavior

None of it is controllable. Every one of those is a literal in the render path of a file the installer owns and overwrites.

Affected components

  • wheeler/_data/hooks/wheeler-statusline.js (the renderer, and the file users are currently forced to edit)
  • wheeler/installer.py:362-380 (the copy loop that discards local edits)
  • Wherever Wheeler user level configuration is read, for the new setting to live

Acceptance criteria

  • The context box presentation can be changed without editing any file under ~/.claude/hooks/.
  • Showing the raw context token count is supported, formatted compactly (for example 62.7k, 1.2M).
  • The order of token count, percentage, and bar is controllable.
  • The severity color thresholds are controllable, not fixed at 50/65/80.
  • A configured context box renders identically before and after a Wheeler install or update.
  • With no configuration set, the rendered output is unchanged from today's default.
  • The renderer still degrades gracefully when context_window or its subfields are absent, rather than printing a blank or broken segment.
  • Existing tests still pass.

Scope boundaries

  • Do not change the update badge, GSD badge, model, or directory segments.
  • Do not change wrapper mode (--wrap-b64) behavior.
  • This issue is only about the context box being configurable, not about which percentage the box should report. That is a separate issue.

Context

  • Severity: Medium
  • Workaround: Hand edit ~/.claude/hooks/wheeler-statusline.js. This works until the next install or update, then it is silently reverted.
  • Session: User wanted the raw context token count alongside the existing bar, in the style of ccstatusline's context-length widget. Getting to 62.7k (7%) ██░░░░░░░░ took four successive hand patches to the installed hook, all of which are now scheduled for deletion by the next /wh:update.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions