Skip to content

Cost Tracking

claude-view tracks token usage and cost for every session in real time.

Token counts are read from Claude Code’s JSONL event log (~/.claude/projects/). claude-view applies Anthropic’s current pricing to calculate USD costs.

Token typeDescription
InputTokens sent to Claude in the prompt
OutputTokens generated by Claude
Cache readPrompt cache hits (reduced cost)
Cache writeTokens stored in prompt cache

The cache hit ratio shows what percentage of input tokens were served from the prompt cache. A higher ratio means lower costs. claude-view displays this prominently because it’s one of the most actionable cost metrics.

The dashboard shows:

  • Today’s total cost across all sessions
  • Per-session cost in the session browser
  • Running total in Mission Control (live updates)

Hover over any cost figure in the live monitor or session detail to see a full breakdown:

  • Color-coded categories — input tokens, output tokens, cache read tokens, and cache creation tokens each have a distinct color
  • Per-category estimated cost based on current model pricing
  • Cache savings highlighted in green, showing how much you saved from prompt cache hits
  • Available in both the live monitor agent cards and the session detail panel

Access cost data programmatically via the MCP server:

  • get_token_stats — token usage with cache hit ratio
  • get_live_summary — aggregate cost and status for today
  • get_stats — dashboard overview with cost trends