[FEATURE] Expose rate limit / 5-hour usage data for status line and external tooling

Resolved 💬 1 comment Opened Jun 12, 2026 by SanjuEpic Closed Jun 13, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The /usage command shows the current 5-hour rate limit consumption, but this data is only accessible interactively inside a session. There's no way for external scripts — like the status line command — to read this data programmatically.

Users who set up a status line to monitor context window usage naturally want to also track how much of their 5-hour rate limit window they've consumed, but there's no file, environment variable, API endpoint, or CLI flag that exposes it.

Proposed Solution

Expose the 5-hour usage data externally via one or more of:

  • A local state file (e.g. ~/.claude/usage.json) updated after each API call
  • A CLI flag like claude --usage that outputs current usage as JSON
  • An environment variable available to status line commands

This would let users wire rate limit tracking into their status line or other monitoring tooling.

Alternative Solutions

Currently the only option is to manually run /usage inside the session and visually check. There's no workaround for automated or passive tracking.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

  1. User configures a status line script to show context window usage
  2. User also wants to see "5hr limit: 42% used" alongside the context bar
  3. The status line script reads from ~/.claude/usage.json or calls claude --usage
  4. The rate limit percentage is appended to the status line output
  5. User can pace their work and avoid hitting limits unexpectedly

Additional Context

This came up while configuring the Claude Code status line feature. Context window tracking works great via status line, but rate limit data is locked behind the interactive /usage command with no external access path.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗