claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Feature Request: Include usage data in status line JSON input

Open PetePeter opened this issue 3 months ago • 8 comments

Feature Request

The status line command receives JSON input with session information, but it currently lacks token usage data that would be useful for displaying in the status bar.

Current Behavior

The JSON input to status line commands includes:

  • model information
  • workspace/directory info
  • cost data (total_cost_usd)
  • exceeds_200k_tokens flag

Requested Enhancement

Please include usage data for rate limit windows:

{
  "usage": {
    "five_hour_window": {
      "tokens_used": 50000,
      "token_limit": 100000
    },
    "weekly_window": {
      "tokens_used": 200000,
      "token_limit": 500000
    }
  }
}

Use Case

This would allow users to display their current usage percentage in their status line (e.g., "5h: 50% | Week: 40%"), making it easier to monitor API limits at a glance without running /usage command.

Workarounds Attempted

  • No HTTP API endpoint available for usage data
  • claude usage command has no JSON output flag
  • No cached usage file accessible
  • Usage data is only available interactively via /usage command

This would be a simple addition to the existing JSON structure that powers the status line feature.

PetePeter avatar Sep 30 '25 01:09 PetePeter

Additional Enhancement: Multi-line Status Line Support

To make this feature truly useful, it would be beneficial to also add multi-line status line support.

Current Limitation

According to the status line documentation, only the first line of stdout is displayed:

"The first line of stdout from your command becomes the status line text"

Why Multi-line Support Matters

With usage data available in the JSON input, users would want to display comprehensive information similar to the /usage command output:

Current session:  █▌░░░░░░░░░░░░░░░░░░░░░░░░░ 3% used | Resets 3pm
Week (all):       ▌░░░░░░░░░░░░░░░░░░░░░░░░░░ 1% used | Resets Oct 9, 4pm  
Week (Opus):      ░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% used

This requires multiple lines to display different usage metrics (session, weekly all models, weekly Opus) with their respective progress bars.

Current Workaround

Some third-party tools like ccstatusline have found ways to create multi-line displays, but this isn't native functionality. Having official multi-line support would enable users to:

  1. Display usage data across multiple lines for better readability
  2. Show different rate limit windows separately (5-hour, weekly, per-model)
  3. Include progress bars alongside other status information
  4. Avoid cramming all information into a single line

Proposed Enhancement

Allow status line commands to output multiple lines (e.g., 2-4 lines) that would all be displayed in the status line area, similar to how multi-line shell prompts work (PS1/PS2).

This would complement the usage data availability and make the status line truly useful for monitoring multiple metrics at a glance.

ankurdesaicopart avatar Oct 03 '25 16:10 ankurdesaicopart

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 07 '25 10:12 github-actions[bot]

No, don't close it.

Redster1 avatar Dec 09 '25 12:12 Redster1