Feature request: expose account usage limits (session/weekly %) in CLI
Feature request
Please expose Claude Code account usage limits in local CLI metadata/logs.
Claude Code JSONL logs currently include per-message token usage, but not the account/session/weekly usage percentage or reset times shown on https://claude.ai/settings/usage.
It would be very useful if Claude Code exposed:
- current session usage percent
- weekly usage percent
- reset timestamps
- plan tier / relevant limit bucket
- whether the values are estimated or authoritative
This would allow local status monitors (status line, external dashboards, tmux widgets, etc.) to work without browser automation against claude.ai.
The key ask
Please expose the same usage percentage and reset times shown on claude.ai/settings/usage through Claude Code CLI logs or a local command (e.g. claude usage --json, or as fields in the existing JSONL stream).
Found 3 possible duplicate issues:
- https://github.com/anthropics/claude-code/issues/38380
- https://github.com/anthropics/claude-code/issues/53601
- https://github.com/anthropics/claude-code/issues/59709
This issue will be automatically closed as a duplicate in 3 days.
- If your issue is a duplicate, please close it and 👍 the existing issue instead
- To prevent auto-closure, add a comment or 👎 this comment
🤖 Generated with Claude Code
This is exactly the visibility problem that makes AI costs so hard to manage. The account-level percentage data lives somewhere you can see in the web UI, but the CLI gives you nothing — just per-message token counts that don't add up to the account-level picture.
When you can't see your limits in the tool itself, you're flying blind until the rate limit hits. That's not a great experience at $100-200/month.
Local AI orchestration tools like OpenClaw solve this differently — usage tracking happens at the orchestration layer you control, giving you real-time visibility into request counts, context windows, and cost accumulation without waiting for the platform to expose it. The billing becomes predictable because you're measuring it yourself, not trusting a dashboard that may or may not reflect reality.
For the feature request: if the usage percentage and reset time were written to the JSONL logs alongside per-message tokens, that would give users the data they need to anticipate limits before they hit. +1 on this from a cost management perspective.
No scraping needed — the same OAuth usage endpoint Claude Code itself reads returns the four fields requested: session %, weekly %, reset timestamps, per-window plan tier. Same data the in-CLI /usage shows.
I built aistat to emit a stable shape over that endpoint for the tmux/statusline/dashboard cases. Human view:
$ aistat -h
Claude usage
- [email protected] (active) [Max 5x]
- 5-hour: 92.0% (resets in 4h 53m)
- 7-day: 71.0% (resets in 2d 5h)
- [email protected] [Max 20x]
- 5-hour: 4.0% (resets in 4h 12m)
- 7-day: 12.0% (resets in 5d 9h)
Codex usage
- [email protected] (active) [Pro]
- 5-hour: 25.0% (resets in 5h 16m)
- 7-day: 18.0% (resets in 4d 18h)
and the JSON the same data serializes to:
$ aistat usage claude
{
"checked_at": "2026-05-29T18:21:04+00:00",
"providers": {
"claude": {
"accounts": [
{"email": "[email protected]", "plan": "Max 5x", "active": true,
"limits": {
"five_hour": {"used_percent": 73.0, "remaining_percent": 27.0, "resets_at": "2026-05-29T23:14:00+00:00", "reset_after_seconds": 17580},
"seven_day": {"used_percent": 41.0, "remaining_percent": 59.0, "resets_at": "2026-06-03T03:00:00+00:00", "reset_after_seconds": 463860},
"seven_day_sonnet": {"used_percent": 12.0, "remaining_percent": 88.0, "resets_at": "2026-06-02T08:00:00+00:00", "reset_after_seconds": 395460}
}}
]
}
}
}
Until Anthropic ships first-party JSONL fields, same data without scraping. 90s cache keeps frequent polling cheap.
https://github.com/drogers0/aistat