token-usage

Scan Claude Code JSONL session files and generate markdown token usage reports.

5|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/barkleesanders/claude-code-starter --skill token-usage-barkleesanders
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: token-usage
Source: https://github.com/barkleesanders/claude-code-starter/tree/main/skills/token-usage
Command: npx skills add https://github.com/barkleesanders/claude-code-starter --skill token-usage-barkleesanders

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tracking Claude Code token consumption across multiple projects and sessions is tedious and time-consuming, making it hard to identify costly usage patterns, optimize AI spending, and spot unexpectedly expensive subagent runs.

Core Features & Use Cases

  • Cross-project usage tracking: Scans all local Claude Code session files to generate a full breakdown of token usage per project, including input, cache creation, cache read, and output tokens.
  • Costliest session identification: Highlights the top 25 most token-heavy sessions with their first prompts, so you can quickly pinpoint what drove high usage.
  • Subagent usage analysis: Breaks down token consumption by subagent to ensure specialized AI runs are proportional to their value.
  • Use Case: If you run multiple client projects in Claude Code, use this skill to generate a report that shows which project is using the most tokens, if any subagent runs are driving up costs, and which sessions were the most expensive.

Quick Start

Ask Claude to run the token-usage skill to generate a full markdown report of your Claude Code token usage across all projects and sessions, filtered to your desired time range.

Frequently Asked Questions about token-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?

You can track Claude Code token usage across multiple projects by scanning local JSONL session files to generate a detailed markdown report with per-project breakdowns of input, cache creation, cache read, and output token counts.

How do I find the most expensive Claude Code sessions driving up AI costs?

To find the most expensive Claude Code sessions, analyze JSONL session files to identify the top 25 most token-heavy sessions along with their first prompts, allowing you to quickly pinpoint what drove the high usage.

Can I filter Claude Code cost tracking reports by a specific time range?

Yes, you can filter Claude Code cost tracking reports by time range, supporting options for all time, the last N days, or since a specific date to narrow down the session analytics output.

What is the best way to analyze AI cost tracking data from Claude Code JSONL files?

The best way to analyze AI cost tracking data from Claude Code JSONL files is to parse the default projects directory to aggregate session metrics and output a comprehensive markdown report highlighting costly usage patterns.