Noureddine RAMDI / Usage4Claude: a native macOS menu bar app for real-time Claude and Codex usage monitoring

Created Mon, 04 May 2026 10:23:02 +0000 Modified Sat, 23 May 2026 20:41:27 +0000

f-is-h/Usage4Claude

Usage4Claude is a practical macOS menu bar application that solves a common frustration for users of Anthropic’s Claude and OpenAI’s Codex AI services: tracking usage quotas in real time without an official API. Instead of relying on an API that doesn’t exist, it cleverly extracts session cookies from the user’s authenticated session and scrapes the usage endpoints to provide adaptive, color-coded quota monitoring right from the menu bar.

What usage4claude does and how it’s built

At its core, Usage4Claude is a native macOS app written in Swift, designed to run unobtrusively in the menu bar. It tracks multiple usage limits — five distinct Claude quotas (including 5-hour, 7-day, Extra, 7-day Opus, and 7-day Sonnet) and three Codex limits — displaying them with adaptive color indicators that reflect the consumption levels.

The app’s architecture is centered around a WKWebView embedded in the app, which acts as a built-in browser for login and authentication. This component intercepts network requests to extract the critical sessionKey cookie (in the format sk-ant-...) from Claude’s usage page. This session key is then used to poll the undocumented usage endpoint, enabling real-time quota tracking.

All authentication credentials are securely stored in the macOS Keychain, leveraging the platform’s native security mechanisms to keep tokens safe. The app supports multi-account management, allowing users to track multiple Claude and Codex accounts simultaneously.

No official Claude API is involved — this is entirely a reverse-engineering approach, scraping data from the web interface under the hood. The app is sandboxed and keeps all usage data local, respecting user privacy and security.

The technical strength: session key extraction and adaptive quota monitoring

What sets Usage4Claude apart is its clever use of the WKWebView component to handle authentication and session key extraction automatically. Instead of requiring users to manually obtain tokens or use potentially insecure third-party tools, the app itself hosts a mini-browser that logs into Claude and captures the session cookie directly from network traffic.

This approach is robust enough for daily use but has clear tradeoffs. Since it depends on the exact behavior of Claude’s web login and usage endpoints, any changes in Anthropic’s authentication flows or session management could break the extraction mechanism. This fragility is a common challenge when working without an official API.

The app’s UI reflects usage with adaptive colors and supports multiple display modes, making it easy to glance at your quota consumption. It also implements a four-level adaptive refresh system to balance timely updates with resource efficiency. This refresh strategy avoids excessive network requests while keeping the data fresh.

The codebase is written entirely in Swift, aimed at macOS 13 and later, and makes full use of native APIs like Keychain and WKWebView. The sandboxing and local-only data storage demonstrate a security-conscious design.

quick start: installation and authentication

Usage4Claude offers two main installation options:

  1. Go to the Releases page
  2. Download the latest .dmg file
  3. Double-click to open, drag the app to the Applications folder
  4. Right-click the app and select “Open” on first launch (this allows running an unsigned app)
  5. Allow Keychain access for authentication info (you might need to do this again after updates; the prompt shows the relevant token name)

Option 2: Build from source

Requirements

  • macOS 13.0 or later
  • Xcode 15.0 or later
  • Git

Build steps

The README does not provide explicit build commands, but standard Xcode build and run procedures apply.

Authentication setup

Upon the first launch, a welcome screen guides you through authentication:

  • Claude authentication:

    • Recommended: Use the built-in “Browser Login” button to log into your Claude account. The app will automatically extract the session key from the login session.
    • Alternatively, you can manually extract the session key from the browser’s developer tools and paste it into the app.
  • Codex authentication:

    • Similar “Browser Login” flow is supported for Codex (ChatGPT) accounts.
    • Manual session key input is not currently supported for Codex.

All credentials are saved securely in Keychain for seamless reuse.

verdict: who should consider usage4claude

Usage4Claude is a solid tool for macOS users who actively use Claude and Codex AI services and want real-time visibility into their usage quotas without jumping through hoops. Its native Swift implementation and macOS-focused design make it a lightweight, efficient utility that integrates well into the daily workflow.

The main limitation is its reliance on scraping and session cookie extraction instead of an official API, which means it could break if Anthropic changes their authentication or usage reporting mechanisms. Users should be prepared to troubleshoot or wait for updates if that happens.

For developers and power users comfortable with macOS tooling, the multi-account support and secure keychain storage add valuable flexibility and peace of mind.

If you want a no-fuss, local-only, privacy-conscious way to monitor your Claude and Codex usage on macOS, Usage4Claude is worth trying out — just keep in mind the tradeoffs involved in its reverse-engineering approach.


→ GitHub Repo: f-is-h/Usage4Claude ⭐ 270 · Swift