Track your Claude Code usage, costs, and savings across different subscription plans.
Inspired by the original ccusage tool from "The COST of Claude Code" YouTube video
- 📊 Daily Usage: View token usage and costs by day
- 📅 Monthly Usage: Track monthly spending and projections
- ⏱️ 5-Hour Blocks: Monitor usage blocks with live tracking
- 📁 Project Sessions: Analyze usage by project/session
- 💰 Cost Analysis: Compare savings across subscription plans
- 🚀 Cache Efficiency: Track how much cache is saving you
- 📈 Live Monitoring: Real-time block usage tracking
# Install globally
npm install -g ccusage
# Or run without installing using bunx (recommended)
bunx ccusageccusage
# or
ccusage dailyShows last 7 days of usage with cost analysis.
ccusage monthlyShows usage aggregated by month with comparisons.
ccusage blocksShows 5-hour usage blocks (Claude's rate limiting windows).
ccusage blocks --liveReal-time monitoring of current block usage with projections.
ccusage sessionShows usage broken down by project with cache efficiency metrics.
-d, --days <number>: Number of days to show (default: 7)
--live: Enable live monitoring mode
- Input Tokens: Tokens sent to Claude
- Output Tokens: Tokens generated by Claude
- Cache Read: Tokens read from cache (90% cheaper)
- Cache Write: Tokens written to cache
The tool shows:
- Actual token costs at pay-as-you-go rates
- Savings when using Claude Max plans
- Cache efficiency percentage
- Projected monthly costs
Claude uses 5-hour windows for rate limiting. The blocks view helps you:
- Track usage within rate limit windows
- See burn rate per hour
- Project total block cost
- Monitor active blocks in real-time
- Node.js 16+
- Claude Code must be installed and used at least once
- Access to
~/.claude/projects/directory
ccusage reads Claude's log files from ~/.claude/projects/*/claude.jsonl and calculates costs based on current model pricing. It tracks:
- Token usage per request
- Model used for each request
- Cache efficiency
- Timestamps for aggregation
All data is read locally from your machine. No data is sent to external servers.
This tool is inspired by the original ccusage tool mentioned in "The COST of Claude Code" YouTube video. It provides similar functionality for tracking Claude Code usage and costs.
MIT