Skip to content

Expose rate limit utilization in statusLine JSON input #25420

@YuKyeoung

Description

@YuKyeoung

Feature Request

Problem

The statusLine command receives JSON input via stdin with useful fields like cost, context_window, and model. However, rate limit utilization data is missing from this input.

Claude Code already has access to this data internally via anthropic-ratelimit-unified-* API response headers, and it's displayed through the /usage command. But custom statusLine scripts cannot access it.

Current statusLine JSON (v2.1.39)

{
  "cost": { "total_cost_usd": 10.07, ... },
  "context_window": { "used_percentage": 83, ... },
  "model": { "id": "claude-opus-4-6", "display_name": "Opus 4.6" }
}

Proposed Addition

{
  "rate_limits": {
    "five_hour": {
      "utilization": 0.45,
      "resets_at": 1739500800
    },
    "seven_day": {
      "utilization": 0.12,
      "resets_at": 1740000000
    },
    "seven_day_opus": {
      "utilization": 0.30,
      "resets_at": 1740000000
    }
  }
}

Use Case

Max plan ($200/mo) users want to monitor their rate limit consumption in real-time through custom statusLine scripts. Currently, the only way to check is via the /usage slash command, which requires manual input and interrupts workflow.

With this data exposed, users could display something like:

🕒 14:30 | 🤖 Opus 4.6 | 💰 $10.07 (45% of 5h limit) | 📊 83% ctx

Why This Matters

  • The data already exists in Claude Code's memory (parsed from API response headers)
  • /usage command already displays it — this just exposes it to statusLine
  • Minimal implementation effort — pass through existing internal state
  • High value for power users managing usage across sessions

Environment

  • Claude Code v2.1.39
  • Windows 11
  • Max 20x plan

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions