π AI coding agent usage tracker β analyze token usage and costs from local data.
Supports GitHub Copilot CLI and Claude Code. Inspired by ccusage (11.8kβ). 100% offline, zero telemetry.
- π Daily/Monthly reports β token usage aggregated by date
- π¬ Session breakdown β per-session details with repo, model, tools
- π€ Model analysis β cost distribution across models with visual share bars
- π° Cost estimation β based on known model pricing
- π 100% offline β reads only
~/.copilot/and~/.claude/local data, never sends anything externally - π JSON export β
--jsonflag for scripting and automation - π Multi-provider β unified view across Copilot CLI and Claude Code
# Run directly β no install needed
npx gcusage
# Or install globally
npm i -g gcusage
gcusagegcusage # Daily report β all providers (default)
gcusage daily # Daily token usage and costs
gcusage monthly # Monthly aggregated report
gcusage session # Per-session breakdown
gcusage models # Per-model usage distribution-p, --provider <p> # Data source: copilot, claude, or all (default: all)
--since YYYYMMDD # Filter sessions since date
--until YYYYMMDD # Filter sessions until date
--json # Output as JSON# All providers β last 7 days
gcusage --since 20260317
# Claude Code only
gcusage -p claude
# Copilot only β March 2026 as JSON
gcusage monthly -p copilot --since 20260301 --until 20260331 --json
# Session details for this week
gcusage session --since 20260320π GitHub Copilot CLI β Daily Usage Report
ββββββββββββββ¬βββββββββββ¬ββββββββββββββββ¬βββββββββββββ¬ββββββββββββ¬βββββββββ¬βββββββββββββββββββββββ
β Date β Sessions β Output Tokens β Est. Input β Est. Cost β Tools β Models β
ββββββββββββββΌβββββββββββΌββββββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββΌβββββββββββββββββββββββ€
β 2026-03-23 β 45 β 92,577 β 32,911 β $7.31 β 299 β claude-opus-4.6-1m β
β 2026-03-24 β 19 β 108,035 β 10,381 β $8.26 β 367 β claude-opus-4.6-1m β
ββββββββββββββΌβββββββββββΌββββββββββββββββΌβββββββββββββΌββββββββββββΌβββββββββΌβββββββββββββββββββββββ€
β Total β 701 β 1,105,358 β 460,275 β $35.04 β 14,053 β β
ββββββββββββββ΄βββββββββββ΄ββββββββββββββββ΄βββββββββββββ΄ββββββββββββ΄βββββββββ΄βββββββββββββββββββββββ
gcusage reads from local data only β no network requests, ever.
| File | Data |
|---|---|
~/.copilot/session-state/<id>/events.jsonl |
Token counts, tool calls, model info |
~/.copilot/session-state/<id>/workspace.yaml |
Session metadata (repo, branch, summary) |
~/.copilot/config.json |
Current model selection |
| File | Data |
|---|---|
~/.claude/stats-cache.json |
Daily activity, per-model tokens, aggregate usage |
~/.claude/history.jsonl |
Per-message history with session IDs, projects |
- Copilot output tokens: Direct from
assistant.message.data.outputTokens - Claude output tokens: From
stats-cache.jsondaily model token aggregates - Input tokens: Estimated from user message content (~4 chars/token)
- Cost: Calculated per-model using known pricing tables
- β 100% offline β never connects to any external service
- β Read-only β only reads Copilot CLI and Claude Code local files
- β No telemetry β zero analytics, zero tracking, zero data collection
- β Open source β MIT license, audit the code yourself
| Tool | β | Copilot CLI | Offline | Language |
|---|---|---|---|---|
| gcusage | new | β | β 100% | TypeScript |
| ccusage | 11.8k | β Claude only | β | TypeScript |
| tokscale | 1.3k | β | Rust | |
| splitrail | 134 | β | Rust | |
| aidash | 0 | β | β | Rust |
git clone https://github.com/chongdihuang/gcusage
cd gcusage
npm install
npm run dev # Run with tsx
npm run build # Build with tsup
npm test # Run testsMIT Β© Chongdi Huang