ccreport
v2.8.5
Published
Claude Code usage reporter - View official usage stats and OpenTelemetry metrics
Maintainers
Readme
ccreport
Claude Code / Codex usage reporter - View usage stats, OpenTelemetry metrics, and cost reports from the command line.
Installation
npm install -g ccreportUpdate
npm install -g ccreport@latestUsage
# Show all data: official API + Codex + OTel + cost (default)
ccreport
# Show usage only (Claude Code + Codex)
ccreport usage
# Show OTel metrics only
ccreport otel
# Show cost report
ccreport cost
# Sync all data to dashboard
ccreport push
# Environment check & setup
ccreport setup
# JSON output
ccreport --json
# Verbose mode
ccreport -v
# Help
ccreport --helpOutput Example
📊 Claude Code Usage (Official API)
────────────────────────────────────────
Session (5h): 71% used
Resets at: 5:00pm (Asia/Saigon)
Weekly (1W): 74% used
Resets at: Feb 5, 12:00pm (Asia/Saigon)
📡 Data source: Official Anthropic API
📊 Codex Usage
────────────────────────────────────────
Session (5h): 2% used
Resets at: 3:30pm (Asia/Saigon)
Weekly (1W): 9% used
Resets at: Feb 10, 12:00pm (Asia/Saigon)
📡 Data source: OpenAI Codex APICommands
| Command | Description |
|---------|-------------|
| ccreport | Show official API + Codex + OTel + cost |
| ccreport usage | Show Claude Code + Codex usage |
| ccreport otel | Show OTel metrics only |
| ccreport cost | Show cost report |
| ccreport push | Sync official API + OTel + cost to dashboard |
| ccreport setup | Environment check & setup |
Data Sources
Official API (Claude Code)
- Requires Claude Code login
- Shows exact usage percentage (matches
/usagecommand) - Includes reset times
Codex API
- Requires Codex CLI login (
codexcommand) - Shows session/weekly usage percentage
- Shows reviews usage and credits balance
- Skipped automatically if not logged in
OpenTelemetry (OTel)
- Requires OTel collector setup
- Shows detailed token breakdown
- Shows cost by model
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| CODEX_HOME | Codex data directory | ~/.codex |
| OTEL_DATA_DIR | OTel data directory | ~/.claude-otel/data |
| SYNC_API_URL | Dashboard sync API URL | (public dashboard) |
| SYNC_USER_ID | User ID for sync | $USER |
Requirements
- Node.js >= 18.0.0
- Claude Code login (for official API)
- Codex CLI login (optional, for Codex usage)
- OTel collector (optional, for detailed metrics)
License
MIT
