GitHub - shrivara/token-bar: Menu bar readout of today's AI usage: spend, tokens, cache hit rate (Claude Code, OpenCode, pi) · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
shrivara
token-bar
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>76 Commits<br>76 Commits
.github/workflows
.github/workflows
Scripts
Scripts
Sources
Sources
Tests/TokenBarCoreTests
Tests/TokenBarCoreTests
docs
docs
.gitignore
.gitignore
LICENSE
LICENSE
Package.swift
Package.swift
README.md
README.md
RELEASING.md
RELEASING.md
build.sh
build.sh
View all files
Repository files navigation
token-bar
A minimal macOS menu bar app showing today's AI usage: spend, tokens in/out, and cache hit rate.
The numbers roll odometer-style whenever new usage lands. Left-click the menu bar item for a panel with the period's totals, a spend graph, and a per-tool, per-model breakdown; the D / W / M / Y buttons switch between day, week, month, and year. The camera button copies a clean Retina PNG to the clipboard as both an image and a pasteable file. Right-click (or Control-click) for view options — toggle the spend graph, provider icons, and full vs. short model names — and to quit.
Supported tools
Tool<br>Source<br>Cost
Claude Code<br>~/.claude/projects/**/*.jsonl<br>Computed from bundled models.dev rates
Codex<br>~/.codex/sessions/**/*.jsonl<br>Computed from bundled models.dev rates
OpenCode<br>~/.local/share/opencode/opencode.db<br>Computed from bundled models.dev rates
pi<br>~/.pi/agent/sessions/**/*.jsonl<br>Computed from bundled models.dev rates
Updates are instant: file-system events fire the moment a session writes new usage (coalesced to at most about one refresh per second while streaming), with a 60s timer as backstop and for the midnight rollover. Tools with no activity today are hidden from the panel.
Install
Homebrew
brew install shrivara/tap/token-bar<br>brew services start token-bar # start now + at login
From source
Requires macOS 14+ and the Xcode Command Line Tools.
git clone https://github.com/shrivara/token-bar<br>cd token-bar<br>./build.sh<br>open TokenBar.app
Add TokenBar.app to System Settings → Login Items to start it at login.
Check the numbers without the app
token-bar --print # or ./TokenBar.app/Contents/MacOS/TokenBar --print
Prints today's per-model breakdown and totals to stdout, then exits.
Notes
Spend is API-equivalent pricing. If you're on a subscription plan (e.g. Claude Max), the dollar figure shows what the usage would cost via the API, not what you're billed.
API-equivalent pricing comes from an offline snapshot of models.dev, bundled with the app under its MIT license. Prices are looked up by provider and model for every message, including cache and reasoning tokens. Qualified provider variants fall back to their base provider: for example, openai-codex falls back to the matching openai model price. Because this is an approximation, it remains marked ~. A model that isn't in the catalog (or lacks a complete price) contributes $0 and is marked ~ in the panel — the tool's own recorded cost is not trusted, and there is no rate guessing.
Everything is read locally at runtime. No network access, no telemetry.
Updating prices
The Daily pricing release GitHub Actions workflow checks models.dev once a day. If the normalized catalog changed, it bumps the patch version, runs the tests, builds the app, and commits and tags the new version. It then triggers the Homebrew tap to update its formula and build bottles; the tap's own daily check is a fallback. If nothing changed, no release is created.
To update manually, run ./Scripts/update-model-pricing.sh to regenerate the checked-in snapshot and ./Scripts/bump-patch-version.sh to bump the app version. Normal builds do not fetch the network.
License
MIT
About<br>Menu bar readout of today's AI usage: spend, tokens, cache hit rate (Claude Code, OpenCode, pi)<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>2 stars<br>Watchers<br>0 watching<br>Forks<br>1 fork<br>Report...