{"id":49457028,"url":"https://github.com/gehariharan/tokenwatcher","last_synced_at":"2026-04-30T07:01:46.472Z","repository":{"id":354584961,"uuid":"1224272410","full_name":"gehariharan/Tokenwatcher","owner":"gehariharan","description":"CodexBar for Windows: a system-tray app that shows OpenAI Codex and Claude usage / rate-limit windows live. Electron + Python sidecar.","archived":false,"fork":false,"pushed_at":"2026-04-29T06:29:44.000Z","size":2313,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-29T08:17:05.891Z","etag":null,"topics":["anthropic","chatgpt","claude","claude-ai","claude-code","codex","codex-cli","codexbar","codexbar-windows","developer-tools","electron","openai","openai-codex","rate-limit","system-tray","tray-app","usage-monitor","usage-tracker","windows","windows-app"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/gehariharan.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-04-29T05:54:48.000Z","updated_at":"2026-04-29T06:29:47.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gehariharan/Tokenwatcher","commit_stats":null,"previous_names":["gehariharan/tokenwatcher"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gehariharan/Tokenwatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gehariharan%2FTokenwatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gehariharan%2FTokenwatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gehariharan%2FTokenwatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gehariharan%2FTokenwatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gehariharan","download_url":"https://codeload.github.com/gehariharan/Tokenwatcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gehariharan%2FTokenwatcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32457110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","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":["anthropic","chatgpt","claude","claude-ai","claude-code","codex","codex-cli","codexbar","codexbar-windows","developer-tools","electron","openai","openai-codex","rate-limit","system-tray","tray-app","usage-monitor","usage-tracker","windows","windows-app"],"created_at":"2026-04-30T07:01:45.567Z","updated_at":"2026-04-30T07:01:46.466Z","avatar_url":"https://github.com/gehariharan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"assets/icon.png\" alt=\"TokenWatcher\" width=\"128\" height=\"128\" /\u003e\n\n# TokenWatcher\n\n**A native Windows system-tray app that shows your OpenAI Codex and Claude usage limits at a glance.**\n\n*The Windows alternative to [CodexBar](https://github.com/steipete/CodexBar) — same idea (live OpenAI Codex + Claude rate-limit windows in your menu bar), built from scratch for Windows users who want the same experience without WSL, browser-cookie scraping, or admin tricks.*\n\n[![Release](https://img.shields.io/github/v/release/gehariharan/Tokenwatcher?include_prereleases\u0026label=download)](https://github.com/gehariharan/Tokenwatcher/releases)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Platform](https://img.shields.io/badge/platform-Windows%2010%20%7C%2011-0078D6)](https://github.com/gehariharan/Tokenwatcher/releases)\n\n\u003c/div\u003e\n\n\u003e **CodexBar for Windows** — Inspired by [steipete/CodexBar](https://github.com/steipete/CodexBar) on macOS. This is a Windows-specific Electron implementation, rebuilt from scratch to avoid WSL, browser-cookie scraping, and admin requirements.\n\n---\n\n## What it shows\n\n- **OpenAI Codex** — live 5h / 7d window utilization, plan, account email\n- **Claude** — live 5h / 7d / Sonnet / Opus utilization, plan tier, account email\n\nHover the tray icon, and the panel slides up. No clicks, no extra windows.\n\n## Install (end-users)\n\nThree ways:\n\n### winget (recommended — no SmartScreen warnings)\n```powershell\nwinget install gehariharan.TokenWatcher\n```\n*(Available once the [winget submission](docs/winget-submission.md) is merged.)*\n\n### Microsoft Store\n[**Get it from Microsoft**](https://apps.microsoft.com) *(coming soon — see [submission notes](docs/microsoft-store-submission.md))*\n\n### Direct download\n1. Grab `TokenWatcher-Setup-x.y.z.exe` from the **[Releases page](https://github.com/gehariharan/Tokenwatcher/releases)**\n2. Run it (Windows SmartScreen will warn — click **More info → Run anyway**; it's unsigned but open-source)\n3. Pin the tray icon: click the `^` near the clock and **drag the TokenWatcher icon onto the taskbar**\n\n## Configuration\n\nClick the gear icon ⚙ in the panel header to:\n- Toggle **Watch OpenAI Codex** — disable if you don't use Codex\n- Toggle **Watch Claude** — disable to skip the Edge sign-in flow entirely\n\nSettings live at `%APPDATA%\\TokenWatcher\\settings.json`.\n\n## How it works\n\n- **Codex** — reads the OpenAI Codex CLI's OAuth token from `~/.codex/auth.json` and calls the same private endpoint the CLI uses (`chatgpt.com/backend-api/wham/usage`). No additional sign-in needed if you already use the `codex` CLI.\n- **Claude** — a one-time sign-in launches Microsoft Edge against `claude.ai/login` with a dedicated user-data-dir. After you sign in, TokenWatcher reads the `sessionKey` cookie via Edge's DevTools Protocol, encrypts it with Windows DPAPI, and stores it locally. Live usage data is then fetched directly from `claude.ai`'s usage API.\n\n| Component | Purpose |\n|---|---|\n| **Electron** shell | System tray, side-panel BrowserWindow, IPC routing |\n| **Pure Node** Codex provider | Reads `~/.codex/auth.json` + HTTPS GET to `chatgpt.com` |\n| **Python sidecar** Claude provider | Edge CDP login flow + DPAPI session storage + `curl_cffi` (defeats Cloudflare's TLS fingerprinting) |\n\n### Why a Python sidecar?\n\n`claude.ai` sits behind Cloudflare with TLS / JA3 fingerprinting. Plain Node `fetch` (and Python `requests`) get blocked with *\"Just a moment…\"*. Python's [`curl_cffi`](https://github.com/yifeikong/curl_cffi) impersonates Chrome's TLS handshake and gets through cleanly. The sidecar is shipped as a single PyInstaller `.exe` inside the installer — users never see Python.\n\n## Privacy \u0026 security\n\n- TokenWatcher only ever talks to `chatgpt.com` and `claude.ai`. No third-party servers, no telemetry.\n- The Claude sign-in launches Edge with a **dedicated profile directory** (`~/.tokenwatcher/edge-profile/`) — your normal Edge profile is never touched.\n- The captured `sessionKey` cookie is encrypted with [Windows DPAPI](https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-use-data-protection) before being written to disk. Only your Windows user account can decrypt it.\n- Source code is open and auditable.\n\n## Build from source\n\n### Prerequisites\n- Windows 10 / 11\n- [Node.js](https://nodejs.org/) 18+\n- [Python](https://www.python.org/) 3.10+ (for the Claude sidecar; not needed at runtime — only at build time)\n- Microsoft Edge (preinstalled on Windows)\n\n### Setup\n\n```powershell\ngit clone git@github.com:gehariharan/Tokenwatcher.git\ncd Tokenwatcher\n\n# Install Electron + dev deps\nnpm install\n\n# Set up the Python venv for the sidecar\npython -m venv .venv\n.\\.venv\\Scripts\\python.exe -m pip install -r sidecar\\requirements.txt\n\n# Run in dev mode\nnpm start\n```\n\nIn dev mode the app spawns the sidecar via the venv's Python — no need to compile it. To exit, right-click the tray icon → **Quit**.\n\n### Build a Windows installer\n\n```powershell\n# Bundle the Python sidecar into resources/claude_fetch.exe\n.\\build-sidecar.bat\n\n# Build the NSIS installer (output: dist/TokenWatcher Setup x.y.z.exe)\nnpm run build\n```\n\n### Regenerate icons\n\nIf you change the source `assets/icon-source.png`, regenerate the multi-resolution outputs:\n\n```powershell\n.\\.venv\\Scripts\\python.exe scripts\\gen-icons.py\n```\n\n### Cut a release\n\nPush a tag — the [GitHub Actions release workflow](.github/workflows/release.yml) builds the sidecar with PyInstaller, builds the NSIS installer, and uploads it to a draft GitHub Release automatically:\n\n```powershell\ngit tag v0.1.0\ngit push origin v0.1.0\n```\n\n## Project layout\n\n```\nTokenWatcher/\n├── src/\n│   ├── main.js              # Electron main: tray, panel, IPC\n│   ├── preload.js           # Context bridge\n│   └── renderer/            # Side-panel UI (HTML/CSS/JS)\n├── src-node/\n│   ├── codex.js             # Pure-Node Codex provider\n│   ├── claude.js            # Sidecar invoker\n│   └── settings.js          # Settings persistence\n├── sidecar/\n│   └── claude_fetch.py      # Self-contained: Edge CDP + DPAPI + curl_cffi\n├── assets/                  # Icons (PNG / ICO)\n├── scripts/\n│   └── gen-icons.py         # Regenerate icons from source PNG\n└── .github/workflows/\n    └── release.yml          # Tag push → installer release\n```\n\n## Related projects\n\n- [**steipete/CodexBar**](https://github.com/steipete/CodexBar) — the macOS original\n- [**openai/codex**](https://github.com/openai/codex) — the Codex CLI itself\n- [**anthropics/claude-code**](https://github.com/anthropics/claude-code) — Claude Code CLI\n\n## Keywords\n\nCodexBar for Windows · CodexBar Windows alternative · Codex usage tracker · Claude usage tracker · OpenAI rate limit monitor · ChatGPT rate limit · Claude rate limit · system tray usage monitor · Windows menu-bar app for Codex · Codex 5h window · Claude 5h window\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgehariharan%2Ftokenwatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgehariharan%2Ftokenwatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgehariharan%2Ftokenwatcher/lists"}