{"id":32784651,"url":"https://github.com/decryptu/claude-meter","last_synced_at":"2026-05-06T15:44:43.322Z","repository":{"id":322486320,"uuid":"1089649998","full_name":"Decryptu/claude-meter","owner":"Decryptu","description":"A native macOS menu bar application that displays your Claude AI usage statistics in real-time with automatic credential detection.","archived":false,"fork":false,"pushed_at":"2025-11-04T19:11:21.000Z","size":45567,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-04T19:16:43.799Z","etag":null,"topics":["claude","claude-ai","claude-api","claude-code","claude-desktop","macos","menubar"],"latest_commit_sha":null,"homepage":"https://github.com/Decryptu/claude-meter/releases","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Decryptu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-04T16:17:22.000Z","updated_at":"2025-11-04T18:36:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Decryptu/claude-meter","commit_stats":null,"previous_names":["decryptu/claude-meter"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Decryptu/claude-meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fclaude-meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fclaude-meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fclaude-meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fclaude-meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decryptu","download_url":"https://codeload.github.com/Decryptu/claude-meter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fclaude-meter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282745088,"owners_count":26720200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-05T02:00:05.946Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","claude-ai","claude-api","claude-code","claude-desktop","macos","menubar"],"created_at":"2025-11-05T02:00:28.348Z","updated_at":"2026-05-06T15:44:43.315Z","avatar_url":"https://github.com/Decryptu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"64\" height=\"64\" alt=\"logo\" src=\"https://github.com/user-attachments/assets/fd5bcb74-816c-4fc0-b284-096567a9f519\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eClaudeMeter\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  A native macOS menu bar app that shows your \u003cstrong\u003eClaude app usage\u003c/strong\u003e in real-time with \u003cstrong\u003eSmart Quota Refresh\u003c/strong\u003e to minimize wait times — works with the Claude desktop app or claude.ai in your browser.\n  \u003cbr/\u003e\u003cbr/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-macOS-lightgrey\" alt=\"Platform: macOS\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/swift-5.9+-orange\" alt=\"Swift 5.9+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue\" alt=\"License: MIT\"\u003e\n  \u003cbr/\u003e\u003cbr/\u003e\n  \u003cimg width=\"866\" height=\"541\" alt=\"Screenshot\" src=\"https://github.com/user-attachments/assets/598d12c5-2ff9-4c98-920b-b7ab65cc5120\" /\u003e\n\u003c/p\u003e\n\n\u003e ✅ **No API keys required** — ClaudeMeter reads usage from your Claude account session (desktop or browser).  \n\u003e ❌ **This is not a tool for the Claude API**.\n\n## Features\n\n- **Automatic Setup** — Detects your Claude Desktop or browser session\n- **Menu Bar Integration** — Ring indicator with real-time usage\n- **Real-Time Updates** — Refreshes every 60 seconds\n- **Smart Quota Refresh** — Keep your 5-hour quota window active automatically\n- **Launch at Login** — Toggle from the menu\n- **Modern UI** — SwiftUI, native macOS 13-26 interface\n- **Built-in Logs** — Debug directly from the menu\n\n## Quick Start\n\n```bash\ngit clone https://github.com/decryptu/claude-meter.git\ncd claude-meter\n./run.sh\n```\n\nThe app will auto-detect your Claude Desktop or browser session and begin monitoring.\n\n## Prerequisites\n\n- macOS 13+\n- Swift 5.9+ (Xcode or CLI tools)\n- A logged-in Claude account on the desktop app or claude.ai in a browser\n\nNo API key needed.\n\n## Installation Options\n\n### Option 1 — Quick Run\n\n```bash\n./run.sh\n```\n\n### Option 2 — Manual Build\n\n```bash\nswift build -c release\n./.build/release/ClaudeMeter\n```\n\n### Option 3 — Install to Applications\n\n```bash\n./Scripts/install.sh\n```\n\n## Configuration\n\n### Automatic (Default)\n\nOn first launch, ClaudeMeter shows a welcome dialog offering two options:\n\n**Try Auto-Detection** — Automatically detects your Claude session from:\n\n- Claude Desktop cookies\n- Brave Browser cookies\n- Chrome cookies\n\nYou'll be asked to grant Keychain access to decrypt cookies securely.\n\n**Configure Manually** — Skip auto-detection and enter credentials yourself.\n\nIf auto-detection succeeds, monitoring starts automatically.\n\n### Manual Setup\n\nIf you choose manual setup or auto-detection fails:\n\n1. Click the menu bar icon\n2. Open \"Settings\"\n3. Enter credentials manually\n\nTo manually retrieve session details:\n\n1. Visit \u003chttps://claude.ai/settings/usage\u003e while logged in\n2. Open Developer Tools → Network\n3. Refresh, inspect the usage request\n4. Copy:\n   - Organization ID from the URL\n   - Session Key from the Cookie header\n\n## Usage\n\n### Dropdown Menu Includes\n\n- Current usage + reset timer\n- Refresh (Cmd+R)\n- Launch at Login\n- Settings (Cmd+,)\n- Logs\n- Quit (Cmd+Q)\n\n### Smart Quota Refresh\n\nClaude's quota works on a rolling 5-hour window that starts when you send your first message. If you don't use Claude for 5+ hours, the window expires and goes into a \"null state.\"\n\n**Smart Quota Refresh** automatically keeps your quota window active by:\n\n- Detecting when your quota period expires\n- Sending a minimal message (~2-5 tokens) in a private conversation that doesn't clutter your history\n- Running silently in the background\n\nEnable it in **Settings** → **Smart Quota Refresh** toggle.\n\nThis ensures you always have an active quota period ready to use, without wasting tokens or leaving traces in your chat history.\n\n#### How It Works (Mathematical Proof)\n\nClaude's quota system operates on a **rolling 5-hour window** that only starts when you send your first message. Understanding this mechanism is key to optimizing wait times.\n\n**The Core Problem:**\n\nWhen you hit your quota limit, you must wait for the 5-hour window to reset. The wait time depends on *when* the window started relative to when you hit the limit.\n\n**Real-World Scenario:**\n\n```\nWithout Smart Quota Refresh:\n┌─────────────────────────────────────────────────────────────┐\n│ 10:00 AM: Idle (no active window, \"null state\")            │\n│ 12:00 PM: You start using Claude → Window STARTS            │\n│ 2:00 PM:  You hit quota limit (used for 2 hours)           │\n│ 2:00 PM - 5:00 PM: WAITING (3 hours)                       │\n│ 5:00 PM:  Window resets (12:00 PM + 5h)                    │\n└─────────────────────────────────────────────────────────────┘\n\nWait Time = 5h - 2h = 3 hours\n```\n\n```\nWith Smart Quota Refresh:\n┌─────────────────────────────────────────────────────────────┐\n│ 10:00 AM: Auto-refresh triggers → Window STARTS             │\n│           (~2-5 tokens spent in private conversation)        │\n│ 12:00 PM: You start using Claude (window already 2h old)   │\n│ 2:00 PM:  You hit quota limit (used for 2 hours)           │\n│ 2:00 PM - 3:00 PM: WAITING (1 hour)                        │\n│ 3:00 PM:  Window resets (10:00 AM + 5h)                    │\n└─────────────────────────────────────────────────────────────┘\n\nWait Time = 5h - 2h - 2h = 1 hour\nTime Saved = 3h - 1h = 2 hours (66.7% reduction)\n```\n\n**The Mathematical Formula:**\n\nLet:\n\n- `W` = Window duration (5 hours)\n- `L` = Time to hit quota limit after you start using Claude\n- `Δ` = Lead time (hours between auto-refresh and when you actually use Claude)\n\n```\nWithout Smart Refresh:\n  Wait Time = W - L\n\nWith Smart Refresh:\n  Wait Time = W - L - Δ\n\nTime Saved:\n  Savings = Δ\n  Percentage Reduction = (Δ / (W - L)) × 100%\n```\n\n**Example Calculation:**\n\nFor W=5h, L=2h, Δ=2h:\n\n- **Without:** 5 - 2 = 3 hours wait\n- **With:** 5 - 2 - 2 = 1 hour wait\n- **Savings:** 2 hours (66.7% reduction)\n\n**Optimization Visualization:**\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"4170\" height=\"2973\" alt=\"claude_quota_optimization\" src=\"https://github.com/user-attachments/assets/cd911223-42c7-44a6-801c-5c935d8c8391\" /\u003e\n\u003c/p\u003e\n\n*The graph shows how wait time decreases as the auto-start lead time (Δ) increases. Maximum optimization occurs when Δ = W - L, reducing wait time to zero.*\n\n**Key Insights:**\n\n1. **Cost:** ~2-5 tokens per auto-refresh trigger (using minimal prompt in private conversation)\n2. **Benefit:** Reduces wait time by up to 100% (when Δ = W - L)\n3. **ROI:** In the example above, spending ~2-5 tokens saves 2 hours of waiting\n4. **Privacy:** Uses temporary conversations that don't appear in your chat history\n5. **Best Practice:** Enable Smart Quota Refresh if you use Claude sporadically rather than continuously\n\n**When It Helps Most:**\n\n- You use Claude in bursts (e.g., morning and evening sessions)\n- You frequently hit quota limits\n- You want to minimize downtime between sessions\n\n**When It's Less Useful:**\n\n- You use Claude continuously throughout the day\n- You rarely hit quota limits\n- Your usage patterns already align with 5-hour intervals\n\n## Troubleshooting\n\n- **\"Setup Required\"** → Make sure Claude Desktop or claude.ai is logged in\n- **No data** → Session may have expired\n- **Permissions** → Grant Full Disk Access if needed (for cookie access)\n\nLogs are stored in:\n\n```bash\n~/.config/claude-meter/logs/\n```\n\n## Building for Distribution\n\n```bash\n./Scripts/build-app.sh 1.0.0\n```\n\nUnsigned .app will be placed in `dist/`.\n\nPrepare a GitHub release:\n\n```bash\n./Scripts/prepare-release.sh 1.0.0\n```\n\n## Development\n\n```bash\nswift build\nswift build -c release\n```\n\nKey files:\n\n- `CredentialExtractor.swift`\n- `MenuBarManager.swift`\n- `SettingsView.swift`\n- `Logger.swift`\n\n## Security\n\n- Everything stays on-device\n- Only communicates with claude.ai\n- No API keys, no telemetry, no tracking\n- Open source\n\n## License\n\nMIT — see [LICENSE](LICENSE)\n\n---\n\nUnofficial utility — not affiliated with Anthropic or Claude.\n\nMade with ❤️ for the Claude community.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fclaude-meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecryptu%2Fclaude-meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fclaude-meter/lists"}