{"id":49859139,"url":"https://github.com/wcruz-br/claude-usage-dashboard","last_synced_at":"2026-05-14T21:07:05.028Z","repository":{"id":351940010,"uuid":"1212936003","full_name":"wcruz-br/claude-usage-dashboard","owner":"wcruz-br","description":"Real-time Claude Code usage monitor","archived":false,"fork":false,"pushed_at":"2026-04-24T21:51:49.000Z","size":73,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T23:29:24.637Z","etag":null,"topics":["ai","ai-tools","claude","claude-code"],"latest_commit_sha":null,"homepage":"","language":"Python","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/wcruz-br.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-16T22:04:39.000Z","updated_at":"2026-04-24T21:51:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wcruz-br/claude-usage-dashboard","commit_stats":null,"previous_names":["wcruz-br/claude-usage-dashboard"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wcruz-br/claude-usage-dashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcruz-br%2Fclaude-usage-dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcruz-br%2Fclaude-usage-dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcruz-br%2Fclaude-usage-dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcruz-br%2Fclaude-usage-dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wcruz-br","download_url":"https://codeload.github.com/wcruz-br/claude-usage-dashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wcruz-br%2Fclaude-usage-dashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33043313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ai","ai-tools","claude","claude-code"],"created_at":"2026-05-14T21:07:04.205Z","updated_at":"2026-05-14T21:07:05.019Z","avatar_url":"https://github.com/wcruz-br.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-usage-dashboard\n\nReal-time Claude Code usage monitor for the terminal (Pro/Max plans).\n\n## Prerequisites\n\n- Python 3.11+\n- Claude Code installed and authenticated (`~/.claude/.credentials.json` must exist)\n\n## Installation\n\nNo external dependencies. Clone the repository and run directly:\n\n```bash\ngit clone https://github.com/wcruz-br/claude-usage-dashboard.git\ncd claude-usage-dashboard\n```\n\n## Usage\n\n```bash\npython claude_usage.py\n```\n\nThe dashboard refreshes automatically every 5 minutes. Press `Ctrl+C` to exit.\n\n### Example output\n\n![output](printscreen.png)\n\nBars change color based on utilization: green (\u003c 60%), yellow (60–84%), red (≥ 85%).\n\n## Configuration\n\nNo environment variables. The only tunable constants are in the script itself:\n\n| Constant | Default | Description |\n|---|---|---|\n| `REFRESH_INTERVAL_SECONDS` | `300` | Refresh interval (seconds) |\n| `BAR_WIDTH` | `30` | Progress bar width (characters) |\n\n## Contributing\n\n### Linting\n\nThe project uses [ruff](https://docs.astral.sh/ruff/) for linting and formatting. `ruff.toml` contains project-specific rules.\n\n```bash\nruff check --fix claude_usage.py\nruff format claude_usage.py\n```\n\n### API endpoint\n\nThe script queries `GET https://api.anthropic.com/api/oauth/usage` with the header `anthropic-beta: oauth-2025-04-20`. Response shape:\n\n```json\n{\n  \"five_hour\": { \"utilization\": 4.0, \"resets_at\": \"2026-04-16T17:45:00Z\" },\n  \"seven_day\":  { \"utilization\": 31.0, \"resets_at\": \"2026-04-20T09:00:00Z\" }\n}\n```\n\n`utilization` is a raw percentage (e.g. `4.0` = 4%). Either field can be `null`. This endpoint is undocumented and may change without notice. If the script breaks, check whether `~/.claude/.credentials.json` changed format or the endpoint was updated. Alternative: [ccusage](https://github.com/ryoppippi/ccusage).\n\n### Submitting changes\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/your-feature`)\n3. Commit your changes following [Conventional Commits](https://www.conventionalcommits.org/)\n4. Open a pull request describing what changed and why\n\n## Author\n\n**[Willian Cruz](https://github.com/wcruz-br)** · [LinkedIn](https://linkedin.com/in/wcruz) · [wcruz.br@gmail.com](mailto:wcruz.br@gmail.com)\n\n## Contributors\n\nThanks to everyone who has contributed to this project:\n\n- [Tiago Miranda](https://github.com/mirandaftiago) — User-Agent honesty refactor, ANSI clear screen, HTTP error body logging, cross-platform credential resolution\n\n## License\n\nThis project is licensed under [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/).\n\nYou are free to share and adapt the material for any purpose, provided appropriate credit is given.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwcruz-br%2Fclaude-usage-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwcruz-br%2Fclaude-usage-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwcruz-br%2Fclaude-usage-dashboard/lists"}