claude-peak

skill
SUMMARY

Claude Max usage monitor for macOS menu bar

README.md

ํ•œ๊ตญ์–ด

Claude Peak

Claude Peak

A macOS menu bar app that monitors Claude Max usage limits โ€” with real-time flame animation that burns hotter as you consume more tokens.

Screenshots

Claude Peak demo

Claude Peak usage Claude Peak settings

The menu bar displays the current 5-hour utilization (%) and time until reset. Click to see detailed usage.
When tokens are being consumed, a flame icon animates based on activity level.

Why Claude Peak?

๐Ÿ”ฅ Live flame animation The only app that monitors JSONL token logs in real time โ€” flames burn brighter as tps climbs
๐ŸŽฎ MADMAX mode Gamified with challenge messages from "Pathetic" to "WITNESS ME"
๐Ÿ” One-click OAuth No session keys, no DevTools โ€” just login in your browser
โšก Pure Swift No Electron, zero dependencies, 8 source files via SPM

MADMAX Challenge

Enable MADMAX mode and push your token throughput to the limit. Each flame tier unlocks a new challenge message:

Flames tps EN ํ•œ๊ตญ์–ด
๐Ÿ”ฅ ร— 0 0 Light it up. If you can. ๋ถˆ ์ข€ ๋ถ™ํ˜€๋ด. ์ถฅ๋‹ค์•ผ.
๐Ÿ”ฅ ร— 1โ€“2 1 โ€“ 19,999 That's it? Pathetic. ๊ฒจ์šฐ ์ด๊ฑฐ?
๐Ÿ”ฅ ร— 3โ€“4 20,000 โ€“ 39,999 Warming up... ์Šฌ์Šฌ ๊ฐ€๋ณผ๊นŒ
๐Ÿ”ฅ ร— 5โ€“6 40,000 โ€“ 59,999 Now we're cooking. ์ œ๋ฒ•์ธ๋ฐ?
๐Ÿ”ฅ ร— 7โ€“8 60,000 โ€“ 79,999 FEEL THE BURN ๋ฏธ์ณค๋‹ค!!!
๐Ÿ”ฅ ร— 9 80,000 โ€“ 89,999 ONE MORE. DO IT. ๊ฑฐ์˜ ๋‹ค ์™”๋‹ค!!!
๐Ÿ”ฅ ร— 10 90,000+ WITNESS ME ๋‚˜๋ฅผ ๊ธฐ์–ตํ•ด!!!

Can you hit 10 flames? Most people never get past "That's it? Pathetic."

Weekly Pace

Shows how your weekly usage is trending based on elapsed time vs utilization:

pace = actual utilization / (elapsed days รท 7 ร— 100)

Pace EN ํ•œ๊ตญ์–ด
< 0.3 Go absolutely wild ๋งˆ๊ตฌ ๋‚œ์‚ฌํ•ด๋„ ๋จ
< 0.6 Plenty of room ์—ฌ์œ  ๋„˜์นจ
< 0.85 Cruising nicely ์ ๋‹นํžˆ ์“ฐ๋Š” ์ค‘
< 1.1 Right on pace ๋”ฑ ๋งž๋Š” ํŽ˜์ด์Šค
< 1.4 Getting warm ์Šฌ์Šฌ ๊ฑฑ์ •๋œ๋‹ค์ž‰
< 1.7 Burning hot ์ด๋Ÿฌ๋‹ค ๊ฑฐ๋œ๋‚จ
โ‰ฅ 1.7 Hit the brakes! ๊ฑฐ๋œ์ง์ „

Flame Modes

Four modes available in settings:

  • Off โ€” No flame icon
  • 1 โ€” Single flame, animates when tokens are active
  • 3 (default) โ€” Dynamic 1โ€“3 flames based on tps
  • MADMAX โ€” Dynamic 1โ€“10 flames (10,000 tps per flame)
Dynamic (3) mode โ€” animation speed table
tps Flames Animation Speed
0 (small ember, static) None
0 โ€“ 30,000 ร— 1 0.50s โ†’ 0.20s
30,000 โ€“ 60,000 ร— 2 0.30s โ†’ 0.15s
60,000+ ร— 3 0.20s โ†’ 0.08s
MADMAX mode โ€” animation speed table
tps Flames Animation Speed
0 (small ember, static) None
1 โ€“ 9,999 ร— 1 0.40s
10,000 โ€“ 19,999 ร— 2 โ†“
... ... โ†“
90,000+ ร— 10 0.06s

Features

  • Real-time flame animation โ€” Monitors ~/.claude/projects/ JSONL logs, animates flames based on token throughput
  • Remote server monitoring โ€” Aggregate token activity from remote machines (e.g. via Tailscale) into a single flame display
  • Menu bar display โ€” 5-hour utilization %, time until reset (configurable)
  • Detailed popover โ€” 5-hour, 7-day (All models), 7-day (Sonnet) usage + reset timers
  • Weekly pace indicator โ€” Shows whether you're on track, have room to spare, or burning too fast
  • Korean / English messages โ€” Toggle message language in settings
  • Settings โ€” Display format, refresh interval (1/5/10 min), flame mode, message language, remote server
  • OAuth PKCE โ€” Browser-based auth with automatic token refresh

Installation

Homebrew (Recommended)

Pre-built bottles available โ€” no Xcode required.

brew tap letsur-dev/claude-peak https://github.com/letsur-dev/claude-peak.git
brew install claude-peak

# Launch (auto-links to ~/Applications on first run)
claude-peak

Update:

brew update
brew upgrade claude-peak
Troubleshooting

If you see undefined local variable or tap-related errors:

brew untap letsur-dev/claude-peak
brew tap letsur-dev/claude-peak https://github.com/letsur-dev/claude-peak.git
brew reinstall claude-peak

Note: The URL is required because the repo name is claude-peak, not homebrew-claude-peak.

Build from Source

Requires Xcode or Command Line Tools with full Xcode.

git clone https://github.com/letsur-dev/claude-peak.git
cd claude-peak
./build.sh

# Launch
open ~/Applications/Claude\ Peak.app

Remote Server

Monitor Claude Code sessions running on remote machines. Token activity is fetched via HTTP and merged with local activity โ€” flames reflect combined throughput.

Setup

On the remote machine (requires Node.js 18+):

npx claude-peak-server          # starts in background
npx claude-peak-server status   # check if running
npx claude-peak-server down     # stop

The server scans ~/.claude/projects/**/*.jsonl every 2 seconds and exposes:

  • GET /api/activity โ†’ { tokensPerSecond, recentTokens: [{date, tokens}] }
  • GET /health โ†’ { ok: true }

Default port: 3200 (override with PORT env var).

On your Mac:

Settings โ†’ Remote Server โ†’ toggle ON โ†’ enter host and port โ†’ ๐ŸŸข = connected.

Connects via HTTP (direct network access required, e.g. Tailscale, LAN, VPN).

SSH-only environments

If only SSH access is available, use port forwarding:

ssh -L 3200:localhost:3200 your-server

Then set host to localhost in Settings.

Tech Details

Auth Flow

On first launch, click "Login with Claude" โ†’ sign in with your Claude account in the browser โ†’ tokens are saved automatically.

  1. App starts a local HTTP server (random port, IPv6)
  2. Opens claude.ai/oauth/authorize in browser (with PKCE code_challenge)
  3. After authentication, redirects to http://localhost:PORT/callback?code=xxx
  4. App exchanges the code for tokens at platform.claude.com/v1/oauth/token
  5. Tokens saved to ~/.config/claude-peak/tokens.json (0600 permissions)

Token Refresh:

  • Automatically refreshes 5 minutes before access token expiry
  • Prompts re-login on refresh failure
API

Usage Query

GET https://api.anthropic.com/api/oauth/usage
Headers:
  Authorization: Bearer {access_token}
  anthropic-beta: oauth-2025-04-20
  User-Agent: claude-code/2.0.32

Example response:

{
  "five_hour": { "utilization": 2.0, "resets_at": "2026-01-29T09:59:59Z" },
  "seven_day": { "utilization": 63.0, "resets_at": "2026-01-29T23:59:59Z" },
  "seven_day_sonnet": { "utilization": 0.0, "resets_at": null },
  "extra_usage": { "is_enabled": false }
}
  • utilization: 0โ€“100 (percentage)
  • resets_at: ISO 8601 timestamp or null

Token Refresh

POST https://platform.claude.com/v1/oauth/token
Content-Type: application/json

{
  "grant_type": "refresh_token",
  "refresh_token": "...",
  "client_id": "9d1c250a-e61b-44d9-88ed-5944d1962f5e",
  "scope": "user:profile user:inference"
}
Lessons Learned
  • Keychain token expiration: Claude Code re-authenticates via browser OAuth each session, which can invalidate Keychain refresh tokens. A standalone OAuth flow is needed.
  • claude setup-token limitations: Issues inference-only tokens (user:inference scope only), which cannot access the usage API (requires user:profile).
  • OAuth redirect URI: Must be http://localhost:PORT/callback exactly. 127.0.0.1 or /oauth/callback paths are rejected.
  • IPv6: On macOS, localhost may resolve to ::1 (IPv6), so an IPv6 socket is required.
  • Token exchange: The state parameter is required for both the authorize and token exchange requests.
  • Utilization values: The API returns utilization as 0โ€“100 integers (not 0โ€“1 decimals).
  • Field naming: The API response uses resets_at (with plural 's').
  • JSONL token logs: Claude Code creates per-session JSONL files under ~/.claude/projects/, with token usage recorded in message.usage of each line.

Reviews (0)

No results found