murongg/TokPeek
A Mac menu bar app that shows how many AI tokens your coding tools are burning through
TokPeek reads locally stored AI session logs and displays token usage and estimated cost right in the macOS menu bar. All computation happens on the user's Mac rather than being sent to a server, and usage can be viewed by today, 7, 30, 90 days, or all-time, broken down by model and client. The Swift app calls into a Rust library called tokscale-core to do the actual parsing and aggregation.
What it does
- Session file discovery, parsing, pricing, and aggregation all run locally, so session contents are never uploaded to a server
- The SwiftUI menu bar app talks to a Rust library (tokpeek-core-ffi) over JSON, so the Swift side does not parse files or recompute totals itself
- Users can set daily, weekly, or monthly budgets and get local alerts when usage hits 80% or 100%
- Released builds require macOS 14 or later, ship as a Universal 2 binary for both Apple Silicon and Intel, and are signed and notarized by Apple
- Updates are checked through Sparkle using signed feeds, and the app always asks for confirmation before installing
Why it matters
For developers juggling multiple AI coding tools who lose track of token spend, this gives a private, at-a-glance way to monitor usage and cost without sending data off-device. Being open source also lets anyone inspect how the pricing and session-parsing logic actually works.
Terms in this repo
- MenuBarExtra · a SwiftUI feature for building an icon/menu that lives in the macOS menu bar
- C ABI · a shared calling convention that lets different languages like Swift and Rust call each other's functions
- tokscale-core · a Rust library that reads AI session logs and computes token usage and cost
- Sparkle · a framework for handling signed, secure automatic updates in macOS apps
- Universal 2 · a build format that packages both Apple Silicon and Intel code into a single app
Repository description (English)
Native, local-first macOS menu bar app for tracking AI token usage, estimated costs, daily trends, clients, and models. Powered by tokscale-core.
Open on GitHubTrending repos
- vorssaint/vorssaint-utilsOne free menu bar app replaces a dozen paid Mac utilities
- Alishahryar1/free-claude-codeA local proxy that lets coding AI agents run on 49 free or cheap model providers instead of one paid service
- freestylefly/awesome-gpt-image-2A library of 532 reverse-engineered prompts that turn GPT-Image2 into a predictable image-making tool
- block/buzzAn open-source workspace where humans and AI agents chat, code, and review in the same rooms
- NousResearch/hermes-agentNous Research's Hermes is an AI agent that gets smarter the more you use it
- virgiliojr94/book-to-skillA tool that turns technical book PDFs into on-demand reference skills for AI coding agents
- VoltAgent/awesome-agent-skillsA single hub collecting over 1000 'how-to' manuals that make AI coding assistants act like experts
- anthropics/claude-plugins-communityA shared shelf where anyone's Claude add-ons get listed for install