Feature request: Per-session usage/contribution to 5h and 7d rate limit windows

Resolved 💬 2 comments Opened Mar 1, 2026 by vildanbina Closed Mar 29, 2026

Problem

When running multiple Claude Code sessions in parallel, there is no way to determine how much of the 5-hour or 7-day rate limit each individual session has consumed.

The existing /usage command and anthropic-ratelimit-unified-5h-utilization headers show account-wide utilization only. The OAuth endpoint (/api/oauth/usage) also returns aggregate utilization. Local JSONL files contain raw token counts per session, but converting those to a percentage of the rate limit is impossible because:

  1. The absolute token limits for 5h/7d windows are not published
  2. Different token types (input, output, cache) may be weighted differently toward quota
  3. Different models (Opus vs Sonnet) may consume quota at different rates

Use Case

As a Claude Max user running 3+ parallel sessions, I want to understand which sessions are consuming the most quota so I can:

  • Identify expensive sessions and optimize my usage
  • Make informed decisions about which sessions to continue vs pause
  • Debug why I'm hitting rate limits faster than expected

Proposed Solutions (any of these would help)

  1. Expose per-session utilization in the unified rate limit headers — Include a anthropic-ratelimit-unified-5h-session-contribution header (or similar) that shows how much this specific session has contributed to the 5h/7d windows
  1. Add a per-session breakdown to the OAuth /api/oauth/usage endpoint — Accept a session_id parameter or return a breakdown by session
  1. Expose the unified rate limit headers to hooks/statusline — At minimum, expose anthropic-ratelimit-unified-5h-utilization and anthropic-ratelimit-unified-7d-utilization in the statusline stdin JSON or hook payloads (this alone solves the single-session case and enables community tools to build proportional attribution)
  1. Publish the absolute token limits — If the 5h/7d limits were known in absolute token terms (even approximately), community tools could compute per-session percentages from JSONL data

Related Issues

  • #29604 — Expose rate limit data to hooks
  • #19385, #20636, #28999 — Similar requests for rate limit visibility
  • #11917 — Expose usage metrics in session JSON
  • #3626 / #4222 — Display remaining 5-hour quota

Environment

  • Claude Code on Linux/WSL
  • Claude Max subscription
  • Multiple parallel sessions via tmux

View original on GitHub ↗

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