{"id":49901448,"url":"https://github.com/dreamiurg/tokenking","last_synced_at":"2026-05-16T06:37:00.520Z","repository":{"id":322937024,"uuid":"1091498389","full_name":"dreamiurg/tokenking","owner":"dreamiurg","description":"Analyze Claude Code token usage and costs for a specific project","archived":false,"fork":false,"pushed_at":"2025-11-07T07:07:36.000Z","size":259,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-07T07:11:58.776Z","etag":null,"topics":["analytics","ccusage","claude-code","cli","tokens"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dreamiurg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2025-11-07T05:13:41.000Z","updated_at":"2025-11-07T07:07:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dreamiurg/tokenking","commit_stats":null,"previous_names":["dreamiurg/tokenking"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/dreamiurg/tokenking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamiurg%2Ftokenking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamiurg%2Ftokenking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamiurg%2Ftokenking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamiurg%2Ftokenking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dreamiurg","download_url":"https://codeload.github.com/dreamiurg/tokenking/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dreamiurg%2Ftokenking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33092731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"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","ccusage","claude-code","cli","tokens"],"created_at":"2026-05-16T06:36:55.791Z","updated_at":"2026-05-16T06:37:00.512Z","avatar_url":"https://github.com/dreamiurg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TokenKing\n\n[![npm version](https://img.shields.io/npm/v/tokenking.svg)](https://www.npmjs.com/package/tokenking)\n[![npm downloads](https://img.shields.io/npm/dm/tokenking.svg)](https://www.npmjs.com/package/tokenking)\n[![GitHub Release](https://img.shields.io/github/v/release/dreamiurg/tokenking)](https://github.com/dreamiurg/tokenking/releases)\n[![CI/Release](https://github.com/dreamiurg/tokenking/actions/workflows/release.yml/badge.svg)](https://github.com/dreamiurg/tokenking/actions/workflows/release.yml)\n[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA simple CLI tool that shows how much Claude Code usage a specific project has consumed.\n\n## What it does\n\nAnalyzes your Claude Code session history and shows aggregated statistics for a specific project:\n\n- Total sessions and date range\n- Token usage (input, output, cache creation/read)\n- Models used\n- Estimated costs in USD\n\n## Requirements\n\n- Node.js \u003e= 18\n\n## Installation\n\n```bash\n# Install globally\nnpm install -g tokenking\n\n# Or use with npx (no installation required)\nnpx tokenking ~/src/my-project\n```\n\n## Usage\n\n```bash\n# Analyze current directory\ntokenking .\n\n# Analyze specific project\ntokenking ~/src/my-project\n\n# Show help\ntokenking --help\n\n# Show version\ntokenking --version\n\n# Or use with npx\nnpx tokenking ~/src/my-project\n```\n\n## Example Output\n\n```\n📊 TokenKing Report\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\nProject: /path/to/my-project\n\nSessions: 12\nFirst Session: 2025-10-15\nLast Session: 2025-11-06\nDate Range: 22 days\n\nTotal Tokens: 2,450,789\n  Input: 1,234,567 tokens\n  Output: 456,789 tokens\n  Cache Create: 234,567 tokens\n  Cache Read: 524,866 tokens\n\nModels Used:\n  • claude-sonnet-4-5-20250929\n  • claude-haiku-4-5-20251001\n\nEstimated Cost: $45.67 USD\n```\n\n## How it works\n\nTokenKing is built with TypeScript and uses [ccusage](https://github.com/ryoppippi/ccusage) as a dependency to read Claude Code session data. It loads all sessions, filters by project path (with support for moved directories via basename matching), then aggregates and displays the results.\n\n## Dependencies\n\n- `ccusage` - Reads Claude Code session data from `~/.claude/projects/`\n- `picocolors` - Terminal colors for output formatting\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamiurg%2Ftokenking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdreamiurg%2Ftokenking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdreamiurg%2Ftokenking/lists"}