What problem does it solve?
Claude Code sessions consume tokens across multiple models and tiers, but there is no built-in way to know how much a session actually cost. This Skill reads the session jsonl, tallies token usage per model, computes USD cost from Anthropic pricing, and stores a structured record so spending can be reported and audited later.
Core Features & Use Cases
- Automatic session discovery: Locates the active session jsonl from the current working directory, with overrides to pin a specific session file.
- Per-model and per-tier cost breakdown: Aggregates input, output, cache-write, and cache-read tokens per model and rolls them up into haiku/sonnet/opus tiers with USD totals.
- Persistent cost records: Writes a structured JSON record keyed by session ID into the cost-tracking AgentDB namespace for downstream consumers like cost-report.
- Use Case: After finishing a chunk of work, run the tracker to capture spend for that session, then let cost-report aggregate all sessions into a spending summary.
Quick Start
Run the cost tracking script from the project root to tally this session's token usage and save the cost record to memory.