{"id":47097831,"url":"https://github.com/fullstop000/toll","last_synced_at":"2026-03-14T16:01:41.754Z","repository":{"id":343057293,"uuid":"1176118937","full_name":"Fullstop000/toll","owner":"Fullstop000","description":"Token usage statistics for CLI coding agents (Claude Code + Codex)","archived":false,"fork":false,"pushed_at":"2026-03-12T17:45:58.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-12T19:18:40.896Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fullstop000.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-08T16:38:08.000Z","updated_at":"2026-03-12T17:46:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Fullstop000/toll","commit_stats":null,"previous_names":["fullstop000/toll"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Fullstop000/toll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fullstop000%2Ftoll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fullstop000%2Ftoll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fullstop000%2Ftoll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fullstop000%2Ftoll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fullstop000","download_url":"https://codeload.github.com/Fullstop000/toll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fullstop000%2Ftoll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30469100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-03-12T14:53:57.133Z","updated_at":"2026-03-13T15:01:06.249Z","avatar_url":"https://github.com/Fullstop000.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# toll\n\n[![crates.io](https://img.shields.io/crates/v/toll.svg)](https://crates.io/crates/toll)\n\nToken usage statistics for CLI coding agents — Claude Code and Codex CLI.\n\nThe name is a double metaphor: tokens are the *toll* you pay to use AI coding agents, and heavy usage *takes a toll*.\n\n## Features\n\n- Tracks token usage from **Claude Code** (`~/.claude/projects/`) and **Codex CLI** (`~/.codex/sessions/`)\n- Shows input, output, cached tokens, cache hit rate, and estimated USD cost\n- Uses compact `k` / `m` / `b` token units by default, with `--detail` for raw counts\n- Per-model breakdown across all sessions\n- Filter by today, last N days, or all time\n- View per-tool or combined stats\n- List all supported model prices with `--list-prices`\n\n## Supported versions\n\n| Tool | Supported versions | Log format |\n|------|--------------------|------------|\n| [Claude Code](https://github.com/anthropics/claude-code) | All versions (JSONL logs present since launch) | `message.usage` entries in `~/.claude/projects/**/*.jsonl` |\n| [Codex CLI](https://github.com/openai/codex) | ≥ 0.1 (rollout log format) | `token_count` events in `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` |\n\n## Installation\n\n### Quick Install (Linux/macOS)\n\nDownloads the latest GitHub Release for your platform. If a prebuilt binary is not available, the installer falls back to `cargo install toll`.\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/Fullstop000/toll/refs/heads/master/install.sh | sh\n```\n\nInstall to a custom directory:\n\n```sh\ncurl -fsSL https://raw.githubusercontent.com/Fullstop000/toll/refs/heads/master/install.sh | TOLL_INSTALL_DIR=\"$HOME/.local/bin\" sh\n```\n\n### Cargo Install\n\nRequires [Rust](https://rustup.rs/).\n\n```sh\ncargo install toll\n```\n\n### From source\n\n```sh\ngit clone https://github.com/Fullstop000/toll.git\ncd toll\ncargo install --path .\n```\n\n## Usage\n\n```sh\ntoll                # all-time stats\ntoll --today        # today only\ntoll --days 7       # last 7 days\ntoll --claude       # Claude Code only\ntoll --codex        # Codex CLI only\ntoll --detail       # show full token counts\ntoll --list-prices  # show all supported model prices\n```\n\n## Example output\n\n```\nToken usage — all time\nCollected: 2026-03-09 01:44:23 +08:00\n\n                                   Claude Code            Codex         Combined\n  ═════════════════════════════════════════════════════════════════════════════════\n  Sessions                                  24               14               38\n  ─────────────────────────────────────────────────────────────────────────────────\n  Input tokens                          200.4m          111.4m          311.8m\n    ↳ cached                     194.0m ( 96.8%)  103.8m ( 93.2%)  297.8m ( 95.5%)\n    ↳ net (non-cached)                  6.5m             7.5m            14.0m\n  Output tokens                          766.9k          578.5k            1.3m\n  ─────────────────────────────────────────────────────────────────────────────────\n  Total tokens                          201.2m          111.9m          313.1m\n  ─────────────────────────────────────────────────────────────────────────────────\n  Estimated cost (USD)                  $91.29           $28.17          $119.46\n\n  By model:\n  ─────────────────────────────────────────────────────────────────────────────────\n  Model                                 Tokens           Output             Cost\n  ─────────────────────────────────────────────────────────────────────────────────\n  claude-haiku-4-5-20251001              6.8m            22.0k            $1.72\n  claude-opus-4-6                        1.0m            19.2k            $2.09\n  claude-sonnet-4-6                    194.1m           725.7k           $87.49\n  gpt-5.4                              111.9m           578.5k           $28.17\n  ─────────────────────────────────────────────────────────────────────────────────\n\n  Scanned 38 session(s) in 1.00s\n```\n\n## Data sources\n\n| Tool | Log path | Token field |\n|------|----------|-------------|\n| Claude Code | `~/.claude/projects/**/*.jsonl` | `message.usage` per API call — sums `input_tokens`, `cache_creation_input_tokens`, `cache_read_input_tokens`, `output_tokens` |\n| Codex CLI | `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` | last `token_count` event per session (cumulative totals) |\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstop000%2Ftoll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffullstop000%2Ftoll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffullstop000%2Ftoll/lists"}