claude-code - 💡(How to fix) Fix Show per-action token usage in CLI output [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#46496Fetched 2026-04-11 06:18:45
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Even a simple question costs ~500 tokens, which is only visible if you happen to watch the status bar. As AI usage costs affect everyone, transparency should be a priority.

🤖 Generated with Claude Code

Root Cause

Even a simple question costs ~500 tokens, which is only visible if you happen to watch the status bar. As AI usage costs affect everyone, transparency should be a priority.

🤖 Generated with Claude Code

Code Example

[+1.2k tokens · input: 800 · output: 400]
RAW_BUFFERClick to expand / collapse

Problem

After each action (tool call, response), the CLI only shows cumulative token usage in the status bar. There's no per-action breakdown visible. /cost shows model distribution (e.g. "opus: 97%, haiku: 3%") and cache hit rate, but no absolute token numbers.

This makes it impossible to understand:

  • How many tokens a specific action consumed (e.g. a large Docker pull log vs. a simple file read)
  • Whether a particular approach was "expensive" or not
  • Where to optimize usage

Proposal

Show per-action token delta after each response, e.g.:

[+1.2k tokens · input: 800 · output: 400]

This would help users:

  • Make informed decisions about whether to let large outputs into context
  • Understand the cost of different workflows
  • Budget their usage more effectively

Context

Even a simple question costs ~500 tokens, which is only visible if you happen to watch the status bar. As AI usage costs affect everyone, transparency should be a priority.

🤖 Generated with Claude Code

extent analysis

TL;DR

Displaying per-action token delta after each response can help users understand and optimize their token usage.

Guidance

  • Modify the CLI to show the token usage for each action, including the input and output tokens, to provide a clear breakdown of token consumption.
  • Consider adding a feature to display the token usage in a more prominent location, such as inline with the action output, to make it easier for users to understand the cost of their actions.
  • Update the /cost command to include absolute token numbers in addition to the model distribution and cache hit rate to provide more detailed information about token usage.
  • Review the current token usage display in the status bar to ensure it is accurate and easy to understand, and consider adding more detailed information about token consumption.

Example

A possible implementation could involve adding a token usage display to the output of each action, such as:

[+1.2k tokens · input: 800 · output: 400]

This would provide a clear and concise breakdown of the token usage for each action.

Notes

The exact implementation details may vary depending on the specific requirements and constraints of the CLI and the token usage system. It may be necessary to balance the level of detail provided with the need to avoid cluttering the output.

Recommendation

Apply a workaround by modifying the CLI to display per-action token delta after each response, as this will provide users with the necessary information to understand and optimize their token usage.

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