ccusage
Analyze your Claude Code token usage and costs from local JSONL files β incredibly fast and informative!
Installation
Quick Start (Recommended)
Thanks to ccusage's incredibly small bundle size ( ), you can run it directly without installation:
# Using bunx (recommended for speed) bunx ccusage # Using npx npx ccusage@latest # Using deno (with security flags) deno run -E -R= $HOME /.claude/projects/ -S=homedir -N= ' raw.githubusercontent.com:443 ' npm:ccusage@latest
π‘ Tip: We recommend using bunx instead of npx for a massive speed improvement!
Local Installation (Optional)
Since ccusage has such a small bundle size, installation is entirely optional:
npm install -g ccusage
Usage
# Basic usage ccusage # Show daily report (default) ccusage daily # Daily token usage and costs ccusage monthly # Monthly aggregated report ccusage session # Usage by conversation session ccusage blocks # 5-hour billing windows # Live monitoring ccusage blocks --live # Real-time usage dashboard # Filters and options ccusage daily --since 20250525 --until 20250530 ccusage daily --json # JSON output ccusage daily --breakdown # Per-model cost breakdown
Features
π Daily Report : View token usage and costs aggregated by date
: View token usage and costs aggregated by date π
Monthly Report : View token usage and costs aggregated by month
: View token usage and costs aggregated by month π¬ Session Report : View usage grouped by conversation sessions
: View usage grouped by conversation sessions β° 5-Hour Blocks Report : Track usage within Claude's billing windows with active block monitoring
: Track usage within Claude's billing windows with active block monitoring π Live Monitoring : Real-time dashboard showing active session progress, token burn rate, and cost projections with blocks --live
: Real-time dashboard showing active session progress, token burn rate, and cost projections with π€ Model Tracking : See which Claude models you're using (Opus, Sonnet, etc.)
: See which Claude models you're using (Opus, Sonnet, etc.) π Model Breakdown : View per-model cost breakdown with --breakdown flag
: View per-model cost breakdown with flag π
Date Filtering : Filter reports by date range using --since and --until
: Filter reports by date range using and π Custom Path : Support for custom Claude data directory locations
: Support for custom Claude data directory locations π¨ Beautiful Output : Colorful table-formatted display with automatic responsive layout
: Colorful table-formatted display with automatic responsive layout π± Smart Tables : Automatic compact mode for narrow terminals (< 100 characters) with essential columns
: Automatic compact mode for narrow terminals (< 100 characters) with essential columns π Enhanced Model Display : Model names shown as bulleted lists for better readability
: Model names shown as bulleted lists for better readability π JSON Output : Export data in structured JSON format with --json
: Export data in structured JSON format with π° Cost Tracking : Shows costs in USD for each day/month/session
: Shows costs in USD for each day/month/session π Cache Token Support : Tracks and displays cache creation and cache read tokens separately
: Tracks and displays cache creation and cache read tokens separately π Offline Mode : Use pre-cached pricing data without network connectivity with --offline (Claude models only)
: Use pre-cached pricing data without network connectivity with (Claude models only) π MCP Integration : Built-in Model Context Protocol server for integration with other tools
: Built-in Model Context Protocol server for integration with other tools π Ultra-Small Bundle: Unlike other CLI tools, we pay extreme attention to bundle size - incredibly small even without minification!
Documentation
Full documentation is available at ccusage.com
Sponsors
Featured Sponsor
Check out these 47 Claude Code ProTips from Greg Baugues.
Star History
License
MIT Β© @ryoppippi