---
title: Cost Tracking
description: Real-time token usage and USD cost tracking for all Claude Code sessions.
---

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

## How costs are calculated

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 type | Description |
|------------|-------------|
| Input | Tokens sent to Claude in the prompt |
| Output | Tokens generated by Claude |
| Cache read | Prompt cache hits (reduced cost) |
| Cache write | Tokens stored in prompt cache |

## Cache efficiency

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.

## Daily / session breakdown

The dashboard shows:
- **Today's total cost** across all sessions
- **Per-session cost** in the session browser
- **Running total** in Mission Control (live updates)

## Cost & token breakdown popover

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

## MCP tools

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
