A CLI tool for analyzing Claude Code/Codex CLI usage from local JSONL files.
npx skills add https://github.com/ryoppippi/ccusage --skill use-gunshi-cliCLI を使用してこのスキルをインストールし、ワークスペースで SKILL.md ワークフローの使用を開始します。
Analyze your Claude Code token usage and costs from local JSONL files — incredibly fast and informative!
The main CLI tool for analyzing Claude Code usage from local JSONL files. Track daily, monthly, and session-based usage with beautiful tables.
Companion tool for analyzing OpenAI Codex usage. Same powerful features as ccusage but tailored for Codex users, including GPT-5 support and 1M token context windows.
Companion tool for analyzing OpenCode usage. Track token usage and costs from OpenCode sessions with the same reporting capabilities as ccusage.
Companion tool for analyzing pi-agent session usage. Track token usage and costs from your pi-agent sessions with daily, monthly, and session-based reports.
Companion tool for analyzing Amp session usage. Track token usage, costs, and credits from your Amp CLI sessions with daily, monthly, and session-based reports.
Model Context Protocol server that exposes ccusage data to Claude Desktop and other MCP-compatible tools. Enable real-time usage tracking directly in your AI workflows.
Thanks to ccusage's incredibly small bundle size (), you can run it directly without installation:
# Recommended - always include @latest to ensure you get the newest version
npx ccusage@latest
bunx ccusage
# Alternative package runners
pnpm dlx ccusage
pnpx ccusage
# Using deno (with security flags)
deno run -E -R=$HOME/.claude/projects/ -S=homedir -N='raw.githubusercontent.com:443' npm:ccusage@latest
💡 Important: We strongly recommend using
@latestsuffix with npx (e.g.,npx ccusage@latest) to ensure you're running the most recent version with the latest features and bug fixes.
npx @ccusage/codex@latest # OpenAI Codex usage tracking
npx @ccusage/opencode@latest # OpenCode usage tracking
npx @ccusage/pi@latest # Pi-agent usage tracking
npx @ccusage/amp@latest # Amp usage tracking
npx @ccusage/mcp@latest # MCP Server
# Basic usage
npx ccusage # Show daily report (default)
npx ccusage daily # Daily token usage and costs
npx ccusage monthly # Monthly aggregated report
npx ccusage session # Usage by conversation session
npx ccusage blocks # 5-hour billing windows
npx ccusage statusline # Compact status line for hooks (Beta)
# Filters and options
npx ccusage daily --since 20250525 --until 20250530
npx ccusage daily --json # JSON output
npx ccusage daily --breakdown # Per-model cost breakdown
npx ccusage daily --timezone UTC # Use UTC timezone
npx ccusage daily --locale ja-JP # Use Japanese locale for date/time formatting
# Project analysis
npx ccusage daily --instances # Group by project/instance
npx ccusage daily --project myproject # Filter to specific project
npx ccusage daily --instances --project myproject --json # Combined usage
# Compact mode for screenshots/sharing
npx ccusage --compact # Force compact table mode
npx ccusage monthly --compact # Compact monthly report
--breakdown flag--since and --until--compact flag to force compact table layout, perfect for screenshots and sharing--json--offline (Claude models only)--instances flag and filter by specific projects--timezone option--locale option (e.g., en-US, ja-JP, de-DE)Full documentation is available at ccusage.com
For contributors and developers working on ccusage, we provide a Nix flake-based development environment:
# Clone the repository
git clone https://github.com/ryoppippi/ccusage.git
cd ccusage
# Allow direnv (automatically loads Nix environment)
direnv allow
# Or manually enter the development shell
nix develop
This ensures consistent tooling versions across all contributors and CI systems. The development environment is defined in flake.nix and automatically activated via direnv when entering the project directory.
Check out ccusage: The Claude Code cost scorecard that went viral