Expose /status rate-limit percentages (Session, Week, Sonnet-only) to statusLine command

Resolved 💬 3 comments Opened May 4, 2026 by marketer-ux-team Closed May 8, 2026

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" → same
  • ccusage (community CLI) has no limits subcommand
  • No file under ~/.claude/ (stats-cache.json, .claude.json, transcripts) contains the percentages — Anthropic's anthropic-ratelimit-* response headers are stripped before transcript persistence
  • OAuth-token-based API probing felt out of scope (likely ToS-grey)

Proposal

Either:

  1. Pass the three percentages as additional fields in the JSON the harness sends to the statusLine.command on 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"
}
}
``

  1. Or expose /status as a programmatically callable endpoint via claude --print (currently it answers "isn't available in this environment")
  2. 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_max plan, organizationRateLimitTier: default_claude_max_5x

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗