cc-usage

Analyze Claude Code JSONL logs to compute token usage by date and model.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/alexaundre/mycc --skill cc-usage
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-usage
Source: https://github.com/alexaundre/mycc/tree/main/.claude/skills/cc-usage
Command: npx skills add https://github.com/alexaundre/mycc --skill cc-usage

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Claude Code 的 token 使用和成本往往分散在多个日志与项目中,难以一眼看清全局趋势。本 Skill 汇总按日期和模型维度对日志进行聚合,帮助你快速掌握资源消耗。

Core Features & Use Cases

  • 按日期 × 模型聚合 token 输入、输出、缓存创建与读取等指标,并可按项目过滤
  • 生成易于阅读的 Markdown 表格或 CSV,支持成本估算与跨日对比
  • 可用于成本控制、容量规划和合规审计场景,适合数据分析师与开发运维

Quick Start

运行 python3 .claude/skills/cc-usage/scripts/analyzer.py 来为 Claude Code 项目生成用量报告。

Frequently Asked Questions about cc-usage

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

FAQPage Schema
How do I track Claude Code token usage across multiple projects?

Track Claude Code token usage by parsing local JSONL logs stored in ~/.claude/projects. The script aggregates input, output, and cache tokens across all projects to compute total usage by date and model.

Can I generate a cost estimate for Claude Code API usage from local logs?

Generate cost estimates for Claude Code API usage by analyzing local JSONL logs. The analyzer aggregates input and output tokens per model to produce a cost summary in Markdown or CSV format.

How do I aggregate Claude Code logs by date and model?

Aggregate Claude Code logs by date and model using a Python script that maps models to short names. It parses JSONL logs to compute per-day and per-model token views, including cache creation and read metrics.

Does the Claude Code usage analyzer support filtering by specific projects?

The Claude Code usage analyzer supports filtering by days, projects, and models. You can apply filters to the local log aggregation to produce customized token usage views and cost summaries.

What is the best way to export Claude Code token consumption data for compliance audits?

Export Claude Code token consumption data for compliance by running the analyzer script to output Markdown tables or CSV files. These outputs include per-day, per-model token metrics and cost estimates suitable for auditing.