by hmenzagh
Deep analytics and session insights for your Claude Code usage
# Add to your Claude Code skills
git clone https://github.com/hmenzagh/CCMeterNo comments yet. Be the first to share your thoughts!
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/hmenzagh/CCMeter/releases/latest/download/ccmeter-installer.sh | sh
ccmeter # launch the dashboard
# press `.` for the settings panel, `q` to quit
CCMeter reads your local Claude Code session data and renders an interactive TUI dashboard. Data refreshes every 5 minutes (manual reload with r).
Metrics & analytics
Visualizations
Rate limit tracking (press t to toggle)
/api/oauth/usage for each Claude OAuth account and shows 5h, 7d, Opus, Sonnet, and Cowork window utilization in real timeextra_usage credits and monthly limits when enabledProject handling & performance
Shift+Tabcurl --proto '=https' --tlsv1.2 -LsSf https://github.com/hmenzagh/CCMeter/releases/latest/download/ccmeter-installer.sh | sh
Install prebuilt binaries via Homebrew:
brew install hmenzagh/tap/ccmeter
git clone https://github.com/hmenzagh/CCMeter.git
cd CCMeter
cargo install --path . # installs `ccmeter` to ~/.cargo/bin (make sure it's in $PATH)
Or build without installing — the binary will be at target/release/ccmeter:
cargo build --release
Requirements (from source): Rust 1.85+ and Cargo.
ccmeter
| Key | Action |
|-----|--------|
| Tab | Cycle time filter |
| Shift+Tab | Switch source root |
| t (or `) | Toggle rate limit tracking view |
| j / k or Up / Down | Scroll projects |
| h / l or Left / Right | Navigate between projects (or credentials in rate tracking) |
| Esc | Deselect project |
| . | Open settings panel |
| r | Reload data |
| q / Ctrl+C | Quit |
Press . to open the settings panel, where you can:
CCMeter discovers Claude Code sessions by scanning your home directory for any folder whose name contains claude and that has a projects/ subdirectory with session logs (so ~/.claude/projects, ~/.config/claude/projects, and other Claude-compatible CLIs are all picked up automatically). It parses JSONL session files in parallel using rayon, extracts token counts and model identifiers, and computes costs from built-in pricing tables.
Session JSONL → parallel parse → daily aggregates → cached history → TUI render
Claude Code logs the same API response in several places — once per streaming chunk, again in every sub-agent's transcript, again in any /compact retry. Summing every line naïvely inflates tokens by 2–3× on busy days.
CCMeter dedupes by requestId (Anthropic's billing unit: one request = one invoice line). For each request it picks the most complete log, then re-emits it as per-chunk deltas so multi-minute streams keep their real timestamps. Activity from non-canonical mirror logs survives as zero-billing "ghost" markers, so active_minutes and code metrics stay accurate even when the canonical log is just a terminal snapshot. User-side patches (Edit/Write acceptances) are deduped by line uuid for the same reason.
Result: totals match what Anthropic actually billed, and the minute-level timeline reflects real activity.
Parsed metrics are persisted to ~/.config/ccmeter/history.json so subsequent launches only re-parse new or modified session files.
The cache is versioned. When CCMeter ships a change that would make pre-existing aggregates wrong (e.g. the dedup work above), the schema is bumped and any older cache is rebuilt from scratch on next launch — a one-time banner explains why historical totals may have shifted. A second banner appears if the cache was unreadable (corruption, disk error). Both dismiss on any keypress.
Upgrading from before the dedup fix? Expect your historical numbers to drop on days with heavy sub-agent or /compact activity. That's the over-counting going away, not data loss.
Use h/l or arrow keys to select a project card. The dashboard switches to a detail view showing:
Press Esc to go back to the global overview.
Press t (or `) to switch to the rate limit tracking view. CCMeter reads your Claude OAuth credentials and polls /api/oauth/usage at randomized intervals (5–10 min per account) to show real-time utilization of each rate limit window.
extra_usage credits and monthly limits when enabled on your planNavigate between accounts with ← / → (or h / l), refresh with r, and press t again to return to the main dashboard.
CCMeter only sees tokens from Claude Code sessions (local JSONL logs). Tokens consumed through the Claude chat (claude.ai web/desktop) count against the same rate limits but are not visible to CCMeter, so forecasts and utilization bars may under-report actual usage when you also chat with Claude alongside coding. Rate limit history is persisted locally at ~/.config/ccmeter/rate-history.json and ~/.config/ccmeter/usage-hit-history.json so session charts and hit timelines survive restarts — delete these files to reset the tracking history.
User overrides are stored at ~/.config/ccmeter/overrides.json and can be edited through the settings panel or manually.
| Crate | Role | |-------|------| | ratatui | Terminal UI framework | | crossterm | Terminal event handling | | clap | CLI argument parsing | | rayon | Parallel JSONL parsing | | chrono | Date/time handling | | serde / serde_json | Serialization & JSONL parsing | | dirs | Cross-platform home/config paths |
src/
├── main.rs # Entry point & event loop
├── app.rs # Core application state & view routing
├── update_check.rs # GitHub release version check
├── config/
│ ├── discovery.rs # Project auto-discovery
│ ├── overrides.rs # User configuration & me