Project identity. Cortex is Benjamin Belaga's open-source macOS quota monitor, built on an upstream open-source codebase (MIT — see
NOTICE.mdfor attribution and the reconciliation reference). The application bundle ships as Cortex.app on disk and the menu-bar item shows the Cortex label, while the underlying codebase keeps the upstream internal target name (Cortex) and class names for mergeability withupstream/main. The bundle ID isfr.yoyaku.cortex(migrated from upstream's in E4, with non-destructive Keychain/UserDefaults migration). The source never ships provider credentials; local accounts remain in macOS Keychain.Coming from the upstream app. E4 renamed the bundle id from
com.tddworks.claudebartofr.yoyaku.cortex. On first launch Cortex copies the Keychain items and UserDefaults keys it needs into the new namespace and leaves the old ones untouched (an explicit new value always wins). macOS treats the renamed bundle as a different app, so permission prompts (Accessibility, Automation, Notifications, Login Items) come back once, and Sparkle cannot auto-update across bundle ids — the first Cortex build after the rename needs a manual install.
A macOS menu bar application that monitors AI coding assistant usage quotas in real time. Keep track of your Claude, OpenAI Codex, Google Gemini, GitHub Copilot, Google Antigravity, Cursor, AWS Bedrock, AWS Kiro, Kimi, DeepSeek, Mistral, MiniMax, Alibaba Coding Plan, Z.ai, Amp Code, OpenCode Go, Oh My Pi, Grok Build, Command Code, and Vercel at a glance.
Featuring full MacBook Touch Bar integration with persistent, centered multi-provider quota gauges, MacBook Notch Live Activity, Multi-Account Switching, and Raycast-style User Extensions.
Screenshots — the application UI and icon are Cortex-branded. Release screenshots are generated from the same build and contain no local account data.
Cortex supports seamless Multi-Account Switching for providers that support multiple logins (e.g. personal, work, client accounts). Configure multiple accounts in Settings > Providers, and switch between them from the account catalogue or provider row menu.
Each provider displays separate progress bars for multiple quota windows—for example, tracking your 5-hour session quota and 7-day weekly quota simultaneously with dedicated countdown timers.
Every quota is tracked in real time and color-coded based on remaining capacity:
| Remaining | Status | Color | Description |
|---|---|---|---|
| > 50% | Healthy | Blue / Green | Ample quota available |
| 20-50% | Warning | Yellow / Amber | Approaching usage threshold or accelerated burn rate |
| < 20% | Critical | Red | Low quota remaining; alerts triggered |
| 0% | Depleted | Gray | Quota exhausted |
- Multi-Provider Support - Monitor Claude, Codex, Gemini, GitHub Copilot, Antigravity, Z.ai, Kimi, Kiro, Amp, OpenCode Go, Oh My Pi, Grok, and Command Code quotas in one place
- Provider Enable/Disable - Toggle individual providers on/off from Settings to customize your monitoring
- Real-Time Quota Tracking - View Session, Weekly, and Model-specific usage percentages
- Multiple Themes - Light, Dark, CLI, Christmas, and imported terminal themes (.itermcolors)
- Automatic Adaptation - System theme follows your macOS appearance; Christmas auto-enables during the holiday season
- Visual Status Indicators - Color-coded progress bars (green/yellow/red) show quota health
- System Notifications - Get alerted when quota status changes to warning or critical
- Touch Bar Integration - Persistent MacBook Touch Bar widget with real-time multi-provider gauges, progress bars, and an interactive pixel mascot (learn more)
- Notify! iPhone Publishing - Push quota state to your iPhone via Notify! on three surfaces: a Lock Screen Live Activity showing up to six quota windows, a Home Screen widget carrying that same content but staying put, and a Lock Screen widget gauge for one chosen quota (off by default, see below)
- Auto-Refresh - Automatically updates quotas at configurable intervals
- Keyboard Shortcuts - Quick access with
⌘D(Dashboard) and⌘R(Refresh)
Tip
You can also enable Burn Rate Warnings in Settings > General to trigger alerts based on your real-time consumption velocity against remaining time rather than fixed percentage cutoffs.
Cortex features native, system-wide Touch Bar integration for MacBook Pro models equipped with an Apple Touch Bar (including M1/M2 and Intel). This runs 100% natively inside Cortex—requiring zero third-party apps (no BetterTouchTool or MTMR required) and no special accessibility permissions.
- Always Visible System-Wide (
placement: 0): Uses macOS system-modal function bar presentation. The widget remains persistently visible across all full-screen windows and apps, automatically re-asserting on app switching and system unlock while keeping your system Escape key and Control Strip media/volume controls intact. - Centered, Clean Multi-Provider Quota Gauges:
- Balanced, centered layout across the Touch Bar for single or multi-provider views.
- Displays authentic provider logos (Claude, Gemini, Antigravity, GitHub Copilot, Codex, etc.).
- Multi-segment provider views matching your menu bar configuration (e.g.
[Logo] Gemini 40% | [Logo] Claude 0%). - High-precision bold monospaced percentage readout with warning indicator (
!) when quota is critical (≥ 90%). - Sleek rounded progress bars with 100% track reference and adaptive color coding (healthy blue, warning amber, critical red).
- Reset countdown timer (e.g.,
2:15,35m,3d).
- Battery-Friendly & Ultra Lightweight: Redraws only when quota state updates; consumes 0% idle CPU and zero background animation overhead.
- One-Tap Access: Tap anywhere on the quota gauges on the Touch Bar to instantly summon the full Cortex dropdown popover (
cortex://open).
Tip
For detailed architecture, Touch Bar configuration, and customization details, see the Full Touch Bar Guide.
Cortex can render Claude Code's session and quota state directly in your MacBook notch (Settings > General > Notch Live Activity):
- Idle Mode: Displays your selected provider's most depleted quota at a glance.
- Active Session Mode: Displays repository name, elapsed time, and the number of active subagents fanned out.
- Permission Alert: Prominently highlights when Claude Code is waiting for permission in terminal.
- Hover Popover: Hovering expands the notch into a full status view with active session list, quota cards, and quick action buttons.
- Virtual Notch: Displays without a physical notch (or external monitors) automatically receive an elegant virtual notch sized to the menu bar.
Note
Read the complete documentation at docs/features/notch-live-activity.md.
- macOS 15+
- Swift 6.2+
- Providers and CLI tools you wish to monitor:
- Claude - CLI mode (
claude) or direct OAuth API mode - Codex - CLI RPC mode (
codex) or ChatGPT backend API mode - Gemini -
geminiCLI - GitHub Copilot - Billing API or Internal Copilot API mode
- Antigravity - Auto-detected when running locally
- Cursor - Auto-detected via local SQLite DB and usage API
- AWS Bedrock - AWS SSO profile or IAM credentials
- AWS Kiro -
kiro-cliviauv tool install kiro-cli - Kimi -
kimiCLI mode (recommended) or API cookie mode - DeepSeek - API key configured in Settings
- Mistral - Backed by Vibe session logs
- MiniMax - Coding Plan API key (International / China)
- Alibaba Coding Plan - Model Studio API key or browser cookie
- Z.ai - Configure Claude Code with GLM Coding Plan endpoint
- Amp Code - Auto-detected when
ampCLI is installed - OpenCode Go - Local SQLite DB or Zen API key
- Oh My Pi - Aggregates account usage via
omp usage --json - Grok Build - Tracks xAI credits using CLI OAuth credentials
- Command Code - Tracks 5-hour, weekly, and monthly credit windows from the same API the
cmdCLI uses - Vercel - Token-based quota tracking
- Custom Extensions - Drop custom scripts into
~/.claudebar/extensions/
- Claude - CLI mode (
Kimi Setup
Kimi supports two probe modes, configurable in Settings > Kimi Configuration:
- CLI Mode (Recommended): Launches interactive
kimiand executes/usage. Requiresuv tool install kimi-cliorpip install kimi-cli. No Full Disk Access required. - API Mode: Calls Kimi Connect-RPC directly using browser cookie auth. Requires Full Disk Access for Cortex in System Settings > Privacy & Security > Full Disk Access (or set
KIMI_AUTH_TOKEN).
AWS Kiro Setup
Kiro monitors AWS Kiro (formerly CodeWhisperer) usage via kiro-cli.
- Install:
uv tool install kiro-cliorpip install kiro-cli - Authenticate: Run
kiro-cliand complete the login prompt (or use Kiro IDE).
AWS Bedrock Setup
Monitors daily spend, token counts, and per-model breakdowns via CloudWatch.
- Configure AWS SSO profile or environment variables in Settings > Bedrock.
- Select target inference regions (e.g.
us-east-1,us-west-2).
Alibaba Coding Plan Setup
Monitors 5-hour session, weekly, and monthly quotas on Alibaba Model Studio / Bailian.
- Choose region: International (
modelstudio.console.alibabacloud.com) or China Mainland (bailian.console.aliyun.com). - Authenticate via API key or browser cookie extraction.
Cursor Setup
Automatically detects your active Cursor IDE installation and reads authentication tokens from Cursor's local SQLite database. Displays included requests and on-demand spend.
Cortex supports the cortex:// URL scheme for quick actions from Raycast, Alfred, Touch Bar widgets, or terminal. The legacy claudebar:// scheme remains registered for migrated installations:
| URL Scheme | Action | CLI Example |
|---|---|---|
cortex://open |
Toggles the Cortex dropdown popover | open cortex://open |
cortex://refresh |
Triggers immediate quota refresh for all providers | open cortex://refresh |
cortex://settings |
Opens the Cortex Settings window | open cortex://settings |
Publishing quota state to your iPhone is optional and off by default. It is configured in Settings > Notify!.
- Get Notify!. It runs on Mac, on iOS, and on any device through web push.
- For the Live Activity, open Notify! once on the iPhone or iPad you are publishing to. One cannot be started until that device has registered a push-to-start credential, and only opening the app produces one. Skip this step if you only want the widgets, which are polled rather than pushed, and skip it for a Mac or browser ID, which cannot show a Live Activity at all.
- In Notify!, copy your device ID and device token.
- Put them in the Device ID and Token fields in Cortex's Notify! settings pane and press Save Link. Pasting a whole notification URL into the Device ID field works too, Cortex splits it across both. Verify Device confirms the pair against Notify! and names the phone it belongs to. Then turn Publish to Notify! on.
The Live Activity needs an iPhone or iPad ID. Notify! also issues IDs for Macs and browsers, and those keep both widgets perfectly well, but Notify! cannot start a Live Activity on one, so Cortex disables just that switch and says why. A group ID receives notifications but owns no Lock Screen or Home Screen of its own, so it gets none of the three.
All three surfaces can be turned off separately, and you can choose which quota the gauge shows. The Home Screen widget shows the same thing as the Live Activity, and the difference is that it stays: a Live Activity appears while something is happening and then goes away, while the Home Screen widget sits where you put it and always shows the latest state. It needs a recent Notify! app, where you turn it on under Settings > Home Screen Widgets, and you place it yourself through iOS's own widget picker. Notify! can also switch the surface off at its own end while it is still rolling out; Cortex treats that as "not yet", pauses just that widget, and carries on publishing the other two.
Note that this sends provider names, quota window labels and remaining percentages to a third-party service. The device token is stored in the Keychain, not in ~/.claudebar/settings.json. A build you compile yourself is ad-hoc signed and the Keychain refuses it, so on those the token falls back to Cortex's app credentials and the pane says so.
Full details: docs/features/notify.md.
git clone https://github.com/benjaminbelaga/Cortex.git
cd cortex
# Install Tuist (if not installed)
brew install tuist
# Install dependencies and build
tuist install
tuist build Cortex -C ReleaseNote
No Homebrew cask and no signed release exist yet — see docs/release/RELEASE_SETUP.md for the release checklist. A self-compiled build is ad-hoc signed.
After building, open the generated Xcode workspace and run the app:
tuist generate
open Cortex.xcworkspaceThen press Cmd+R in Xcode to run. The app will appear in your menu bar. Click to view quota details for each provider.
Cortex is developed on a machine with llm-router serving shared quota
snapshots. Two behaviors reflect that origin and stay inert elsewhere:
- Curated defaults: niche native providers and pay-as-you-go connectors
are hidden until explicitly enabled from the
+catalogue. Nothing is ever deleted — re-enabling is one click. - Legacy alias binding (
default/webmaster/tech→ router aliases): runs only when the precise pre-migration signature is detected (integration.legacyAliasBinding, default off for fresh installs).
A fresh install without llm-router gets native Claude/Codex rows via the
autonomous probes (see RouterSourceModeMigration for the exact
fresh-install defaults).
The project uses Tuist for dependency management and Xcode project generation.
# Install Tuist (if not installed)
brew install tuist
# Install dependencies
tuist install
# Generate Xcode project and open
tuist generate
open Cortex.xcworkspace# Build the project
tuist build
# Run all tests
tuist test
# Run tests with coverage
tuist test --result-bundle-path TestResults.xcresult -- -enableCodeCoverage YES
# Build release configuration
tuist build Cortex -C ReleaseCortex is a public repository: a credential that reaches main is leaked the
moment it lands. Every path to main therefore runs the same
gitleaks scan (scripts/secret-scan.sh,
rules in .gitleaks.toml): the publish script, the CI secret-scan job, and a
pre-push hook you install once per clone:
brew install gitleaks
scripts/install-git-hooks.sh # installs .git/hooks/pre-push
scripts/secret-scan.sh # scan origin/main..HEAD by hand
scripts/secret-scan.sh --worktree # scan uncommitted changesA finding aborts the push (output is redacted). Rotate the credential first,
then rewrite the commit — a rotated key is the only acceptable fix, never an
allowlist entry. Only literal test fixtures belong in .gitleaks.toml.
After opening in Xcode, SwiftUI previews will work with Cmd+Option+Return. The project is configured with ENABLE_DEBUG_DYLIB for preview support.
Full documentation: docs/architecture/ARCHITECTURE.md
Cortex uses a layered architecture with QuotaMonitor as the single source of truth:
| Layer | Purpose |
|---|---|
| App | SwiftUI views consuming domain directly (no ViewModel) |
| Domain | Rich models, QuotaMonitor, repository protocols |
| Infrastructure | Probes, storage implementations, adapters, drivers |
- Single Source of Truth -
QuotaMonitorowns all provider state - Repository Pattern - Settings and credentials abstracted behind injectable protocols (
JSONSettingsRepository) - Protocol-Based DI -
@Mockableprotocols enable testability - Chicago School TDD - Tests verify state changes, not method calls
- No ViewModel/AppState - Views consume domain directly
Match Cortex's appearance to your terminal. Import any .itermcolors file:
- Open Settings (gear icon)
- Click Import .itermcolors
- Select your file (export from iTerm2: Preferences > Profiles > Colors > Color Presets > Export)
450+ pre-made schemes available at iTerm2-Color-Schemes.
Imported themes are saved in ~/.claudebar/themes/ and persist across restarts.
Create your own provider monitoring modules by dropping a manifest and script into ~/.claudebar/extensions/. Extensions can define quota grids, daily usage cards, and automated HTTP health checks.
See docs/features/extensions.md for full specification and example implementations.
Use the add-provider skill to guide you through adding new providers with TDD:
Tell Claude Code: "I want to add a new provider for [ProviderName]"
The skill guides you through: Parsing Tests → Probe Tests → Implementation → Registration.
See .claude/skills/add-provider/SKILL.md for details and AntigravityUsageProbe as a reference implementation.
- Sparkle - Auto-update framework
- Mockable - Protocol mocking for tests
- Tuist - Xcode project generation (for SwiftUI previews)
Releases are automated on the zero-cost YOYAKU macOS runner and are bound to an
exact main commit through gha-safe.
For detailed setup instructions, see docs/release/RELEASE_SETUP.md.
The workflow uses Tuist to generate the Xcode project:
gha-safe + exact SHA → tuist generate → xcodebuild → Sign & Notarize → Provenance → GitHub Release
Version is set in Sources/App/Info.plist and flows through to Sparkle auto-updates.
-
Configure the release authority (see full guide):
- GitHub secret
SPARKLE_EDDSA_PRIVATE_KEY - Developer ID identity in the trusted runner's login Keychain
- notarytool Keychain profile
YOYAKU-NOTARY
- GitHub secret
-
Verify your certificate:
./scripts/verify-p12.sh /path/to/certificate.p12
-
Create a release from the exact checked-in version on
main:RELEASE_SHA="$(git rev-parse main)" gha-safe dispatch --repo yoyaku-group/Cortex --workflow release.yml \ --ref main --expected-sha "$RELEASE_SHA" --apply
The workflow will automatically build, sign, notarize, and publish to GitHub Releases.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
To credit someone, comment on any issue or pull request:
@all-contributors please add @username for code, doc
In Settings → Menu Bar, enable percentage or duration display and select up
to three providers. Each selected provider has its own card for choosing a quota,
an optional secondary quota, and stacked text size. Their existing logos identify
the readouts, while tooltips retain provider names. All displayed providers refresh
in the background. Choices are preserved when a provider is removed and added again,
and existing single-provider settings are retained. Providers awaiting data show —.
MIT