[FEATURE] /context: option to display estimated dollar cost instead of/alongside tokens
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
/context breaks down context usage entirely in token counts (system prompt, memory files, skills, MCP tools, messages, etc.). Token counts don't map intuitively to actual spend, especially for users on pay-per-use API billing who think in dollars, not tokens.
Proposed Solution
Add a way to display the /context breakdown as estimated dollar cost instead of token counts, computed from the active model's per-token pricing (respecting cache-write/cache-read/input/output rate differences where they apply). E.g. a flag like /context --cost or a settings.json option such as context.costDisplay: true.
Alternative Solutions
Show both token count and estimated $ side-by-side in the existing breakdown table, rather than a toggle — avoids needing a separate mode while still giving cost visibility.
Priority
Low - Nice to have
Feature Category
CLI commands and flags
Use Case Example
A user running a long session with many custom skills, MCP tools, and memory files wants to know "how much of my spend is going to system overhead vs. actual conversation?" Currently they'd have to manually multiply each category's token count by the model's per-token rate; a built-in $ view would answer this instantly.
Additional Context
Searched existing issues on anthropics/claude-code — no exact duplicate found. Related but distinct: #33978 (built-in usage analytics command) and #78148 (historical cost/usage tracking across sessions), both of which cover session-level history rather than the live /context breakdown itself.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗