CLI tool for Claude Code usage analysis
Top 9.3% on sourcepulse
This CLI tool, ccusage
, analyzes Claude Code token usage and costs from local JSONL files, providing daily, monthly, session-based, and 5-hour billing block reports. It's designed for developers and researchers who want to understand and manage their spending on Anthropic's Claude models.
How It Works
ccusage
parses local JSONL files containing Claude conversation data. It aggregates token counts and applies pricing information (either cached or fetched) to calculate costs. Key features include real-time monitoring of active sessions, cost projections, and detailed breakdowns by model and date range, all presented in a user-friendly, colorized table format with smart resizing for different terminal widths.
Quick Start & Requirements
npx ccusage@latest
or npm install -g ccusage
Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The tool relies on the local JSONL files generated by Claude's usage logging. Accuracy is dependent on the completeness and format of these local files.
20 hours ago
Inactive