Expose session and account token usage data in statusline JSON payload

Resolved 💬 2 comments Opened Mar 24, 2026 by uwestrepp Closed Mar 24, 2026

Summary

The statusline command receives a JSON payload with context window data (context_window.current_usage.input_tokens, context_window.context_window_size, etc.), which is great for showing how full the current context is.

However, there is no way to display session-level or account-level token usage and limits (e.g. daily/weekly/monthly consumption, plan limits) in the statusline — that data is only available via the interactive /usage command.

Proposal

Extend the statusline JSON payload with a usage object, for example:

{
  "usage": {
    "session": {
      "input_tokens": 42000,
      "output_tokens": 18000
    },
    "account": {
      "period": "monthly",
      "used_tokens": 5200000,
      "limit_tokens": 50000000,
      "used_percentage": 10.4
    }
  }
}

The exact shape can differ — the key ask is making session and account usage accessible to the statusline script so users can monitor consumption at a glance without running /usage.

Use Case

Custom statusline scripts (configured via settings.jsonstatusline_command) can then show real-time usage alongside context window info, helping users stay aware of their consumption during longer sessions.

View original on GitHub ↗

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