Skip to content

fix(statusline): show extra usage only while active, dim the cost estimate - #234

Merged
st0nefish-ci[bot] merged 1 commit into
masterfrom
fix/statusline-extra-usage-active
Nov 6, 2026
Merged

st0nefish-ci[bot] merged 1 commit into
masterfrom
fix/statusline-extra-usage-active

Conversation

@St0nefish

Copy link
Copy Markdown
Owner

Summary

The Ultra plan has no five-hour window, so the statusline's session-cost fallback (shown when no five_hour limit exists) became permanent, and the extra-usage segment stayed up all month once any credit had been spent.

  • The cost estimate is Claude Code's own list-price figure for the session (not billed on a subscription). It now always shows when above $0, dim with a ~$ prefix and no colour thresholds.
  • The ⊕ $used/$limit extra-usage segment now shows only while credits are in play: any reported limit is at 100%, the monthly cap is hit (red), or used_credits rose since the last poll (held for 10 minutes). With an unlimited cap it shows $used alone.
  • The usage endpoint is polled every 60s while credits are in play, every 5 minutes otherwise.
  • README and Extra type updated; plugin bumped to 3.4.1 (statusline is Claude-only, no Copilot mirror).

Caveats

  • The new logic in hooks/register.tsx has no tests and has not been exercised live, so the segment has not been seen appearing.
  • The "limit reports 100% when exhausted" trigger is an assumption from Anthropic's usage-credits docs, not observed. The used-credits-rose signal is the backup.
  • Prepaid balance is not shown: spend.balance was null when checked and its shape is unknown.

Test plan

  • bash .github/scripts/validate-all.sh passes (703 plugin tests, structure, frontmatter, markdown, shell lint, CI parity)
  • Independent review of the diff; three small findings fixed
  • Confirm ⊕ appears and ~$ stays dim after hitting the weekly limit

🤖 Generated with Claude Code

…imate

The Ultra plan reports no five-hour window, which made the session cost
fallback (shown when no five_hour limit exists) permanent, and the extra
usage segment stayed up all month once any credit had been spent.

- cost estimate is always shown when above $0, dim with a `~$` prefix and
  no colour thresholds
- the extra-usage segment shows only while credits are in play: a reported
  limit is at 100%, the monthly cap is hit, or used credits just rose
  (held for 10 minutes), and renders as used/limit
- poll the usage endpoint every 60s while in play, 5 minutes otherwise
- bump statusline to 3.4.1

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@st0nefish-ci
st0nefish-ci Bot enabled auto-merge November 6, 2026 17:34
@st0nefish-ci
st0nefish-ci Bot merged commit 185d7fa into master Nov 6, 2026
8 checks passed
@st0nefish-ci
st0nefish-ci Bot deleted the fix/statusline-extra-usage-active branch November 6, 2026 17:37
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