ccusage Family
The ccusage family is a suite of CLI tools designed to track token usage and costs across various AI coding assistants. All tools share the same powerful reporting features and beautiful terminal output.ccusage
Main CLI tool for analyzing Claude Code usage from local JSONL files
@ccusage/codex
OpenAI Codex usage analyzer with GPT-5 support
@ccusage/opencode
OpenCode usage analyzer for tracking sessions
@ccusage/pi
Pi-agent usage analyzer for alternative Claude agent
@ccusage/amp
Amp usage analyzer with credits tracking
@ccusage/mcp
MCP server for real-time integration with Claude Desktop
Common Features
All tools in the ccusage family share these powerful features:- Daily Reports - View token usage and costs aggregated by date
- Monthly Reports - View usage grouped by month
- Session Reports - Analyze individual conversation sessions
- Model Tracking - See which AI models you’re using
- Cost Calculation - Accurate USD cost estimates using LiteLLM pricing
- Cache Token Support - Track cache creation and cache read tokens separately
- JSON Output - Export data in structured JSON format with
--json - Beautiful Tables - Colorful terminal output with automatic responsive layout
- Compact Mode - Use
--compactflag for narrow terminals - Offline Support - Use cached pricing data without network connectivity
Installation
All ccusage family tools can be run directly without installation usingnpx or bunx:
We recommend always using
@latest suffix to ensure you get the newest version with the latest features and bug fixes.Shell Aliases
Since the scoped package names can be long, we recommend setting up shell aliases:Use Cases
Each tool is designed for specific AI coding assistants:| Tool | Use Case | Data Source |
|---|---|---|
| ccusage | Track Claude Code token usage and costs | ~/.claude/projects/ or ~/.config/claude/projects/ |
| @ccusage/codex | Monitor OpenAI Codex sessions with GPT-5 support | ~/.codex/sessions/ |
| @ccusage/opencode | Analyze OpenCode session usage and costs | ~/.local/share/opencode/ |
| @ccusage/pi | Track pi-agent sessions (alternative Claude agent) | ~/.pi/agent/sessions/ |
| @ccusage/amp | Monitor Amp CLI usage with credits tracking | ~/.local/share/amp/threads/ |
| @ccusage/mcp | Real-time integration with Claude Desktop via MCP | All supported tools |
Learn More
Explore the individual tool pages for detailed usage instructions and examples:- ccusage - Main tool documentation
- @ccusage/codex - OpenAI Codex analyzer
- @ccusage/opencode - OpenCode analyzer
- @ccusage/pi - Pi-agent analyzer
- @ccusage/amp - Amp analyzer
- @ccusage/mcp - MCP server integration