Feature Request: Expose per-response token counts to the model
Resolved 💬 3 comments Opened Dec 29, 2025 by bugragunalan Closed Dec 29, 2025
Feature Request
Is your feature request related to a problem?
Yes. When using Claude Code for multi-step workflows or long sessions, there's no visibility into token consumption. This makes it difficult to:
- Track costs for billing/budgeting purposes
- Optimize prompts and workflows for efficiency
- Understand which operations are token-intensive
Describe the solution you'd like
Expose token usage information that can be accessed during or after a session:
- Per-response token counts - Input/output tokens for each API call
- Cumulative session tokens - Running total during conversation
- Accessible via command or API - e.g.,
/tokenscommand or environment variable
Example output:
Session Token Usage:
- Input tokens: 45,230
- Output tokens: 8,540
- Total: 53,770
Use cases:
- Cost tracking - Know how much a session costs before it ends
- Optimization - Identify which prompts/operations use most tokens
- Budgeting - Set alerts or limits based on token usage
- Analytics - Track usage patterns over time
Describe alternatives you've considered
- Anthropic Console - Shows usage but not per-session or real-time
- Manual estimation - Inaccurate, doesn't account for system prompts/context
- External wrappers - Adds complexity, not integrated
Proposed implementation options:
- Command:
/tokensor/usageto display current session stats - Environment variable: Expose via
$CLAUDE_SESSION_TOKENS - Status bar: Optional display in CLI footer
- API response: Include in response metadata for programmatic access
Additional context
This would be valuable for:
- Enterprise users tracking costs per project
- Developers optimizing their prompts and skills
- Teams with token budgets or limits
- Anyone curious about their usage patterns
The /cost command currently shows subscription status but not actual token counts.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗