{"id":48450170,"url":"https://github.com/hmenzagh/ccmeter","last_synced_at":"2026-04-12T01:02:06.213Z","repository":{"id":349357129,"uuid":"1201997397","full_name":"hmenzagh/CCMeter","owner":"hmenzagh","description":"Deep analytics and session insights for your Claude Code usage","archived":false,"fork":false,"pushed_at":"2026-04-06T18:40:55.000Z","size":740,"stargazers_count":87,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T20:33:07.274Z","etag":null,"topics":["analytics","claude","claude-code","cost-tracking","dashboard","metrics","token-counter"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmenzagh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-05T13:06:51.000Z","updated_at":"2026-04-06T19:00:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/hmenzagh/CCMeter","commit_stats":null,"previous_names":["hmenzagh/ccmeter"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hmenzagh/CCMeter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmenzagh%2FCCMeter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmenzagh%2FCCMeter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmenzagh%2FCCMeter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmenzagh%2FCCMeter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmenzagh","download_url":"https://codeload.github.com/hmenzagh/CCMeter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmenzagh%2FCCMeter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","claude","claude-code","cost-tracking","dashboard","metrics","token-counter"],"created_at":"2026-04-06T20:01:26.403Z","updated_at":"2026-04-07T21:00:44.585Z","avatar_url":"https://github.com/hmenzagh.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.svg\" width=\"280\" alt=\"CCMeter logo\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA terminal dashboard for Claude Code usage analytics\u003c/strong\u003e\u003cbr/\u003e\n  Track tokens, costs, code generation, and efficiency, all from your terminal.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/rust-1.85%2B-orange?logo=rust\" alt=\"Rust 1.85+\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue\" alt=\"Platform\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"License\" /\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/dashboard.png\" alt=\"CCMeter dashboard view\" /\u003e\n\u003c/p\u003e\n\n## Quick start\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/hmenzagh/CCMeter/releases/latest/download/ccmeter-installer.sh | sh\nccmeter          # launch the dashboard\n# press `.` for the settings panel, `q` to quit\n```\n\n## Overview\n\nCCMeter reads your local Claude Code session data and renders an interactive TUI dashboard. Data refreshes every 5 minutes (manual reload with `r`).\n\n**Metrics \u0026 analytics**\n- **Cost tracking** — per-model USD breakdown (Opus, Sonnet, Haiku) via built-in pricing tables\n- **Token analytics** — input, output, and prompt cache usage over time\n- **Code metrics** — lines suggested, accepted, added, and deleted, with acceptance rate\n- **Active time estimation** — approximates how long you actually spent working on each project from session activity\n- **Efficiency score** — tokens per line of code changed (tok/ln, lower is better); each card has a quartile gauge (green → yellow → red) comparing it to other projects\n- **KPI banner** — total cost, current streak, active days, avg tokens/day, and efficiency score at a glance\n\n**Visualizations**\n- **Heatmaps** — four GitHub-style contribution grids (input, output, lines changed, acceptance rate) with trend sparklines; minute-level granularity on 1h / 12h / Today filters\n- **Project cards** — scrollable grid with per-project sparklines colored by model usage\n- **Per-project detail** — dedicated charts, model distribution, cost sparklines, and estimated active time\n- **Time filters** — 1h, 12h, Today, Last week, Last month, All\n\n**Project handling \u0026 performance**\n- **Auto-discovery \u0026 grouping** — finds Claude projects and groups them by git repository\n- **Multi-source roots** — switch between Claude config directories with `Shift+Tab`\n- **Persistent cache** — historical metrics cached locally for near-instant startup; only new sessions get parsed\n- **Responsive layout** — heatmaps and card grids adapt to terminal size\n\n## Installation\n\n### Install script (recommended)\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/hmenzagh/CCMeter/releases/latest/download/ccmeter-installer.sh | sh\n```\n\n### Homebrew\n\nInstall prebuilt binaries via Homebrew:\n\n```bash\nbrew install hmenzagh/tap/ccmeter\n```\n\n### From source\n\n```bash\ngit clone https://github.com/hmenzagh/CCMeter.git\ncd CCMeter\ncargo install --path .     # installs `ccmeter` to ~/.cargo/bin (make sure it's in $PATH)\n```\n\nOr build without installing — the binary will be at `target/release/ccmeter`:\n\n```bash\ncargo build --release\n```\n\n**Requirements (from source):** Rust 1.85+ and Cargo.\n\n## Usage\n\n```bash\nccmeter\n```\n\n### Keybindings\n\n| Key | Action |\n|-----|--------|\n| `Tab` | Cycle time filter |\n| `Shift+Tab` | Switch source root |\n| `j` / `k` or `Up` / `Down` | Scroll projects |\n| `h` / `l` or `Left` / `Right` | Navigate between projects |\n| `Esc` | Deselect project |\n| `.` | Open settings panel |\n| `r` | Reload data |\n| `q` / `Ctrl+C` | Quit |\n\n### Settings panel\n\nPress `.` to open the settings panel, where you can:\n\n- **Rename** projects with custom display names\n- **Merge** multiple projects into a single group\n- **Split** sources out of auto-detected groups\n- **Star** favorites (animated rainbow border)\n- **Hide** projects from the dashboard\n\n## How it works\n\nCCMeter 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](https://github.com/rayon-rs/rayon), extracts token counts and model identifiers, and computes costs from built-in pricing tables.\n\n```\nSession JSONL → parallel parse → daily aggregates → cached history → TUI render\n```\n\n### Cache\n\nParsed metrics are persisted to `~/.config/ccmeter/history.json`. On subsequent launches, only new or modified session files are parsed, everything else is served from cache, making startup near-instant even with thousands of sessions.\n\n### Per-project view\n\nUse `h`/`l` or arrow keys to select a project card. The dashboard switches to a detail view showing:\n\n- Cost and token charts scoped to that project (daily or minute-level depending on time filter)\n- Model distribution bar with per-model cost breakdown\n- Active time estimate, sessions count, lines added/deleted, and efficiency gauge\n- Heatmaps filtered to the selected project only\n\nPress `Esc` to go back to the global overview.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/project.png\" alt=\"CCMeter per-project view\" /\u003e\n\u003c/p\u003e\n\n## Configuration\n\nUser overrides are stored at `~/.config/ccmeter/overrides.json` and can be edited through the settings panel or manually.\n\n## Tech stack\n\n| Crate | Role |\n|-------|------|\n| [ratatui](https://ratatui.rs) | Terminal UI framework |\n| [crossterm](https://github.com/crossterm-rs/crossterm) | Terminal event handling |\n| [clap](https://github.com/clap-rs/clap) | CLI argument parsing |\n| [rayon](https://github.com/rayon-rs/rayon) | Parallel JSONL parsing |\n| [chrono](https://github.com/chronotope/chrono) | Date/time handling |\n| [serde](https://serde.rs) / [serde_json](https://github.com/serde-rs/json) | Serialization \u0026 JSONL parsing |\n| [dirs](https://github.com/dirs-dev/dirs-rs) | Cross-platform home/config paths |\n\n## Project structure\n\n```\nsrc/\n├── main.rs               # Entry point \u0026 event loop\n├── app.rs                # Core application state\n├── config/\n│   ├── mod.rs\n│   ├── discovery.rs      # Project auto-discovery\n│   └── overrides.rs      # User configuration \u0026 merges\n├── data/\n│   ├── mod.rs\n│   ├── parser.rs         # JSONL session parsing\n│   ├── cache.rs          # Persistent metric cache\n│   ├── tokens.rs         # Daily token aggregation\n│   └── models.rs         # Model pricing tables\n└── ui/\n    ├── mod.rs\n    ├── dashboard.rs      # Main layout\n    ├── heatmap.rs        # Heatmap rendering\n    ├── theme.rs          # Color theme\n    ├── time_filter.rs    # Time range logic\n    ├── settings_view.rs  # Settings panel\n    └── cards/\n        ├── mod.rs\n        ├── data.rs       # Card data aggregation\n        └── render.rs     # Card rendering\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmenzagh%2Fccmeter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmenzagh%2Fccmeter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmenzagh%2Fccmeter/lists"}