{"id":50537236,"url":"https://github.com/sebasrodriguez/tokentap","last_synced_at":"2026-06-03T17:30:39.830Z","repository":{"id":344910992,"uuid":"1183678561","full_name":"sebasrodriguez/tokentap","owner":"sebasrodriguez","description":"Native macOS menu bar app that monitors your Claude Pro/Max session and weekly usage in real-time","archived":false,"fork":false,"pushed_at":"2026-03-20T19:07:23.000Z","size":1617,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-21T05:52:58.416Z","etag":null,"topics":["claude","claude-code","codex","developer-tools","macos","menu-bar","openai","rate-limits","swiftui","usage-tracker"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/sebasrodriguez.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":"2026-03-16T21:09:07.000Z","updated_at":"2026-03-20T19:07:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sebasrodriguez/tokentap","commit_stats":null,"previous_names":["sebasrodriguez/claudometer","sebasrodriguez/tokentap"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/sebasrodriguez/tokentap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebasrodriguez%2Ftokentap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebasrodriguez%2Ftokentap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebasrodriguez%2Ftokentap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebasrodriguez%2Ftokentap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebasrodriguez","download_url":"https://codeload.github.com/sebasrodriguez/tokentap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebasrodriguez%2Ftokentap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33876327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"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":["claude","claude-code","codex","developer-tools","macos","menu-bar","openai","rate-limits","swiftui","usage-tracker"],"created_at":"2026-06-03T17:30:39.773Z","updated_at":"2026-06-03T17:30:39.824Z","avatar_url":"https://github.com/sebasrodriguez.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TokenTap\n\nMulti-provider macOS menu bar app that monitors your AI session usage in real-time. Supports Claude Code and OpenAI Codex, with more providers coming.\n\n![macOS](https://img.shields.io/badge/macOS-14%2B-blue) ![Swift](https://img.shields.io/badge/Swift-5.9-orange) ![License](https://img.shields.io/badge/license-MIT-green)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/screenshot.png\" alt=\"TokenTap dropdown showing Claude and Codex usage\" width=\"320\"\u003e\n\u003c/p\u003e\n\n## How it works\n\nTokenTap polls your AI provider usage in the background and displays it in your macOS menu bar. Each provider uses its own strategy:\n\n- **Claude Code** — calls the Anthropic OAuth usage API (`api.anthropic.com/api/oauth/usage`) using the token from macOS Keychain\n- **OpenAI Codex** — makes a minimal API call to the Codex backend and reads rate limit data from response headers\n\nLightweight HTTP requests — no CLI processes spawned, no terminal parsing. The menu bar auto-rotates between providers, and clicking shows the full breakdown for all of them.\n\n## Features\n\n- **Multi-provider** — track Claude Code and OpenAI Codex usage simultaneously\n- **Menu bar indicator** — fill bar + percentage for the active provider\n- **Auto-rotation** — cycles between providers in the menu bar (configurable: 10/20/30s)\n- **Detailed dropdown** — click to see all providers with their usage tiers, progress bars, and reset times\n- **Auto-refresh** — polls each provider on a configurable interval (1–30 min, default 5 min)\n- **Cached data** — last known usage loads instantly on launch\n- **Notifications** — macOS alerts when usage crosses configurable thresholds\n- **Configurable** — display mode, rotation speed, refresh interval, thresholds, CLI paths\n- **Zero dependencies** — native SwiftUI app, no external libraries\n- **Pluggable architecture** — adding a new provider is one file + one enum case\n\n## Supported Providers\n\n| Provider | Method | What it tracks |\n|----------|--------|----------------|\n| Claude Code | Anthropic OAuth usage API | Session %, Weekly %, Sonnet %, Opus %, reset times |\n| OpenAI Codex | Codex backend API response headers | 5h session %, Weekly %, reset times |\n\n## Requirements\n\n- macOS 14.0+\n- At least one supported tool installed and authenticated:\n  - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) — must be logged in (token stored in macOS Keychain)\n  - [OpenAI Codex](https://github.com/openai/codex) — must be logged in (`~/.codex/auth.json`)\n- Xcode or Swift toolchain (to build from source)\n\n## Install\n\n### Homebrew (recommended)\n\n```bash\nbrew tap sebasrodriguez/tap\nbrew install tokentap\n```\n\nThen launch:\n\n```bash\nopen $(brew --prefix)/opt/tokentap/TokenTap.app\n```\n\nOptionally link to Applications:\n\n```bash\nln -sf $(brew --prefix)/opt/tokentap/TokenTap.app /Applications/TokenTap.app\n```\n\n### Build from source\n\n```bash\ngit clone https://github.com/sebasrodriguez/tokentap.git\ncd tokentap/TokenTap\nmake install\nopen TokenTap.app\n```\n\n## Usage\n\nOnce launched, TokenTap appears in your menu bar with a fill bar and provider usage (e.g. `CL 34%`). With multiple providers, it auto-rotates between them.\n\n**Click** the menu bar item to see all providers:\n- **Claude** — Session, Weekly (all models), and Sonnet usage with progress bars and reset times\n- **Codex** — 5h session limit and weekly limit with reset times\n\n**Settings** (gear icon in dropdown):\n- **General** — menu bar style, rotation speed, notification thresholds\n- **Claude** — refresh interval, CLI binary path\n- **Codex** — refresh interval\n\n## Architecture\n\n```\n    ProviderManager (SwiftUI MenuBarExtra)\n    │\n    ├── ProviderState (Claude)\n    │   └── ClaudeProvider\n    │       ├── ClaudePoller  — GET api.anthropic.com/api/oauth/usage (Keychain token)\n    │       └── ClaudeParser  — maps JSON { five_hour, seven_day, ... } → UsageTiers\n    │\n    └── ProviderState (Codex)\n        └── CodexProvider\n            ├── CodexPoller   — POST chatgpt.com/backend-api/codex/responses (~/.codex/auth.json)\n            └── CodexParser   — reads x-codex-*-used-percent response headers\n```\n\nAdding a new provider requires:\n1. A `*Provider.swift` implementing the `UsageProvider` protocol\n2. A `*Poller.swift` to fetch usage data (API call, scraping, etc.)\n3. A `*Parser.swift` to convert the response into `[UsageTier]`\n4. One case added to `ProviderKind`\n\n## Troubleshooting\n\n**No Claude data** — Make sure Claude Code is installed and logged in. TokenTap reads the OAuth token from macOS Keychain (`Claude Code-credentials`). Try `claude /usage` to verify your login works.\n\n**No Codex data** — Make sure Codex CLI is installed and logged in (`codex login`). TokenTap reads the auth token from `~/.codex/auth.json`.\n\n**No data on first launch** — The first poll takes a few seconds. Subsequent launches show cached data immediately.\n\n**Stale data** — Click \"Refresh All\" in the dropdown to force a fresh poll.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebasrodriguez%2Ftokentap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebasrodriguez%2Ftokentap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebasrodriguez%2Ftokentap/lists"}