Everything K-culture — comebacks to K-beauty, straight to your inboxGet it in your inbox

METAL MEDIA

murongg/TokPeek

8SwiftMIT

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

  1. Session file discovery, parsing, pricing, and aggregation all run locally, so session contents are never uploaded to a server
  2. 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
  3. Users can set daily, weekly, or monthly budgets and get local alerts when usage hits 80% or 100%
  4. 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
  5. 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 GitHub

Trending repos

All repos →

Latest from METAL MEDIA