claude-code - 💡(How to fix) Fix Feature Request: Expose session cost and account balance in status line JSON input [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46329Fetched 2026-04-11 06:23:09
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×3

The status line command currently receives JSON data with model info, context window usage, and rate limits. It would be very useful to also include session cost and account balance/credits information, so users can monitor their spending directly in the status bar.

Root Cause

The status line command currently receives JSON data with model info, context window usage, and rate limits. It would be very useful to also include session cost and account balance/credits information, so users can monitor their spending directly in the status bar.

Code Example

{
  "cost": {
    "session_total_usd": 0.55,
    "session_input_tokens": 125000,
    "session_output_tokens": 42000
  }
}

---

{
  "account": {
    "remaining_credits_usd": 12.50
  }
}

---

MyProject | Opus | Context: [▓▓▓░░░░░░░] 30% | Session: $0.55
RAW_BUFFERClick to expand / collapse

Summary

The status line command currently receives JSON data with model info, context window usage, and rate limits. It would be very useful to also include session cost and account balance/credits information, so users can monitor their spending directly in the status bar.

Motivation

  • The /cost command already tracks session spending internally, but this data is only accessible via a manual command — not programmatically in the status line.
  • Users who pay per API usage want to keep an eye on their spending without interrupting their workflow.
  • Account balance is tracked on console.anthropic.com but having at least a session cost field in the status line would already be a big improvement.

Proposed additions to status line JSON

{
  "cost": {
    "session_total_usd": 0.55,
    "session_input_tokens": 125000,
    "session_output_tokens": 42000
  }
}

Optionally, if technically feasible:

{
  "account": {
    "remaining_credits_usd": 12.50
  }
}

Use case

A status line script could then display something like:

MyProject | Opus | Context: [▓▓▓░░░░░░░] 30% | Session: $0.55

This gives users real-time cost awareness without leaving their workflow.


🤖 This issue was written with Claude Code.

extent analysis

TL;DR

To address the issue, modify the status line command to include session cost and account balance information in the JSON data.

Guidance

  • Review the existing /cost command to understand how session spending is tracked internally and determine how to expose this data in the status line.
  • Consider adding a new field to the status line JSON to include session cost information, such as the proposed cost object with session_total_usd, session_input_tokens, and session_output_tokens properties.
  • Evaluate the technical feasibility of including account balance information, such as the proposed account object with remaining_credits_usd property, and assess any potential security or privacy implications.
  • Develop a status line script to display the new cost information in a user-friendly format, such as the proposed example output.

Example

{
  "cost": {
    "session_total_usd": 0.55,
    "session_input_tokens":

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING