{"id":51107492,"url":"https://github.com/tespera/cc-usage-statusline","last_synced_at":"2026-06-24T15:01:01.979Z","repository":{"id":360873671,"uuid":"1250958108","full_name":"Tespera/cc-usage-statusline","owner":"Tespera","description":"Claude Code status line showing your 5-hour \u0026 7-day rate-limit usage — right-aligned, color-coded, zero network calls. macOS + Linux.","archived":false,"fork":false,"pushed_at":"2026-05-28T07:13:13.000Z","size":164,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T09:10:21.159Z","etag":null,"topics":["anthropic","bash","claude","claude-code","cli","linux","macos","rate-limit","status-line","statusline","usage-tracker"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Tespera.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-05-27T05:47:05.000Z","updated_at":"2026-05-28T07:13:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Tespera/cc-usage-statusline","commit_stats":null,"previous_names":["tespera/cc-usage-statusline"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Tespera/cc-usage-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tespera%2Fcc-usage-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tespera%2Fcc-usage-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tespera%2Fcc-usage-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tespera%2Fcc-usage-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tespera","download_url":"https://codeload.github.com/Tespera/cc-usage-statusline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tespera%2Fcc-usage-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34737398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"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":["anthropic","bash","claude","claude-code","cli","linux","macos","rate-limit","status-line","statusline","usage-tracker"],"created_at":"2026-06-24T15:00:59.752Z","updated_at":"2026-06-24T15:01:01.973Z","avatar_url":"https://github.com/Tespera.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cc-usage-statusline\n\nA [Claude Code](https://claude.com/claude-code) status line that shows your **5-hour** and **7-day** rate-limit usage on the right, plus the model name and context-window usage on the left.\n\n## Preview\n\n![preview](preview.png)\n\n- **Left** — model name + context-window % (the same info cc shows by default).\n- **Right** — 5h / 7d utilization with reset countdowns, right-aligned and color-coded:\n  - green `\u003c 50%`, yellow `50–79%`, red `\u003e= 80%`.\n  - reset countdowns: the 5-hour shows hours+minutes (e.g. `4h39m`); the 7-day shows days+hours (e.g. `6d8h`), falling back to hours+minutes when under a day.\n\nExample right segment: `5h 7% 4h39m | 7d 6% 6d8h`.\n\nAll data comes from the JSON Claude Code passes to the status line command on stdin. **No network calls, no credentials, no cache.**\n\n## Requirements\n\n- Claude Code (tested on v2.1.x — relies on the `rate_limits` field in the status line stdin payload).\n- `jq`\n- macOS or Linux, with `bash`.\n\n## Install\n\n```bash\ngit clone https://github.com/Tespera/cc-usage-statusline.git\ncd cc-usage-statusline\n./install.sh\n```\n\nThen restart Claude Code (or open a new window).\n\nThe installer copies the script to `~/.claude/scripts/` and sets the `statusLine` field in `~/.claude/settings.json`. Your existing settings are backed up first; only `statusLine` is replaced.\n\nTo change how often the line refreshes (default 1s):\n\n```bash\nREFRESH_INTERVAL=5 ./install.sh\n```\n\n## Uninstall\n\n```bash\n./uninstall.sh\n```\n\nRemoves the `statusLine` entry (only if it points at this script) and deletes the script. Settings are backed up first.\n\n## Manual install\n\nIf you'd rather not run the installer:\n\n1. Copy `cc-usage-statusline.sh` to `~/.claude/scripts/` and `chmod +x` it.\n2. Add this to `~/.claude/settings.json` (merge with whatever you already have):\n\n   ```json\n   {\n     \"statusLine\": {\n       \"type\": \"command\",\n       \"command\": \"/absolute/path/to/.claude/scripts/cc-usage-statusline.sh\",\n       \"refreshInterval\": 1\n     }\n   }\n   ```\n\n## Customize\n\nEdit the tunables at the top of the script:\n\n| Variable | Default | Meaning |\n|---|---|---|\n| `WARN` | `50` | percent at which the number turns yellow |\n| `CRIT` | `80` | percent at which the number turns red |\n| `RIGHT_MARGIN` | `6` | columns kept free on the right for cc's own notifications |\n\n## How it works / limitations\n\n- Claude Code runs the status line command on each render and pipes a JSON blob to it on stdin. This script reads `rate_limits`, `model`, and `context_window` from that blob.\n- The status line command has **no controlling tty**, so terminal width is resolved via the parent (cc) process's tty. If that fails it falls back to `$COLUMNS`, then 80.\n- cc trims leading whitespace from status line output, so a zero-width U+2060 anchor is prepended to keep the right-alignment padding intact.\n- cc reserves the far-right of the row for its own transient notifications (clipboard hints, auto-update messages, etc.); `RIGHT_MARGIN` leaves room so they don't collide.\n\n**Known quirks (these are cc behavior, not bugs in this script):**\n\n- **Different windows can show slightly different numbers.** Each window renders with the `rate_limits` snapshot cc handed it at its last render; cc fetches independently per session, and the 5h window is a rolling window, so values drift between windows.\n- **Numbers may differ from `/usage`.** `/usage` computes live when you run it; the status line shows the (slightly lagging) value cc cached in the stdin payload.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftespera%2Fcc-usage-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftespera%2Fcc-usage-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftespera%2Fcc-usage-statusline/lists"}