Runtime Token Usage Visibility for Claude Code
Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jan 24, 2026 · closed Jan 24, 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
Summary
Provide Claude Code with runtime access to token consumption metrics, enabling AI-assisted budget management and self-regulation during sessions.
Current Problem
Claude Code has no visibility into:
- Tokens consumed in current session
- Remaining budget/quota
- Cost per operation
- Session token trajectory
This prevents implementation of:
- Automatic efficiency optimization
- Budget-aware decision making
- Session cost estimation
- Self-imposed limits when approaching thresholds
Proposed Solution
Proposed Solution
Expose token metrics via environment variable or internal API:
CLAUDE_SESSION_TOKENS_USED=45000
CLAUDE_SESSION_TOKENS_REMAINING=55000
CLAUDE_SESSION_BUDGET=100000
CLAUDE_COST_PER_1K_INPUT=0.003
CLAUDE_COST_PER_1K_OUTPUT=0.015
Or provide a system function:
get_token_usage() -> {used: int, remaining: int, budget: int}
Use Cases
- Budget Alerts: Claude warns user when approaching limits
- Efficiency Mode: Auto-switch to concise responses near budget
- Cost Reporting: Provide session cost summary
4.Task Prioritization: Skip low-value operations when budget tight
- User Control: Allow users to set soft limits Claude respects
Benefits
- Increased user trust through transparency
- Reduced unexpected billing
- Enables power users to define efficiency strategies
- Supports enterprise budget compliance
- Aligns AI behavior with user resource constraints
Implementation Suggestion
Read-only access is sufficient. Claude doesn't need to modify budgets, only observe current state to make informed decisions.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
4 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
#10388 has broader version of my request
And of course, they auto-closed mine.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.