claude-code - 💡(How to fix) Fix Expose per-model weekly usage in statusline hook payload [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52661Fetched 2026-04-24 10:43:06
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Timeline (top)
labeled ×3

Code Example

{
  "rate_limits": {
    "five_hour": { "used_percentage": 66, "resets_at": 1776999600 },
    "seven_day": { "used_percentage": 21, "resets_at": 1777212000 }
  }
}

---

{
  "rate_limits": {
    "five_hour": { "used_percentage": 66, "resets_at": 1776999600 },
    "seven_day": { "used_percentage": 21, "resets_at": 1777212000 },
    "seven_day_sonnet": { "used_percentage": 15, "resets_at": 1777212000 },
    "seven_day_opus": { "used_percentage": 5, "resets_at": 1777212000 }
  }
}

---

| 5hr (22:00): 63%, wk: 20% (son: 15%) (resets Sun 09:00) |
RAW_BUFFERClick to expand / collapse

Feature Request

The rate_limits object in the statusline hook JSON input currently only exposes two fields:

{
  "rate_limits": {
    "five_hour": { "used_percentage": 66, "resets_at": 1776999600 },
    "seven_day": { "used_percentage": 21, "resets_at": 1777212000 }
  }
}

The Claude.ai usage page shows per-model weekly meters (e.g. Sonnet-only, Opus-only). Claude Max subscribers have separate weekly limits per model, but this breakdown isn't forwarded to the statusline hook.

Requested Change

Expose per-model weekly usage in the hook payload, e.g.:

{
  "rate_limits": {
    "five_hour": { "used_percentage": 66, "resets_at": 1776999600 },
    "seven_day": { "used_percentage": 21, "resets_at": 1777212000 },
    "seven_day_sonnet": { "used_percentage": 15, "resets_at": 1777212000 },
    "seven_day_opus": { "used_percentage": 5, "resets_at": 1777212000 }
  }
}

Use Case

Custom statusline scripts can then display model-specific weekly burn rates alongside the existing aggregate limit, e.g.:

| 5hr (22:00): 63%, wk: 20% (son: 15%) (resets Sun 09:00) |

extent analysis

TL;DR

Modify the statusline hook JSON input to include per-model weekly usage in the rate_limits object.

Guidance

  • Review the current implementation of the statusline hook to understand how the rate_limits object is populated.
  • Identify the source of the per-model weekly usage data, potentially in the Claude.ai usage page.
  • Update the statusline hook to include the per-model weekly usage data in the rate_limits object, using a format similar to the requested change.
  • Verify that the updated hook payload is correctly formatted and includes the expected per-model weekly usage data.

Example

{
  "rate_limits": {
    "five_hour": { "used_percentage": 66, "resets_at": 1776999600 },
    "seven_day": { "used_percentage": 21, "resets_at": 1777212000 },
    "seven_day_sonnet": { "used_percentage": 15, "resets_at": 1777212000 },
    "seven_day_opus": { "used_percentage": 5, "resets_at": 1777212000 }
  }
}

Notes

The implementation details of the statusline hook and the source of the per-model weekly usage data are not provided, so the exact steps to modify the hook may vary.

Recommendation

Apply workaround: Modify the statusline hook to include per-model weekly usage data, as this will provide the required information for custom statusline scripts to display model-specific weekly burn rates.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Expose per-model weekly usage in statusline hook payload [1 participants]