Repository navigation
fix(statusline): show the 7-day quota alone when the plan has no 5-hour limit - #18
Conversation
…ur limit
Plans without a 5-hour limit report no five_hour rate limit, and the
quota segment needed both windows, so it showed "🚦 -". It now shows the
windows it has ("🚦 7d:45%", one bar on desktop), colored by the highest,
and a dash only with neither, as `shelltime cc statusline` does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🤖 Claude Code · Make five-hour usage limits optional in status displaysUpdated Claude/ChatGPT usage handling so five-hour limit information is only shown when the provider API actually reports that limit.
7.5M tokens: 1.9K input · 36.2K output · 7.3M cache read · 152K cache write 📝 AI summaryReworked rate-limit and status data handling across the CLI daemon, including Applied the corresponding behavior to the adjacent Claude Code plugin in View this session on ShellTime → Updated 2026-11-20 14:21 UTC by ShellTime · totals for the whole session so far · the session page is visible to its owner |
Problem
Some Claude plans no longer have a 5-hour limit. Anthropic's usage API returns
"five_hour": nullfor them, so Claude Code reports only aseven_dayrate limit.quotaSegmentneeded both windows, so the 🚦 segment showed-even though the 7-day figure was there.Fix
quotaSegmentbuilds its value and meters from the windows that are present:🚦 7d:45%(or🚦 5h:55%), colored by the highest window shown-only when there are none, still linked to claude.ai usageThis matches
shelltime cc statuslineafter shelltime/cli#354.Testing
segments.test.ts: 7d-only and 5h-only segments, their colors and meters.register.test.ts: an engine that reports onlyseven_daydraws🚦 7d:45%in the terminal and a single quota bar on desktop.world()now takes the rate limits as a parameter.noFiveHourfixture, withNoFiveHourstories for Terminal and Desktop, plus terminal and desktop spec checks.claude plugin test plugins/shelltime-statusline: 37 pass.pnpm test: 33 pass.pnpm typecheckis clean.claude plugin validatepasses, with only its usual hooks-module warning.tsc -p plugins/shelltime-statuslinestill reports one error inhooks/sessionEnd.test.ts. That error is also onmain, and this PR doesn't touch the file.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.