mm-cost

Analyze Claude Code token usage and cost from JSONL logs.

1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/mikkeymoo/claude-solo --skill mm-cost
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mm-cost
Source: https://github.com/mikkeymoo/claude-solo/tree/main/mm-skills/mm-cost
Command: npx skills add https://github.com/mikkeymoo/claude-solo --skill mm-cost

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires json, datetime, collections, defaultdict, json, sys, pathlib, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps users understand and manage their Claude Code token usage and cost, enabling informed decisions about spending and optimization.

Core Features & Use Cases

  • Token Usage Analysis: Provides breakdowns of token usage by time, project, and model.
  • Cost Estimation: Calculates the estimated cost of token usage based on predefined rates.
  • Optimization Suggestions: Offers insights for improving cache hit ratio, response length, and overall cost efficiency.
  • Trend Analysis: Allows for comparison of usage and cost trends over different time periods.

Quick Start

Run /mm-cost to generate a cost report for Claude Code usage.

Frequently Asked Questions about mm-cost

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

FAQPage Schema
How do I analyze Claude Code token usage and cost from JSONL logs?

To analyze Claude Code token usage and cost, you can parse JSONL log files to calculate estimated spending, identify usage patterns by model, and detect anomalies. This process requires Python to extract and compute the token metrics from the logs.

What is the best way to track Claude Code API cost trends over time?

The best way to track Claude Code API cost trends is to analyze your JSONL logs to compare usage and cost metrics over different time periods. This allows you to identify patterns and anomalies in token consumption across projects and models.

Do I need Python to parse Claude Code JSONL logs for cost analysis?

Yes, you need Python to parse Claude Code JSONL logs for cost analysis. The Skill uses Python's built-in libraries like json, datetime, and collections to read the log files, process token usage data, and compute the estimated costs.

How can I optimize Claude Code token usage to reduce spending?

You can optimize Claude Code token usage to reduce spending by analyzing your JSONL logs to improve cache hit ratios and reduce response lengths. The Skill provides cost optimization suggestions based on your actual usage patterns and anomalies.

Can I get a breakdown of Claude Code token usage by project and model?

Yes, you can get a breakdown of Claude Code token usage by project and model. By parsing your JSONL logs, the Skill categorizes token consumption and calculates estimated costs based on predefined rates for each specific model used.