cost-tracking

Track API token costs and calculate USD expenses in Claude Code.

29|2|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/jbdamask/john-claude-skills --skill cost-tracking
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cost-tracking
Source: https://github.com/jbdamask/john-claude-skills/tree/main/skills/cost-tracking
Command: npx skills add https://github.com/jbdamask/john-claude-skills --skill cost-tracking

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps users understand and manage the costs associated with their API token usage within Claude Code by precisely tracking token consumption for specific operations.

Core Features & Use Cases

  • Real-time Cost Monitoring: Tracks input, output, and cache tokens per API call.
  • Detailed Cost Calculation: Calculates USD costs based on current Anthropic pricing.
  • Session-based Tracking: Allows users to start and stop cost tracking for defined periods within a session.
  • Use Case: A developer is experimenting with different prompts and models for a new feature. They can use this skill to track the exact cost of each experimental iteration, allowing them to optimize for both performance and budget.

Quick Start

Use the cost-tracking skill to start measuring API token costs for your current session.

Frequently Asked Questions about cost-tracking

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

FAQPage Schema
How do I track API token costs for operations within Claude Code?

You can track API token costs by initiating a measurement command to start monitoring input, output, and cache tokens, then stopping it to receive a detailed USD cost report based on Anthropic's pricing model.

Can I monitor API usage and calculate USD expenses for specific Claude Code sessions?

Yes, session-based tracking allows you to start and stop cost measurement for defined periods, providing per-entry token logs and aggregated summaries to calculate USD expenses for specific Claude Code sessions.

How does token monitoring work for budget management in AI development workflows?

Token monitoring works by logging input, output, and cache tokens per API call and calculating costs using current Anthropic pricing, enabling precise budget management and resource optimization in AI development workflows.

What is the best way to measure the exact cost of experimental prompt iterations?

The best way to measure experimental prompt iteration costs is to start tracking before your experiments and stop it after, yielding a detailed report of per-entry token logs and aggregated cost summaries.

Do I need any dependencies to calculate API token costs using Anthropic's pricing model?

No dependencies are required to calculate API token costs; the Skill operates independently to monitor tokens and apply Anthropic's pricing model for USD expense calculation.

What details are included in the cost report when I stop tracking API usage?

The cost report includes detailed per-entry token logs showing input, output, and cache tokens, along with aggregated summaries calculating total USD expenses based on Anthropic's pricing model.