cost-tracker

Calculate session token usage and convert it to USD cost estimates.

156|37|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/zeuikli/claude-code-workspace --skill cost-tracker-zeuikli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-tracker
Source: https://github.com/zeuikli/claude-code-workspace/tree/main/.claude/skills/cost-tracker
Command: npx skills add https://github.com/zeuikli/claude-code-workspace --skill cost-tracker-zeuikli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The skill helps you understand how much your current session is costing in real dollars by breaking down token usage by model and comparing it against an “unoptimized” baseline.

Core Features & Use Cases

  • Session Token & Cost Breakdown: Calculates total input, output, cache read, and cache write tokens, then converts them into USD using the provided pricing table.
  • Model-Layer Attribution (Haiku/Sonnet/Opus): Estimates cost distribution across models to reflect an Advisor-mode workflow rather than treating everything as one model.
  • Before/After Optimization Report: Produces an “all Opus” estimated cost versus an Advisor-mode computed cost to show the savings percentage.

Quick Start

Run the /cost-tracker command during your session to generate a cost report with model-level totals and an estimated optimization delta.

Frequently Asked Questions about cost-tracker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate Claude Code session token usage in USD?

Calculating session token usage in USD involves breaking down input, output, cache read, and cache write tokens, then multiplying by provided pricing rates. This generates a cost report showing total spend for your current Claude Code session.

What is Advisor-mode model partitioning for cost tracking?

Advisor-mode model partitioning is a workflow that distributes token allocation across Haiku, Sonnet, and Opus models. Cost tracking attributes spending to each model layer instead of treating everything as one model, revealing actual cost distribution.

How do I prove workspace savings from per-model token allocation?

To prove workspace savings, generate a before/after optimization report comparing an all-Opus estimated baseline cost against the Advisor-mode computed cost. This comparison calculates the savings percentage achieved by per-model token allocation.

Can I track cache read and cache write token costs separately?

Yes, you can track cache read and cache write token costs separately. The cost breakdown calculates total tokens for both cache operations and converts them into USD using the provided pricing table specific to each operation type.

Does the Claude Agent SDK cost-tracking integration require specific pricing rates?

The Claude Agent SDK cost-tracking integration requires using provided pricing rates to calculate session costs accurately. It produces cost reports satisfying SDK assumptions by translating token usage into USD for input, output, and cache operations.