{"id":47640532,"url":"https://github.com/nkootstra/claude-usage","last_synced_at":"2026-04-24T21:05:46.715Z","repository":{"id":346190012,"uuid":"1188611841","full_name":"nkootstra/claude-usage","owner":"nkootstra","description":"Track Claude (Code) usage from your menubar","archived":false,"fork":false,"pushed_at":"2026-04-24T07:30:39.000Z","size":1881,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T08:26:16.479Z","etag":null,"topics":["claude","claudecode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkootstra.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":"2026-03-22T10:37:22.000Z","updated_at":"2026-04-24T07:30:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nkootstra/claude-usage","commit_stats":null,"previous_names":["nkootstra/claude-usage"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/nkootstra/claude-usage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkootstra%2Fclaude-usage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkootstra%2Fclaude-usage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkootstra%2Fclaude-usage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkootstra%2Fclaude-usage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkootstra","download_url":"https://codeload.github.com/nkootstra/claude-usage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkootstra%2Fclaude-usage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32240622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","claudecode"],"created_at":"2026-04-02T00:50:49.229Z","updated_at":"2026-04-24T21:05:46.711Z","avatar_url":"https://github.com/nkootstra.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Usage\n\nA macOS menubar app that tracks your Claude (Code) usage in real time.\n\n![macOS 14+](https://img.shields.io/badge/macOS-14%2B-blue)\n![Swift 6](https://img.shields.io/badge/Swift-6-orange)\n![License](https://img.shields.io/badge/License-Apache%202.0-green)\n\n## Features\n\n- **Dual-percent menubar** — consumer plans show `5h% · 7d%` inline, each color-coded by threshold. Enterprise plans keep the ring gauge with monthly spend.\n- **Usage cards** — 5-hour, 7-day, Sonnet, and Opus utilization at a glance\n- **Enterprise support** — monthly credit spend with dollar/percentage toggle and burn rate projection\n- **Burn rate alerts** — notification when projected to hit limit within 60 minutes\n- **Threshold notifications** — configurable alerts at 80% and 95% usage\n- **OAuth sign-in** — authenticate via your browser with your Claude account\n- **Claude Code auto-detect** — picks up credentials from Claude Code if installed (file-based, no keychain prompts)\n- **Token refresh** — keeps your session alive without re-authenticating\n- **Auto-polling** — configurable interval (1/5/15/30 min) with exponential backoff\n- **Response cache** — hydrates the menu bar instantly on launch and defers the first poll when the cached response is still fresh, so rapid restarts don't stack API calls\n- **Sleep/wake aware** — pauses polling on sleep, resumes on wake\n- **Light \u0026 dark mode** — system colors throughout\n\n## Installation\n\n### From release (recommended)\n\n1. Download the latest `.dmg` from [Releases](../../releases)\n2. Open the DMG and drag **Claude Usage** to Applications\n3. Launch from Applications — it appears in your menubar\n\n### From source\n\n```bash\ngit clone https://github.com/nkootstra/claude-usage.git\ncd claude-usage\nswift run ClaudeUsageApp\n```\n\n### Build signed .app\n\n```bash\nbrew install xcodegen\nxcodegen generate\nxcodebuild -project ClaudeUsage.xcodeproj \\\n  -scheme ClaudeUsage \\\n  -configuration Release \\\n  -derivedDataPath build/DerivedData \\\n  CODE_SIGN_STYLE=\"Automatic\" \\\n  DEVELOPMENT_TEAM=\"YOUR_TEAM_ID\" \\\n  build\n```\n\nThe signed app will be at `build/DerivedData/Build/Products/Release/Claude Usage.app`.\n\n## Authentication\n\nOn first launch, click **Sign in with Claude** to authenticate via your browser. The app stores your credentials locally and refreshes tokens automatically.\n\nIf you have [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed, the app can also pick up your existing session from `~/.claude/.credentials.json` — no sign-in needed.\n\nCredential resolution order:\n1. Own cached credential (from a previous sign-in)\n2. Claude Code credential file (`~/.claude/.credentials.json`)\n3. Claude Code keychain (silent, no prompts)\n\n## How it works\n\nThe app polls `https://api.anthropic.com/api/oauth/usage` on a configurable interval and displays the response:\n\n| Bucket | What it measures |\n|---|---|\n| 5-Hour | Rolling 5-hour usage window (resets every 5 hours) |\n| 7-Day | Rolling 7-day usage across all models |\n| Sonnet | 7-day usage for Sonnet models specifically |\n| Opus | 7-day usage for Opus models specifically |\n| Credits | Enterprise monthly spend vs limit |\n\nThe last successful response is cached at `~/Library/Application Support/cc-stats/last-usage.json` so the menu bar can render immediately on relaunch without a network round-trip. Delete that file if you want to force a clean fetch.\n\n## Configuration\n\nClick the gear icon in the popover to access settings:\n\n- **Poll interval** — how often to fetch usage data (1, 5, 15, or 30 minutes)\n- **Launch at login** — start automatically when you log in\n- **Notification thresholds** — alert at 80% and/or 95% usage\n- **Enterprise display** — toggle between dollar amount and percentage (when a monthly limit is set)\n\n## Requirements\n\n- macOS 14 (Sonoma) or later\n- A Claude account (Pro, Max, or Enterprise)\n\n## Development\n\n```bash\n# Run tests\nswift test\n\n# Run the app (unsigned)\nswift run ClaudeUsageApp\n\n# Build signed app locally\nxcodegen generate\nxcodebuild -project ClaudeUsage.xcodeproj -scheme ClaudeUsage -configuration Release\n```\n\n### CI/CD\n\n- **CI** (`ci.yml`) — runs `swift test` on every PR and push to main\n- **Release** (`release.yml`) — triggered by pushing a tag (`v*`). Builds, signs, notarizes, creates DMG, and publishes a GitHub Release\n\nTo create a release:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\n### Code signing \u0026 releases\n\nSee [docs/SIGNING.md](docs/SIGNING.md) for the full setup guide: creating certificates, exporting `.p12`, configuring GitHub secrets, and troubleshooting.\n\n**Quick reference — required GitHub secrets:**\n\n| Secret | Description |\n|---|---|\n| `MACOS_CERTIFICATE` | Base64-encoded .p12 certificate |\n| `MACOS_CERTIFICATE_PWD` | Password for the .p12 file |\n| `MACOS_CERTIFICATE_NAME` | e.g. `Developer ID Application: Name (TEAM_ID)` |\n| `AC_USERNAME` | Apple ID email for notarization |\n| `AC_PASSWORD` | App-specific password for notarization |\n| `AC_TEAM_ID` | Apple Developer Team ID |\n\n## License\n\n[Apache License 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkootstra%2Fclaude-usage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkootstra%2Fclaude-usage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkootstra%2Fclaude-usage/lists"}