ccusage

Active
GitHub Rust NOASSERTION

Description

Analyze coding (agent) CLI token usage and costs from local data.

Key Features

  • Unified CLI reports for 15+ coding agent CLIs including Claude Code, Codex, OpenCode, and Gemini
  • Daily, weekly, monthly, and session-based usage aggregation with cost tracking in USD
  • Per-model cost breakdown with `--breakdown` flag and cache token tracking
  • Date range filtering with `--since`/`--until` and project-level grouping by instance
  • JSON export, compact mode for screenshots, and auto-responsive table layout
  • Zero-install execution via `bunx ccusage` or `npx ccusage@latest`

Use Cases

💡 Monitoring and optimizing LLM API spending across multiple coding agents
💡 Generating monthly cost reports for teams using AI-assisted development tools
💡 Tracking per-project token consumption to identify cost-intensive workloads
💡 Comparing cost efficiency across different AI coding agents on the same tasks
💡 Setting up budget alerts by integrating JSON output with monitoring pipelines

Quick Start

Run `bunx ccusage` (no install needed) to see all detected sources. Use subcommands like `ccusage claude daily`, `ccusage weekly --since 2026-04-01`, or `ccusage monthly --json` for filtered and structured reports.

Related Projects