explaingit

caggann/claude-code-monitor

0SwiftAudience · developerComplexity · 2/5ActiveLicenseSetup · easy

TLDR

Native Mac menu-bar app that polls Anthropic once a minute and shows your Claude Code session and weekly usage as donut charts with a percentage.

Mindmap

mindmap
  root((claude-code-monitor))
    Inputs
      Keychain token
      Anthropic API headers
      One minute timer
    Outputs
      Menu bar percentage
      Donut charts
      Reset countdown
    Use Cases
      Track CC session limits
      Watch weekly quota
      Avoid hitting rate caps
    Tech Stack
      Swift
      AppKit
      Keychain
      Anthropic API

Things people build with this

USE CASE 1

Show your Claude Code session and weekly usage in the Mac menu bar

USE CASE 2

Glance at how close you are to a rate limit before starting a long task

USE CASE 3

Study a worked example of reading the Anthropic Keychain token and polling Haiku for header values

USE CASE 4

Add the app to login items so usage tracking starts every boot

Tech stack

SwiftAppKitKeychainAnthropic API

Getting it running

Difficulty · easy Time to first run · 5min

Needs an existing Claude Code login so the token lives in Keychain; if percentages read zero, run claude -p hi to refresh the token.

MIT, use, copy, modify, and ship for any purpose as long as the copyright notice stays.

In plain English

Claude Code Monitor is a small native Mac app that sits in your menu bar and shows how much of your Claude Code usage allowance you have already spent. Claude Code is Anthropic's command line coding assistant, and like most paid AI tools it has limits on how much you can use in a single session and across a week. This app puts those numbers where you can glance at them without opening a terminal. What you actually see is a little pixel robot icon in the menu bar with a percentage next to it, such as 32 percent. Clicking the icon opens a small panel with two donut charts, one for the current five hour session and one for the rolling seven day window, plus a countdown to the next reset and the weekly usage number written out. The way it gets the numbers is interesting and worth understanding. Claude Code stores your login token in the standard macOS Keychain. The app reads that token from Keychain, then once a minute it sends a one token request to Anthropic's messages API using the cheap Haiku model. Anthropic includes the rate limit usage values in the response headers of every API call, so the app just reads those headers rather than scraping or reverse engineering anything. The README is explicit that the cost of this polling is close to zero. It is built with Swift and AppKit, with no Electron and no web view. The popover is a native NSPanel with a blurred background, the donut charts are drawn with NSBezierPath, and the tray icon is generated in code. It needs macOS 13 or newer, the Swift toolchain that comes with Xcode Command Line Tools, and a working Claude Code install so that the credentials exist in Keychain in the first place. Installation is either a single curl command that pipes an install script into bash, or a manual build that uses swift build, copies the binary into an .app bundle, and drops it into the Applications folder. There is also a short uninstall recipe, a note about adding the app to login items so it launches at startup, and a troubleshooting tip: if the percentages show zero, your token has probably expired and running claude -p hi in the terminal will refresh it. The project is MIT licensed.

Copy-paste prompts

Prompt 1
Build and install CaGgAnN/claude-code-monitor on macOS Sonoma using the manual swift build path
Prompt 2
Patch claude-code-monitor to poll every 5 minutes instead of every minute and explain the token cost change
Prompt 3
Port the menu bar percentage logic from claude-code-monitor to a Linux GNOME extension
Prompt 4
Add a notification to claude-code-monitor when weekly usage crosses 80 percent
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.