Expose /status rate-limit percentages (Session, Week, Sonnet-only) to statusLine command
Problem
The /status slash command shows three rate-limit usage percentages (Current session, Current week all-models, Current week Sonnet-only) that are extremely useful for tracking subscription budget mid-session. However these values are only visible inside the /status dialog and are not accessible to a custom statusLine.command script.
What I tried
claude --print "/status"→ returns"/status isn't available in this environment"claude --print --output-format=json "/status"→ sameccusage(community CLI) has no limits subcommand- No file under
~/.claude/(stats-cache.json,.claude.json, transcripts) contains the percentages — Anthropic'santhropic-ratelimit-*response headers are stripped before transcript persistence - OAuth-token-based API probing felt out of scope (likely ToS-grey)
Proposal
Either:
- Pass the three percentages as additional fields in the JSON the harness sends to the
statusLine.commandon every render, e.g.:
``json``
{
"rate_limits": {
"session_used_pct": 25,
"week_all_used_pct": 13,
"week_sonnet_used_pct": 0,
"session_resets_at": "2026-05-04T22:19:00Z",
"week_resets_at": "2026-05-10T03:00:00Z"
}
}
- Or expose
/statusas a programmatically callable endpoint viaclaude --print(currently it answers "isn't available in this environment") - Or write the values to a file under
~/.claude/after each render so external scripts can read the latest cached state
Why
Right now I can show cwd, model, token-cost and context-% via ccusage statusline — but I cannot mirror the exact three numbers from /status. For people on Max plans who hit weekly Sonnet caps, surfacing this in the statusline (instead of having to type /status multiple times per session) would be a real-time-budget UX win.
Environment
- Claude Code 2.1.x
- macOS / VS Code extension
claude_maxplan,organizationRateLimitTier: default_claude_max_5x
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗