English | ็ฎไฝไธญๆ
Tokei and CodexBar show you a bill. CodingBar shows you a dashboard: what you and the AI got done, whether it was worth it, and how to spend smarter next time. Tokens and cost are the foundation; insight is the point.
Everything is read from your local Claude Code and Codex logs โ incremental, zero external dependencies, no Xcode. The only automatic network call is live quota โ a read-only request with your own token (plus an optional, user-triggered update check).
![]() |
![]() |
![]() |
![]() |
Feature cards are illustrative โ numbers are sample data.
- Outcome over spend: pairs git output (+/โ lines ยท commits ยท files) against today's cost, with
$/lineand$/commit. Cost you can finally read as work done. - Live coach: a context fuel gauge for the current session (with 1M-context detection), a quota burn-down forecast, and savings tips like "8 simple tasks ran on Opus โ Haiku would've saved $0.9".
- Behavior mirror: your tool-use mix (write / read / run / search), collaboration rhythm, and a golden-hours heatmap โ all derived from the
tool_useevents in your logs. - A living menu bar: a monochrome pulse that beats with real-time throughput, plus two rows of strict tabular figures โ today's tokens / spend and remaining quota, always visible.
- Local-first & private: usage, cost, behavior and git stay 100% offline. The only automatic network call is quota โ a read-only GET of your usage, nothing uploaded, no password prompts (an optional, user-tapped update check is the sole exception).
- Native & zero-dependency: pure SwiftPM, no Xcode project, no third-party packages. Reads
~/.claude/projectsand~/.codex/sessionsdirectly.
Grab the latest .dmg (or .zip) from Releases, open it, and drag CodingBar to Applications.
The app is ad-hoc signed (no paid Apple Developer ID), so Gatekeeper warns on first launch. Right-click โ Open, or clear the quarantine flag:
xattr -dr com.apple.quarantine /Applications/CodingBar.appThe pulse icon appears on the right of your menu bar.
macOS 14+ and a Swift 6 toolchain (Command Line Tools is enough โ no Xcode project).
make run # debug run (pulse icon appears in the menu bar)
make dump # print the computed Snapshot as JSON (verify the data layer, no GUI)
make test # runnable self-test
make package # produce dist/CodingBar.appClick the menu-bar item to open a three-tab panel:
- Overview (ๆป่ง) โ outcome next to cost (git output โ today's spend),
$/line&$/commit, the live coach (context fuel + savings tips), quota bars with burn-down forecasts, and a 7-day trend. - Composition (ๆๆ) โ where the money went: spend broken down by model and by project.
- Insights (ๆดๅฏ) โ code output, tool-use mix, golden-hours heatmap, savings tips, and a quota-depletion forecast.
How the numbers are computed. Spend is an estimate at pay-as-you-go API prices (
Pricing.swift), not your subscription bill โ on a Max / ChatGPT plan, read it as "equivalent API value," not money actually charged. Code output is approximate git attribution: all non-merge commits in a session's working directory within the time window โ it can't tell hand-written from AI commits and excludes uncommitted work. Codex token totals are de-duplicated from each session's cumulative counter (total_token_usage), so they no longer double-count replayed events.
- Usage / cost / behavior / git โ 100% local and offline. Reads only
~/.claude/projects/**/*.jsonland~/.codex/sessions/**/*.jsonl. Prices are compiled-in defaults (seeSources/CodingBarCore/Pricing.swift). - Quota โ the only automatic networked path. A read-only GET with your own OAuth token to each provider's usage endpoint (Claude
api.anthropic.com/api/oauth/usage, Codexchatgpt.com/backend-api/wham/usage). It never uploads local content and never reads billing detail. 5-minute TTL cache. - Update check โ the only other network access: a user-initiated read-only GET to the public GitHub Releases API, fired only when you tap "Check for updates" in Settings. No auth, no telemetry, nothing uploaded.
- No password prompts โ Claude's OAuth token lives in the Keychain. A self-signed app reading it directly makes macOS re-prompt endlessly, so CodingBar spawns the Apple-signed
/usr/bin/security(inside that entry's trusted ACL) to read it silently, and degrades to "quota unavailable" if it can't. Never a password dialog. Codex uses~/.codex/auth.json.
Pure SwiftPM, two targets, data layer fully decoupled from UI:
CodingBarCoreโ the headless, testable data layer:Scanner(incremental cache),ClaudeScanner/CodexScanner,Pricing,Aggregator, the four pillars (Behavior/Fuel/Forecast/Coach) plusGitCorrelator, andQuota/(Credentials, the Claude/Codex fetchers, andQuotaServicewith a 5-min TTL cache). It produces one immutableSnapshot.CodingBarโ the AppKitNSStatusItem+ SwiftUI app:UsageStore(@MainActor ObservableObject),RefreshLoop,StatusItemController,MenuBarItemView, and the three-tab panel.
Because the layers are decoupled, swift run CodingBar --dump-json verifies data against real logs with no GUI, and --render-menubar / --render-panel rasterize the UI to PNG offscreen. See CLAUDE.md for the full map.
Apache License 2.0. If you fork CodingBar into your own product, a different name and a credit back would be appreciated. Reference projects (KeyStats / Tokei / CodexBar) are kept locally for research only and are not distributed with this repository.







