Add token and cost transparency to Claude Code CLI

Resolved 💬 2 comments Opened Apr 2, 2026 by oeztunhk Closed May 12, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

Problem:
There is currently no way to see how many tokens are used per request in Claude Code. This makes it difficult to estimate or control costs, especially for simple or iterative tasks.

Current Behavior:

No token usage shown per prompt/response
/stats does not provide per-request or per-session breakdown
No real-time feedback about consumption

Expected Behavior:

Show prompt tokens and completion tokens per request
Optional real-time cost estimation
Detailed /stats output with per-session breakdown
Warning when unusually high token usage occurs

Use Case:
Using Claude Code in DevSecOps / CI workflows with many small requests. Lack of transparency makes it hard to manage usage efficiently.

Why this matters:
Token and cost transparency is essential for professional usage. Without it, the tool is difficult to use reliably in production-like environments.

Additional context:
This feature would significantly improve usability and trust, especially compared to other tools that already provide detailed usage metrics.

Proposed Solution

Proposed Solution:

Add token usage reporting per request in the CLI.

Example:

  • After each command, display:
  • prompt tokens
  • completion tokens
  • total tokens
  • optional estimated cost

Optional enhancements:

  • Add a --verbose or --stats flag to show detailed usage
  • Extend /stats to include per-session and per-request breakdown
  • Add warnings for unusually high token consumption

This should be lightweight and not disrupt the existing workflow.

Alternative Solutions

There is currently no reliable workaround within Claude Code.

As a workaround, token usage must be estimated indirectly or by switching to other tools that expose usage metrics via API.

Other tools (e.g. OpenAI API) provide token-level visibility, which makes cost control significantly easier.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

Additional Context:

The existing /stats command only provides aggregated token usage (e.g. total tokens), but does not include per-request or per-session breakdown.

The --verbose flag also does not expose token usage, only additional logging output.

Therefore, there is currently no way to track token consumption at a granular level.

View original on GitHub ↗

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