macOS only

Know exactly how much
your AI usage costs.

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.

Get started free View on GitHub

Works with what
you already have.

No account, no cloud sync, no telemetry. Tokenbar reads directly from the local files that Claude Code and Codex write on your machine.

1

Use Claude Code or Codex normally

Just work as usual. Both tools store usage data locally on your Mac — Tokenbar reads it from there.

2

Tokenbar scans local files

Every 15 seconds it reads ~/.claude/projects/**/*.jsonl and ~/.codex/state_5.sqlite. Zero network requests.

3

See your usage live in the menu bar

Click in the menu bar to open the popover — tokens, costs, charts, model breakdown. All updated in real time.

Everything you need,
nothing you don't.

📊

Live token counter

Today, last 7 days, and all-time totals at a glance. The menu bar updates every 15 seconds.

💸

Exact cost calculation

Per-model pricing for Anthropic, OpenAI, DeepSeek and more. Handles all 4 Claude token types including cache reads and writes.

🚫

Model exclusions

Exclude models you don't want to count — free tiers, local models, test accounts. Excluded globally across all sources.

🎨

Themeable background

Eight color options for the popover window. Gray, black, blue, green, purple, red, cyan, amber.

📣

Flex on X / Twitter

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.

🔔

Daily notification

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.

🚀

Launch at login

Start Tokenbar automatically when you log in. Enable it in settings and it's always there.

💰

Custom alerts

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).

Reads local files.
Nothing leaves your Mac.

All data is read from files already on your disk. Tokenbar makes zero network requests — no API, no account, no tracking.

Claude Code
~/.claude/projects/**/*.jsonl
Scans JSONL conversation logs. Extracts input, output, cache write, and cache read tokens per message with exact per-model costs.
Exact cost
Codex
~/.codex/state_5.sqlite
Reads token totals from the threads table. Cost is estimated using blended model rates since Codex doesn't store per-token breakdown.
Estimated cost
OpenCode
~/.local/share/opencode/
opencode.db
Reads from the local SQLite session table. Uses the cost column when available, falls back to model-based estimation.
SQLite

Up and running
in two minutes.

Requirements: Python 3 and either Claude Code or Codex already installed.

1

Clone the repo

git clone https://github.com/AZERDSQ131/tokenbar
cd tokenmaxing
2

Install Python dependencies

pip install pyobjc-framework-Cocoa pyobjc-framework-WebKit
3

Launch

# foreground
python3 tokenbar.py

# or background (logs → /tmp/tokenbar.log)
./start_tokenbar.sh
4

Click ◆ in your menu bar

That's it. Tokenbar auto-creates ~/.tokenbar_start on first launch to track only usage from that point forward.

Flex on X / Twitter
in one click.

Show off your AI coding stats without leaving the menu bar. Opens an X.com intent tweet pre-filled with your daily numbers.

📊

Daily snapshot

Today's tokens, all-time usage, top model, and cost — auto-filled in the tweet.

🔌

All sources supported

Detects which apps you used today — OpenCode, Claude Code, Codex — and lists them.

Zero setup

Click the Flex button in the popover and your browser opens the tweet ready to post.