token-cost

Analyze Claude Code session logs to extract token usage and estimate USD costs.

4|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/webreactiva-devs/skills-workshop --skill token-cost
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-cost
Source: https://github.com/webreactiva-devs/skills-workshop/tree/main/skills/token-cost
Command: npx skills add https://github.com/webreactiva-devs/skills-workshop --skill token-cost

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, pdfplumber, pdf2image, and includes scripts (resource) components.

What problem does it solve?

This Skill helps users understand and manage their AI token consumption and associated costs, preventing unexpected expenses and optimizing resource usage.

Core Features & Use Cases

  • Token Usage Analysis: Provides detailed breakdowns of input, output, and cache tokens per model and session.
  • Cost Estimation: Calculates the estimated USD cost based on live pricing data.
  • Session Tracking: Analyze current, last, or all sessions within a project.
  • Use Case: A developer wants to know how much a specific coding session cost them to budget effectively for future development.

Quick Start

Run the token cost skill to analyze the token usage for the current session.

Frequently Asked Questions about token-cost

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

FAQPage Schema
How do I track AI token usage and estimate costs from Claude Code session logs?

You can track AI token usage by analyzing Claude Code session logs to extract input, output, and cache tokens, then estimating costs in USD. This process provides a detailed breakdown per model and session to prevent unexpected expenses.

Can I analyze token costs for a specific coding session instead of all sessions?

Yes, you can analyze token costs for the current, last, or all sessions within a project. This flexibility allows you to isolate and estimate the exact USD cost of a specific coding session for accurate budgeting.

How does the cost estimation for AI tokens calculate live pricing data?

Cost estimation calculates live pricing data by integrating with the models.dev API. This integration fetches current rates to accurately estimate the USD cost of your AI token consumption per model and session.

What is the best way to display detailed user prompts when analyzing session token usage?

The best way to display detailed user prompts during session token usage analysis is to use the detailed prompt display option. This feature breaks down input, output, and cache tokens while showing the specific prompts used.

Do I need specific dependencies to extract token usage and cost data from PDF logs?

Yes, extracting token usage and cost data requires specific dependencies like pypdf, pdfplumber, and pdf2image. These libraries process the session log files to accurately parse and calculate your AI token consumption.

Why should I monitor my AI token consumption during software development?

Monitoring AI token consumption during software development helps you understand and manage associated costs, preventing unexpected expenses. It provides a per-model breakdown to optimize resource usage and budget effectively for future projects.