Model Usage (CodexBar)

Summarize per-model usage and costs for Codex or Claude using CodexBar CLI local cost logs.

CodexBar is a macOS menu bar app and CLI by Peter Steinberger (steipete) that tracks usage limits and costs across AI coding providers — Codex, Claude Code, Cursor, Gemini CLI, Copilot, OpenRouter, and many more. It shows real-time session and weekly usage in your menu bar, tells you when rate limits reset, and provides a CLI (`codexbar`) for scripting and CI integration. The OpenClaw skill wraps CodexBar's CLI specifically for the `codexbar cost` command, which reads local cost log files (from Codex's `~/.codex/cost-usage/` and Claude's session logs) and summarizes per-model usage with token counts and dollar costs. It's a Python-based parser that aggregates JSONL cost data into clean summaries. CodexBar supports an impressive roster of providers: OpenAI Codex, Claude Code (Anthropic), Cursor, Gemini CLI, Antigravity, Droid (Factory), GitHub Copilot, z.ai, Kiro, Vertex AI, Augment, Amp, JetBrains AI, and OpenRouter. Each provider has a dedicated data source — OAuth APIs, browser cookies, CLI RPC, or local log parsing — and CodexBar handles the authentication quirks of each. The menu bar app (macOS 14+) is minimal: no Dock icon, dynamic bar icons, optional merged-icon mode with a provider switcher. Each provider shows as a separate status item or merged into one. Settings let you enable only the providers you use. For OpenClaw users, the model-usage skill answers 'How much have I spent today?' or 'What's my Codex session usage?' without leaving chat. Schedule periodic cost reports via cron to stay on top of API spending. The CLI also works on Linux (without the menu bar) via community integrations like Waybar modules. Best suited for: anyone using multiple AI coding tools who wants centralized usage tracking, cost-conscious developers monitoring API spend, OpenClaw users wanting per-model cost breakdowns, teams managing shared AI coding budgets.

Tags: usage, cost, analytics, monitoring

Category: Analytics

Use Cases

  • Real-time usage monitoring: see remaining limits in the menu bar
  • Cost tracking: summarize per-model spending for budget management
  • Rate limit awareness: know when your window resets before hitting limits
  • Daily cost reports via OpenClaw cron automation
  • Team budget monitoring: track shared API spending
  • CI/CD integration: check usage programmatically in scripts

Tips

  • Install the menu bar app for real-time visibility: `brew install --cask steipete/tap/codexbar`
  • Use `codexbar cost` for OpenClaw-compatible cost summaries: `codexbar cost --json`
  • Enable only the providers you actually use in Settings → Providers
  • For Claude Code: use OAuth API auth for most reliable data (vs. browser cookies)
  • Combine with OpenClaw cron for daily cost reports sent to Telegram
  • Use Merge Icons mode if you track many providers — keeps menu bar clean
  • Check GitHub releases for weekly updates — steipete ships improvements frequently
  • Linux users: install the CLI-only binary and integrate with Waybar or TUI

Known Issues & Gotchas

  • macOS 14+ (Sonoma) required for the menu bar app — CLI works on Linux too
  • Cost data depends on local log files — if logs are cleared, historical data is lost
  • Some providers (Claude, Cursor) use browser cookies for data — cookies can expire
  • Usage display accuracy depends on each provider's data source reliability
  • The Codex OpenAI web dashboard extras require manual or automatic cookie setup
  • Multiple provider auth methods mean different failure modes — check Settings if a provider shows stale data
  • The skill specifically uses the cost CLI subcommand — menu bar features are separate

Alternatives

  • Usage4Claude
  • ccusage
  • Provider dashboards (web)
  • OpenRouter dashboard

Community Feedback

Built a live terminal session usage + memory status bar for Claude Code. I've been using CodexBar and it's great — this one looks similar, very helpful!

— Reddit r/ClaudeCode

How did you guys track Codex usage? I use codexbar.app — it lets me track several providers too. Nice menu bar limit tracking for Codex and Claude Code.

— Reddit r/codex

I tried CodexBar but it was showing my limits as fully consumed when they clearly weren't, so I couldn't trust it. So I spent a weekend building an alternative.

— Reddit r/ClaudeCode

If you're looking for alternatives, people have suggested: Usage4Claude (another open-source project), CodexBar (for multiple AI providers).

— Reddit r/ClaudeAI

Configuration Examples

Install menu bar app + CLI

# Menu bar app (macOS)
brew install --cask steipete/tap/codexbar

# CLI only (macOS or Linux)
brew install steipete/tap/codexbar

# Or download from GitHub releases
# https://github.com/steipete/CodexBar/releases

CLI cost summary

# Summarize all costs
codexbar cost

# JSON output for scripting
codexbar cost --json | jq '.models[] | {name, total_cost}'

# Filter by date range
codexbar cost --since 2026-03-01

Provider setup

# Open Settings to enable providers
# Menu bar icon → Settings → Providers

# For Codex: install and sign in to Codex CLI
# For Claude: codexbar uses OAuth or browser cookies
# For Gemini: uses Gemini CLI OAuth credentials

Installation

brew install steipete/tap/codexbar

Source: bundled