Skip to content

Repository files navigation

AgentBar

AgentBar

Your Claude and Codex usage, always one glance away.

A tiny native macOS menu bar app that turns the CLI logins you already have into live, color-coded usage gauges — no account, no API keys, no backend.

CI Release Swift Platform Apple silicon UI

AgentBar menu bar gauges and usage popover

You live in your agent CLIs. AgentBar lives in your menu bar — quietly showing how much headroom each one has left, so a hard rate limit never catches you mid-flow.

The menu bar shows compact gauges that drift from green → amber → red as your headroom shrinks. Click for the full picture: exact percentages, reset times, sign-in state, and the one or two actions that actually matter.

No new account. No pasted API keys. No hosted AgentBar backend. Install it, and AgentBar discovers the providers already on your Mac and reuses their existing logins. Provider traffic goes directly to the provider, and release builds make one lightweight GitHub update check per hour.

flowchart LR
  C[Claude Code] --> D{Auto-detect<br/>provider}
  X[Codex · ChatGPT] --> D
  D --> A[Reuse existing<br/>login]
  A --> R[Poll usage<br/>windows]
  R --> M[Menu bar gauges]
  R --> P[Usage popover]
Loading

✨ Why you'll like it

  • Usage where your eyes already are. Compact menu bar gauges that turn amber, then red, before you hit a wall — not after.
  • Provider-native limits. AgentBar renders whatever windows each provider actually returns (session, 5-hour, weekly, …) instead of hardcoding assumptions that go stale.
  • Zero-config discovery. Homebrew, Nix profiles, ~/.local/bin, your PATH, the Codex / ChatGPT app bundles, and explicit path overrides all just work.
  • Bring your own login. Existing Claude Code OAuth and managed ChatGPT/Codex sessions are reused as-is. Missing a Codex login? Kick off codex login straight from the popover.
  • A menu bar that's yours. Reorder providers by dragging, pick neutral or colored styling, choose short or long gauges, and toggle glyphs and views.
  • Resilient by design. Background polling keeps the last good reading during rate limits, and generation-controlled refreshes stop a slow response from clobbering a newer one.
  • Careful with the dangerous button. Codex usage-resets stay quiet until you're nearly out — and spending one always asks first.
  • Speaks your language. Full English and Danish, following the system language with English as the fallback.

🚀 Install

Option 1 — Install or update from Terminal

curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/addvanced/agentbar/main/install.sh | /bin/zsh

The installer resolves the latest stable GitHub release, verifies its SHA-256 checksum, bundle identity, release metadata, architecture, and code signature, then installs it in /Applications. If AgentBar is already installed, the same command safely quits it, replaces it, and launches the new version.

Option 2 — Download a release

  1. Grab AgentBar-<version>-macos-arm64.zip from the latest release.
  2. Unzip it and drag AgentBar.app into /Applications.
  3. Launch it — a new set of gauges appears in your menu bar.

Release builds target Apple silicon and are ad-hoc signed but not notarized. On first launch, approve AgentBar under System Settings → Privacy & Security if macOS asks.

Option 3 — Build from source

git clone https://github.com/addvanced/agentbar.git
cd agentbar
make install

make install builds and signs the app, safely quits any running AgentBar, replaces /Applications/AgentBar.app, and launches the fresh build. Install elsewhere with:

make install INSTALL_DIR="$HOME/Applications"

Prerequisites

  • macOS 13 Ventura or later
  • Swift 5.9+ to build; Xcode 16+ for the Swift Testing suite
  • At least one of Claude Code, Codex, or the ChatGPT app installed
  • Apple silicon for the packaged GitHub release

🧭 Using AgentBar

The gauges sit in your menu bar the moment a supported provider is detected. Everything else is one click away.

Do this Get this
Left-click the gauges Open / close the Usage popover
Right-click the gauges View Usage, open Settings, or Quit
, Open Settings
Esc Step back: Settings → Usage → close
Q Quit AgentBar

Reading a gauge. Each provider shows up to two stacked bars — one per usage window. The fill length is how much you've used; the color is how worried you should be:

Color Utilization Meaning
🟢 Green < 75% Plenty of headroom
🟡 Amber 75–90% Getting close
🔴 Red ≥ 90% Nearly out

Making it yours. Open Settings to drag providers into the order you want and, per provider, toggle its visibility in the menu bar and Usage window, show or hide its glyph, and switch between a short or long gauge. Appearance (colored vs. neutral) and launch-at-login are global.

🔌 Providers

Provider Authentication Usage source
Claude Existing Claude Code OAuth login Anthropic usage endpoint
Codex Existing managed ChatGPT login owned by Codex Local Codex app-server

A provider that isn't installed disappears from the menu bar, Usage, and Settings automatically. One that's installed but signed out stays visible with a clear sign-in prompt — for Codex, that includes a Sign in with ChatGPT button that hands off to Codex's own browser flow.

Adding a provider is deliberately small: implement one UsageProvider, and it flows through discovery, the menu bar, the popover, and Settings on its own.

Custom install paths

AgentBar checks CLAUDE_EXECUTABLE and CODEX_EXECUTABLE before the standard locations, so non-standard and declarative setups are easy to wire up:

export CLAUDE_EXECUTABLE=/custom/path/to/claude
export CODEX_EXECUTABLE=/custom/path/to/codex

🔐 Privacy & authentication

Everything AgentBar owns stays on your Mac. There is no AgentBar account, no analytics, and no intermediary server. Usage traffic goes directly to the provider being displayed. Release builds also contact GitHub on launch and once per hour to resolve the latest release; no provider data is included. Preferences (order, appearance, visibility) live in macOS UserDefaults.

Claude — credentials remain in Claude-owned storage

Credentials come from CLAUDE_CODE_OAUTH_TOKEN, the macOS Keychain, or ~/.claude/.credentials.json, in that order. Usage is requested directly from Anthropic. If an access token expires, AgentBar refreshes it with Anthropic and writes the rotated credentials back to the same Claude-owned Keychain item or credentials file. AgentBar never persists a separate copy, and environment-only credentials remain read-only.

Codex — AgentBar never touches your tokens

AgentBar talks to the installed Codex app-server. Codex stays fully responsible for locating, refreshing, and protecting its ChatGPT credentials; AgentBar never reads or stores Codex access or refresh tokens. If you're signed out, AgentBar can launch codex login, and Codex owns the browser flow from start to finish.

⏱ Refresh behavior

Usage refreshes on launch, every 5 minutes in the background, and when the popover opens if at least 1 minute has passed. Authentication and reset actions trigger an immediate follow-up.

Release builds check GitHub for a newer stable version on launch, once per hour, and after the Mac wakes. When one is available, the Usage footer shows a link to this page with the install and update instructions. Local development builds do not perform update checks.

Overlapping requests are generation-controlled, so a slower old response can never overwrite a newer result. If a provider throttles AgentBar, the last successful reading stays on screen instead of flickering to an error.

🛠 Development

Sources/AgentBar/
├── Core/       Models, preferences, refresh coordinator, formatting, palette
├── MenuBar/    Status item rendering and separator-aware popover anchoring
├── Popover/    Usage UI, provider rows, and shared controls
├── Providers/  Discovery, auth, Claude, and Codex
└── Settings/   Ordering, visibility, and appearance

Tests/AgentBarTests/    Swift Testing suite
Tools/release/          Standalone Go release tool
scripts/                App packaging
.github/workflows/      CI and release automation
Command What it does
make build Compile a debug build
make run Build and run AgentBar
make fast Run the previous build without rebuilding
make test Run the Swift and installer test suites
make app VERSION=1.0.0 BUILD_NUMBER=1 BUILD_CHANNEL=release Build signed release artifacts

The first SwiftUI build takes ~30s (type-checking); incremental builds are much faster.

📦 Releases

AgentBar ships through a guarded SemVer flow driven by a small Go release tool. Install Task, authenticate gh, and run:

gh auth login
task release-tool:test
task release:check VERSION=1.0.0
task release

The tool refuses to proceed without main, a clean and up-to-date worktree, an unused SemVer tag, passing tests, a correctly versioned and signed arm64 bundle, and a matching SHA-256 checksum. It then waits for CI, creates an annotated tag, publishes through GitHub Actions, and verifies the final assets. It never creates commits, force-pushes, moves tags, or deletes releases.

⚠️ Good to know

  • GitHub release artifacts are currently Apple silicon only.
  • Distribution is ad-hoc signed, not Apple-notarized.
  • Usage depends on provider-owned interfaces and may need to adapt when Claude or Codex changes the windows they return.
  • At least one supported provider must be installed to show usage; AgentBar keeps a fallback menu bar icon so Settings and Quit are always reachable.

Built with SwiftUI + AppKit. Small in the menu bar, serious about the details.

About

Agent LLM Usage Bar for macOS

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages