AgentLimits
AgentLimits is macOS widgets that display Codex/Claude Code usage limits and ccusage tokens, cost, heatmap
Install / Use
/learn @Nihondo/AgentLimitsAbout this skill
Quality Score
0/100
Category
Development & EngineeringSupported Platforms
Claude Code
Claude Desktop
OpenAI Codex
README
AgentLimits
In Development
AgentLimits is a macOS Sonoma+ menu bar app with Notification Center widgets. It shows usage limits for ChatGPT Codex / Claude Code (5-hour and weekly windows), GitHub Copilot (monthly premium requests), and ccusage token usage.

Download
Download the latest build: Download
Quick Start (First-Time Setup)
- Run AgentLimits.
- Add widgets in Notification Center.
- Open AgentLimits Settings... from the menu bar.
- In Usage, choose Codex, Claude Code, or Copilot, set refresh interval (1–10 minutes), open the bottom login panel (
▲), then sign in. - Use the menu bar Display Mode to switch Used/Remaining, and Refresh Now for manual updates.
What It Tracks
- Usage limits (Codex / Claude Code): 5-hour and weekly usage via internal APIs.
- Codex:
https://chatgpt.com/backend-api/wham/usage - Claude Code:
https://claude.ai/api/organizations/{orgId}/usage
- Codex:
- Usage limits (GitHub Copilot): Monthly premium interaction quota via entitlement API.
- Copilot:
https://github.com/github-copilot/chat/entitlement
- Copilot:
- Token usage (ccusage): daily/weekly/monthly tokens and cost via CLI.
- Codex:
npx -y @ccusage/codex@latest daily - Claude Code:
npx -y ccusage@latest daily
- Codex:
- Premium request usage (Copilot): daily premium request count and cost via WebView.
- API:
https://github.com/settings/billing/usage_table(fetched automatically with Copilot usage)
- API:
Menu Bar Display
- Two-line layout per provider
- Line 1: provider name
- Line 2:
X% / Y%(5-hour / weekly) - For Copilot:
X%(monthly)
- Display mode: Used or Remaining (shared across app and widgets)
- Status colors are based on pacemaker comparison when available (colors are configurable in Notification settings)
- Pacemaker mode: shows
<used>% (<pacemaker>)%where pacemaker is elapsed time percentage - Toggle visibility per provider in Usage settings
- Menu bar menu includes Language (System/Japanese/English), Wake Up → Run Now, and Start app at login
Pacemaker Mode
Pacemaker mode shows a time-based usage benchmark to help you stay on track.
- Calculation: Elapsed percentage of the usage window (e.g., 50% = halfway through the 5h or weekly window)
- Comparison: Green = on track or ahead, Orange = slightly over pace, Red = 10%+ over pace
- Menu Bar: Shows
<used>% (<pacemaker>)%with toggleable pacemaker value display (Pacemaker settings) - Widget: Outer ring = actual usage, inner ring = pacemaker percentage (shown when pacemaker data is available)
- When usage exceeds pacemaker in used mode only, the outer ring is segmented and color-coded (green → orange → red) to show warning/danger zones (toggleable in Pacemaker settings, enabled by default)
- Thresholds: Warning/danger delta thresholds are configurable in Pacemaker settings
- Colors: Pacemaker ring/text colors are configurable in Pacemaker settings
Widgets
Usage Widgets (Codex / Claude Code)
- Dual donut gauge: 5-hour and weekly windows side by side
- Color-coded percentage based on usage level and display mode
- Update time shown as
HH:mm(or--:--if older than 24h)
Usage Widget (GitHub Copilot)
- Single centered donut gauge: monthly premium interaction quota
- Pacemaker inner ring divided into weekly segments (4–5 segments based on billing period)
- Center label:
1mo - Color-coded percentage based on usage level and display mode
- Update time shown as
HH:mm(or--:--if older than 24h)
Token Usage Widgets (Codex / Claude Code)
- Small: today / this week / this month summary (cost + tokens)
- Medium: summary + GitHub-style heatmap
- 7 rows (Sun–Sat) × 4–6 columns (weeks)
- 5 levels by quartile distribution
- Weekday labels (Mon, Wed, Fri)
- Desktop pinned mode support (accented / grayscale)
- Widget tap action is configurable (default opens
https://ccusage.com/)
Premium Requests Usage Widget (GitHub Copilot)
- Small: today / this week / this month summary (cost + premium requests)
- Medium: summary + GitHub-style heatmap
- Data is fetched automatically when Copilot usage is refreshed (via WebView, no CLI required)
- Widget tap action is configurable (default opens
https://ccusage.com/)
Settings Guide
Usage
- Open Usage.
- Select Codex, Claude Code, or Copilot.
- Choose refresh interval (1–10 minutes).
- Toggle Show in menu bar per provider.
- Click the bottom login bar (
▲) to expand the embedded WebView panel. - Sign in via the embedded WebView (chatgpt.com / claude.ai / github.com).
- Use Clear Data to remove login data and website storage if sign-in gets stuck.
ccusage
- Open ccusage.
- Select provider (Codex / Claude Code).
- Choose refresh interval (1–10 minutes).
- Enable periodic fetch and set additional CLI args if needed.
- Use Test Now to verify CLI execution.
- For Copilot: billing data is fetched automatically when Copilot usage is refreshed — just enable the toggle.
Wake Up
- Open Wake Up.
- Select provider (Codex / Claude Code). Note: Copilot is not supported.
- Enable schedule.
- Choose hours to run (0–23).
- Use Test Now to verify CLI execution.
Notification
- Open Notification.
- Request notification permission (first time only).
- Select provider (Codex / Claude Code / Copilot).
- Configure thresholds for each window (5-hour/weekly for Codex/Claude Code, monthly for Copilot).
- Adjust usage colors (donut + status colors) if needed.
Pacemaker
- Open Pacemaker.
- Toggle the menu bar pacemaker value display.
- Toggle the widget ring warning segments (color-coded segments when exceeding pacemaker).
- Adjust pacemaker warning/danger deltas.
- Customize pacemaker ring/text colors.
Advanced
- Open Advanced.
- Set full paths for
codex,claude,npxif needed (blank = resolve via PATH). - Review PATH resolution results.
- Choose widget tap action (open website / refresh data).
- Copy the bundled status line script path if needed.
Wake Up (CLI Scheduler)
- Runs scheduled commands:
codex exec --skip-git-repo-check "hello"claude -p "hello"
- LaunchAgent plist:
~/Library/LaunchAgents/com.dmng.agentlimit.wakeup-*.plist - Logs:
/tmp/agentlimit-wakeup-*.log - Additional CLI arguments are supported per provider.
Claude Code Status Line Script

- Bundled script for Claude Code status line integration (path shown in Advanced → Bundled Scripts)
- Reads Claude Code usage snapshot + App Group settings (display mode, language, thresholds, colors)
- Outputs a single line with 5-hour/weekly usage, reset times, and update time
- Options:
-ja,-en,-r(remaining),-u(used),-p(pacemaker),-i(usage + pacemaker inline),-d(debug) - Requires
jq(brew install jq)
Advanced: Storage (App Group)
Snapshots are stored in the App Group container:
~/Library/Group Containers/group.com.dmng.agentlimit/Library/Application Support/AgentLimit/
├── usage_snapshot.json
├── usage_snapshot_claude.json
├── usage_snapshot_copilot.json
├── token_usage_codex.json
├── token_usage_claude.json
└── token_usage_copilot.json
Notes / Troubleshooting
- Internal APIs may change without notice.
- ccusage output changes may break parsing.
- Widget refresh can be throttled by macOS.
- Threshold notifications require permission.
- CLI execution uses the user login shell and prefixes PATH with
/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH. - Full-path overrides in Advanced take precedence.
- Claude Code logins may require multiple attempts.
- The Claude Code status line script requires
jq. - Settings window minimum height is
620to keep the bottom login panel visible.
