analyze

Analyze Claude Code token usage and costs from local session data.

9|1|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/ChintanTurakhia/cost-analysis --skill analyze-chintanturakhia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze
Source: https://github.com/ChintanTurakhia/cost-analysis/tree/main/plugins/cost-analysis/skills/analyze
Command: npx skills add https://github.com/ChintanTurakhia/cost-analysis --skill analyze-chintanturakhia

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you understand and manage your spending on Claude Code by analyzing token usage, identifying cost drivers, and suggesting optimizations.

Core Features & Use Cases

  • Cost Breakdown: See costs by project, model, and date.
  • Usage Analysis: Identify top sessions, model usage, and token cost distribution (input, output, cache).
  • MCP Overhead: Analyze Model Context Protocol server costs, tool result sizes, and schema bloat.
  • Model Recommendations: Get suggestions on whether Opus was necessary for your tasks.
  • Use Case: You've noticed your Claude Code bill is higher than expected. Run this Skill to see which projects or sessions are costing the most, and if you could save money by using Sonnet or Haiku for certain tasks.

Quick Start

Analyze all your Claude Code sessions for the last 30 days.

Frequently Asked Questions about analyze

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

FAQPage Schema
How do I analyze Claude Code token usage and costs?

Analyze Claude Code token usage and costs by running a Python script that aggregates local session data, providing a detailed breakdown by project, model, and date. It identifies cost drivers like cache tokens and MCP server overhead.

How can I identify MCP server overhead in my Claude Code billing?

Identify MCP server overhead in Claude Code billing by analyzing local session data to measure tool result sizes and schema bloat. The analysis isolates these specific costs to show their impact on your total token usage.

Do I need Python to analyze local session data for Claude Code?

Yes, you need Python3 installed to analyze local session data for Claude Code. The Skill utilizes Python scripts to perform data aggregation, compute costs, and generate the optimization recommendations.

Can I get model recommendations to reduce Claude Code spending?

You can get model recommendations to reduce Claude Code spending by reviewing the generated insights, which suggest whether using Sonnet or Haiku instead of Opus was necessary for your specific tasks.

What is the best way to break down Claude Code costs by project?

The best way to break down Claude Code costs by project is to analyze your local session data files, which the script parses to group token usage and compute specific costs for each project over a selected date range.

Why does my Claude Code bill show high costs from cache tokens?

High costs from cache tokens occur when session data shows heavy cache usage. The analysis isolates cache token costs from input and output tokens, identifying them as a primary cost driver in your billing breakdown.