claude-code - 💡(How to fix) Fix Feature: Show token usage after every prompt [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#52948Fetched 2026-04-25 06:16:26
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Add an option to display token usage statistics (input tokens, output tokens, cache hits, cost) automatically after each response, without requiring the user to manually open the /usage dialog.

Root Cause

Add an option to display token usage statistics (input tokens, output tokens, cache hits, cost) automatically after each response, without requiring the user to manually open the /usage dialog.

Code Example

1,234 tokens  ↓ 456 tokens  cache hit: 892  ~$0.004
RAW_BUFFERClick to expand / collapse

Summary

Add an option to display token usage statistics (input tokens, output tokens, cache hits, cost) automatically after each response, without requiring the user to manually open the /usage dialog.

Motivation

Currently, the only way to view token usage is via the /usage slash command, which opens a dialog on demand. There is no way to passively monitor per-prompt token consumption as you work.

Developers who are cost-conscious or optimizing their prompts have no way to see per-turn token counts inline in the conversation. Having to open /usage after every response is disruptive to the flow.

Proposed Solution

Add a settings option (e.g., showUsagePerPrompt: true in settings.json) that appends a compact usage summary after each assistant response, something like:

↑ 1,234 tokens  ↓ 456 tokens  cache hit: 892  ~$0.004

This could alternatively be surfaced via:

  • The statusLine (if the runtime exposes live usage data to status line commands)
  • A Stop hook (if usage data is included in the hook's stdin payload)
  • A dedicated verbose sub-mode

Alternatives Considered

  • statusLine config: The status line can run shell commands, but those commands have no access to the current session's live token usage data.
  • Stop hook: Fires after each response, but the hook's stdin payload does not include token usage data.
  • viewMode: "verbose": Shows tool call details but not token counts.

Additional Context

This was surfaced as a user request in Claude Code. The /usage dialog already has all the data — it just needs a way to surface it inline or automatically.

🤖 Generated with Claude Code

extent analysis

TL;DR

Add a settings option to display token usage statistics after each response, potentially by modifying the settings.json file or utilizing the statusLine or Stop hook functionality.

Guidance

  • Investigate modifying the settings.json file to include a showUsagePerPrompt option, which appends a compact usage summary after each assistant response.
  • Explore utilizing the statusLine functionality, if the runtime exposes live usage data to status line commands, to display token usage statistics.
  • Consider using a Stop hook, if usage data can be included in the hook's stdin payload, to display token usage statistics after each response.
  • Review the /usage dialog code to understand how it retrieves token usage data and determine if this functionality can be integrated into the proposed solution.

Example

No code snippet is provided as the issue does not contain sufficient technical details to generate a specific example.

Notes

The feasibility of this solution depends on the availability of live usage data in the statusLine or Stop hook, as well as the ability to modify the settings.json file to include the proposed showUsagePerPrompt option.

Recommendation

Apply a workaround by modifying the settings.json file to include a showUsagePerPrompt option, as this approach seems to be the most straightforward and least invasive solution.

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

claude-code - 💡(How to fix) Fix Feature: Show token usage after every prompt [1 comments, 2 participants]