Skip to content
Projects

About

macOS 原生 AI 额度监控与用量分析工具,实时监控 Codex、Claude Code、Cursor、Antigravity 剩余用量与本地 Token 消耗和费用。 Native macOS menu bar app to monitor quotas, reset countdowns, and track offline usage for Codex, Claude Code, Cursor, and Antigravity.

Developer Tools

How these counts are measured

Measured star growth

in 24h
+1
in 7 days
+4
in 15 days
+5
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

cc-bar Logo

cc-bar

macOS Native AI Quota Monitor & Usage Analytics
Monitor real-time quotas and reset countdowns for Codex, Claude Code, Cursor, and Antigravity in the menu bar; analyze tokens, costs, and conversations offline locally.

Latest Release Downloads Latest Downloads

Download · Screenshots · Service Matrix · Features · Security · Build · Issues · 简体中文

Popover Overview - Light Mode Popover Overview - Dark Mode
Menu bar, floating HUD, and Popover · Light / Dark mode


📸 Screenshots

Usage Overview Conversation Details
Usage Overview · Conversation Details

Project Analytics Quota Page
Project Analytics · Quota Page

Services & Accounts
Services & Accounts Settings


⚡ Service Support Matrix

cc-bar presents two types of data: Subscription Quotas queried from official APIs for remaining percentages and reset times; Local Usage parsed from local session logs or remote telemetry, never uploading code, project data, or conversation content.

Service / Tool Quota Monitoring Alert Notifications Local Usage / Cost Analytics Multi-Account Credential Source
Codex 5h / weekly quotas, reset countdowns Supported Local sessions (incl. .zst logs) Supported ~/.codex/auth.json (auto-renew)
Claude Code 5h / weekly / model-specific quotas Supported Local session logs — Keychain / local read-only
Antigravity Gemini 5h & weekly, Claude auxiliary Supported Local conversation DBs (App / IDE / CLI, read-only) — Official agy CLI (low-frequency) / read-only sign-in
Cursor Total / Auto / API (incl. Unlimited) Supported Remote metering (today / this cycle) — Local state.vscdb (read-only)
Command Code 5h / weekly quotas, GOAT monthly Credits Supported — — 5-level auto-detection / Keychain Key
OpenCode Go 5h / weekly / monthly quotas Supported — — OpenCode / Pi read-only detection / Keychain Key
Pi / OpenCode / DSH — — Local sessions (Pi / OpenCode / DSH multi-frame zstd) — Strictly read-only local logs & DB

✨ Features

⚡ Real-Time Quota & Status Monitoring

  • Menu Bar & Desktop Floating HUD — Primary, weekly, or dual-window menu bar display. The HUD snaps to screen edges, remembers position, and does not steal keyboard focus.
  • Low Quota Notifications — macOS system notifications when 5-hour, weekly, or billing cycle quotas drop below configured thresholds. Fires once per cycle; clicking opens usage analytics.
  • Low-Overhead Scheduling — Quota queries, log scanning, and service status tasks share a schedule; slows down on screen lock, pauses during sleep, refreshes on wake, and backs off on HTTP 429.
  • Seamless Multi-Account Support — Paste auth.json or PAT into Codex to monitor multiple accounts side-by-side with quota expiration and available reset credits, without affecting CLI sign-in.

📊 Local Offline Usage & Project Analytics

  • Multi-Dimensional Analytics — Four pages (Overview, Conversations, Projects, Quota) with day / week / month granularity and custom date ranges; large token counts can be shown in k / M / B or 万 / 亿 units:
    • Overview: Stacked charts for total tokens, costs, and period-over-period changes; breakdown by service, provider, model, or project; cache hit rates.
    • Conversations: Search past sessions, view input, output, cache read/write breakdowns, request counts, models, and Standard / Fast speed tier cost splits.
    • Projects: Project-level usage trends, top conversations, and branch distributions; recognized Git worktrees roll up into the main repository.
    • Quota Comparison & Projections: Compare current cycle local usage, projected usage, and official quota usage percentages; Cycle History shows projected and actual usage for the last 12 completed cycles; optionally include Codex subscription usage from Pi, OpenCode, and DSH.
  • Online Pricing Rule Updates — Pricing rules ship with the app; new model prices and price changes are delivered online and applied after signature verification, without an app update.
  • Automatic Recalculation on Rule Changes — History is automatically re-priced when pricing or accounting rules change; usage from cleaned-up source logs is preserved.

💻 Native Experience & Privacy Controls

  • Single-Page Management & Drag Reordering — Toggle all services on one page in Settings → Services & Accounts; turning a service off also stops its local usage collection. Drag rows to customize global order across the menu bar, popover, HUD, and statistics.
  • Screenshot Privacy Mode — One-click redaction of account emails, paths, branches, and session IDs while preserving real amounts, tokens, and charts for safe sharing. To share just the popover, you can also turn off "Show email in popover" on its own.
  • Seamless In-App Updates — Built-in Sparkle updater to view release notes, download, install, and automatically restart.
  • Local Diagnostics & Zero Telemetry — Automatic log rotation with redacted sensitive fields; export diagnostic bundles locally with zero user behavior telemetry.

📦 Installation

System Requirement: macOS 14 (Sonoma) or later.
Prerequisites: Relevant AI coding tools must be logged in at least once via their respective CLIs or desktop apps.

  1. Download the latest CCBar.dmg (or CCBar.app.zip) from the Releases page.
  2. Open the DMG image and drag CCBar.app into your /Applications directory.

Upgrading to a version with the in-app updater for the first time requires manual installation as described above. Subsequent updates can be viewed under Settings → General → Check for Updates, and installed automatically with restart by clicking "Download and Install".

[!NOTE] First-Launch Gatekeeper Notice

Published builds are ad-hoc signed (without paid Apple notarization). If blocked by macOS Gatekeeper on first launch:

  1. Open System Settings → Privacy & Security, scroll down to find the CCBar notification, and click "Open Anyway";
  2. If macOS reports that the app "is damaged", remove the quarantine attribute manually via Terminal:
    xattr -dr com.apple.quarantine /Applications/CCBar.app
    
  3. If no plain-text credentials file exists, the app will request Keychain read permission with an explanation dialog — please select "Always Allow".

🔒 Data and Privacy Security

Usage logs are parsed and stored locally. Quotas, Cursor remote metering, service status, pricing catalogs, and pricing rules are fetched through their respective network APIs. The app does not upload local session logs or project data.

Credential Reading & Refresh Policy

Service / Tool Credential Path Access Mode Behavior & Security Guarantees
Codex ~/.codex/auth.json
Imported accounts: CCBar's own Keychain items
Read / Write Automatically renews tokens via refresh_token near expiry and writes new tokens back to where they came from. Re-reads the file before renewing to prevent race conditions with the codex CLI.
Claude Code ~/.claude/.credentials.json
or macOS Keychain
Strictly Read-Only Never refreshes or writes credentials. Anthropic refresh tokens are single-use; third-party rotation invalidates CLI sessions. Preserves the last snapshot and prompts you to renew your sign-in when it expires. Claude requests require a proxy configured in Settings → Data & Refresh.
Antigravity System Keychain gemini / antigravity (preferred)
Legacy jetski / CLI token / oauth_creds files
Strictly Read-Only Never extracts secrets, refreshes OAuth tokens, or calls Google directly. Queries quotas via official agy -p "/usage" --output-format json at low frequency; without agy, only local conversation usage is tracked.
Cursor ~/Library/Application Support/Cursor
/User/globalStorage/state.vscdb
Strictly Read-Only Reads only cursorAuth/accessToken to construct session cookies for usage queries. Never touches refresh tokens/OAuth and never writes back to SQLite or Keychain.
Command Code 5-level local sources or macOS Keychain Read / Keychain Read-only auto-detection in order: ~/.commandcode/auth.json → ~/.pi/agent/auth.json → ~/.local/share/opencode/auth.json → environment variables → Keychain. Settings can also switch to a manual API key stored in the macOS Keychain.
OpenCode Go OpenCode / Pi auth.json or macOS Keychain Read / Keychain Read-only auto-detection in order: OpenCode auth.json → ~/.pi/agent/auth.json → OPENCODE_API_KEY → Keychain, using the opencode-go API key. Settings can also switch to a manual API key stored in the macOS Keychain.
Local Session Logs ~/.codex/sessions, ~/.claude/projects
~/.pi/agent/sessions, OpenCode SQLite
~/.dsh/sessions
Strictly Read-Only Parses usage, model, and project metadata, and reads title indexes or extracts conversation titles from logs. Missing titles may use a user-message excerpt. No conversation content is uploaded and source logs are never modified.

System Permissions & Zero Telemetry Commitment

  • No Protected Directory Access: For Desktop, Documents, Downloads, Music, Pictures, Movies, and paths outside the home directory, project grouping uses pure text path tokenization without filesystem APIs, never triggering macOS permission prompts.
  • Zero External Telemetry: No user tracking or behavioral telemetry is collected or reported; Sparkle only checks and downloads signed releases.
  • Screenshot Privacy & Local Data: Privacy Mode only obfuscates identities in the UI; real titles, paths, and statistics stay local on your machine.
  • Diagnostics Stay Local: Logs are written to ~/Library/Logs/CCBar/ (~8 MB cap, auto-rotating) and redacted by default — no auth tokens, plaintext emails, conversation contents, file contents, or project names. Accounts appear only as one-way hashes.

[!TIP] If you have concerns about pre-compiled binaries, you are welcome to inspect the source code and build from source.

[!NOTE] Reporting Issues: Open Settings → General → Diagnostics → Export Diagnostic Logs. After confirmation, a zip bundle will be revealed in Finder; attach it to an Issue. summary.txt inside the bundle is plaintext for easy review before sending.


🔧 Build from Source

Requires full Xcode installation (Command Line Tools alone cannot compile SwiftUI asset catalogs).

Local Debugging

Open ccbar.xcodeproj in Xcode, select the ccbar scheme, choose "My Mac" as the target destination, and press ⌘ + R to run.

Building a Release Package

# 1. Ensure command line tools point to full Xcode (one-time)
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

# 2. Run the local packaging script (outputs to dist/)
SPARKLE_PUBLIC_ED_KEY="your_public_ed_key" ./scripts/build.sh

Before building, set up SPARKLE_PUBLIC_ED_KEY according to Release Guide. The build script compiles with CODE_SIGNING_ALLOWED=NO and applies multi-layer ad-hoc code signatures, producing dist/CCBar.dmg and dist/CCBar.app.zip.

[!WARNING] Do not use Product → Archive in Xcode to distribute builds; doing so binds your personal developer certificate and prevents the app from running on other machines.


🔗 Related Projects

Tools by the same author sharing the same quota calculation logic and design language:

Project Platform Tech Stack
cc-bar (This Repo) macOS Native Menu Bar Tool Swift / SwiftUI
CC Trace Desktop Client (macOS Menu Bar / Windows Tray) Tauri / Web
CC Trace Mobile Mobile Companion (iOS / Android) Mobile Framework

🙏 Acknowledgments

Architectural concepts and quota parsing strategies reference and build upon these great open-source projects:

  • cc-switch — Multi-provider account switcher; inspired the multi-account management flow.
  • cockpit-tools — Multi-platform AI assistant dashboard; referenced for quota polling and refresh strategies.
  • CodexBar — macOS menu bar AI usage monitor; referenced for local log parsing and menu bar interactions.

Thanks to the LINUX DO community for the discussions and feedback.


📄 License

This project is licensed under the MIT License.

Explore related projects

Loading…