A menu bar app that tracks tokens and spend across Claude Code, Codex, and OpenCode — live, locally, for free. Flex your stats on X with one click.
No account, no cloud sync, no telemetry. Tokenbar reads directly from the local files that Claude Code and Codex write on your machine.
Just work as usual. Both tools store usage data locally on your Mac — Tokenbar reads it from there.
Every 15 seconds it reads ~/.claude/projects/**/*.jsonl and ~/.codex/state_5.sqlite. Zero network requests.
Click ◆ in the menu bar to open the popover — tokens, costs, charts, model breakdown. All updated in real time.
Today, last 7 days, and all-time totals at a glance. The menu bar updates every 15 seconds.
Per-model pricing for Anthropic, OpenAI, DeepSeek and more. Handles all 4 Claude token types including cache reads and writes.
Exclude models you don't want to count — free tiers, local models, test accounts. Excluded globally across all sources.
Eight color options for the popover window. Gray, black, blue, green, purple, red, cyan, amber.
Share your daily AI coding stats with one click. Opens an X.com intent tweet with today's tokens, all-time usage, top model, and cost.
Get a macOS notification every evening with your day's stats. Includes a Flex button to share directly from the notification. Configurable time in settings.
Start Tokenbar automatically when you log in. Enable it in settings and it's always there.
Create alerts for tokens or cost, daily or all-time. Step mode notifies you every time you cross the threshold (e.g. every 1M tokens).
All data is read from files already on your disk. Tokenbar makes zero network requests — no API, no account, no tracking.
Requirements: Python 3 and either Claude Code or Codex already installed.
git clone https://github.com/AZERDSQ131/tokenbar cd tokenmaxing
pip install pyobjc-framework-Cocoa pyobjc-framework-WebKit
# foreground python3 tokenbar.py # or background (logs → /tmp/tokenbar.log) ./start_tokenbar.sh
That's it. Tokenbar auto-creates ~/.tokenbar_start on first launch to track only usage from that point forward.
Show off your AI coding stats without leaving the menu bar. Opens an X.com intent tweet pre-filled with your daily numbers.
Today's tokens, all-time usage, top model, and cost — auto-filled in the tweet.
Detects which apps you used today — OpenCode, Claude Code, Codex — and lists them.
Click the Flex button in the popover and your browser opens the tweet ready to post.