{"id":50981214,"url":"https://github.com/susomejias/claude-statusline","last_synced_at":"2026-06-19T14:33:04.972Z","repository":{"id":343195682,"uuid":"1176696714","full_name":"susomejias/claude-statusline","owner":"susomejias","description":"A minimal statusline for Claude Code showing context window, rate limits, git info, and session stats.","archived":false,"fork":false,"pushed_at":"2026-03-19T11:34:57.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T11:51:27.378Z","etag":null,"topics":["claude-code","statusline"],"latest_commit_sha":null,"homepage":"https://susomejias.dev/claude-statusline","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/susomejias.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09T09:31:21.000Z","updated_at":"2026-03-19T11:35:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/susomejias/claude-statusline","commit_stats":null,"previous_names":["susomejias/claude-statusline"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/susomejias/claude-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susomejias%2Fclaude-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susomejias%2Fclaude-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susomejias%2Fclaude-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susomejias%2Fclaude-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/susomejias","download_url":"https://codeload.github.com/susomejias/claude-statusline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/susomejias%2Fclaude-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34536277,"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-19T02:00:06.005Z","response_time":61,"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-code","statusline"],"created_at":"2026-06-19T14:33:04.145Z","updated_at":"2026-06-19T14:33:04.956Z","avatar_url":"https://github.com/susomejias.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-statusline\n\nA minimal statusline for [Claude Code](https://claude.ai/code) showing context, git info, and session stats.\n\n- Subscription users see current and weekly rate limits.\n- API billing / API key users see session cost and token breakdown.\n\n\u003cimg width=\"598\" height=\"72\" alt=\"Captura de pantalla 2026-03-18 a las 23 49 52\" src=\"https://github.com/user-attachments/assets/9de068b9-9fc9-45f0-8905-8c5c6fa9deba\" /\u003e\n\n\u003cimg width=\"596\" height=\"69\" alt=\"claude-statusline-api-cost\" src=\"https://github.com/user-attachments/assets/4d473b27-2928-4680-80da-95290010aad1\" /\u003e\n\n**Line 1** — Model · Context remaining · Directory (git branch) · Session duration · Lines changed\n\n**Lines 2–3**\n\n- Subscription: current 5h window and 7-day rolling window, with reset times in local time.\n- API billing / API key: session cost in USD plus input, cache write, cache read, and output tokens.\n\nColors shift green → orange → yellow → red as limits are approached.\n\n## Requirements\n\n- macOS (uses `date -j` and `security` keychain)\n- `bash` and `curl`\n- [`jq`](https://jqlang.github.io/jq/) (optional if already installed globally)\n- Claude Code with an active session\n\nRate limits require the Claude OAuth token in macOS Keychain. API billing output works from the native Claude Code session payload.\n\n## Installation\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/susomejias/claude-statusline/main/install.sh | bash\n```\n\nThe installer will:\n\n- Install `statusline.sh` at `~/.claude/statusline.sh`\n- Create/update `~/.claude/settings.json` safely\n- Create a timestamped backup before changing existing settings\n- If `jq` is missing, download official `jq` binary to `~/.claude/bin/jq` and verify checksum\n- Ask for confirmation before any potentially incompatible overwrite\n\n### Update / Uninstall\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/susomejias/claude-statusline/main/install.sh | bash -s -- update\ncurl -fsSL https://raw.githubusercontent.com/susomejias/claude-statusline/main/install.sh | bash -s -- uninstall\n```\n\n### Safety behavior\n\n- If `statusLine` already points to another command, the installer asks before replacing it.\n- If `~/.claude/statusline.sh` differs from the incoming script, the installer asks before overwriting it.\n- In non-interactive mode, risky changes require `--yes`.\n- `uninstall` only removes `statusLine` when it points to `~/.claude/statusline.sh`.\n\n### Dependency behavior\n\n- If `jq` is already available in `PATH`, it is reused.\n- If `jq` is not available, installer places it at `~/.claude/bin/jq`.\n- `statusline.sh` automatically falls back to `~/.claude/bin/jq` when global `jq` is not in `PATH`.\n\n### Testing\n\nRun the Bash test suite:\n\n```bash\nchmod +x ./tests/test.sh\n./tests/test.sh\n```\n\nThe suite covers installer safety, `jq` fallback behavior, and the API billing cost display.\n\n### Managed Claude setting\n\nThe installer manages this block in `~/.claude/settings.json`:\n\n```json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"~/.claude/statusline.sh\",\n    \"padding\": 2\n  }\n}\n```\n\nOther settings are preserved.\n\n## How it works\n\nClaude Code pipes a JSON payload to the script on each interaction. The script always reads native fields such as model, context window, session timing, line changes, cost, and tokens.\n\nIf the Claude OAuth token is available in macOS Keychain, it also fetches subscription usage from the Anthropic API and shows current and weekly limits. If that usage data is not available, it falls back to the native cost and token data already present in the Claude Code payload. Results from the usage endpoint are cached for 90 seconds.\n\n## Credits\n\nInspired by [kamranahmedse/claude-statusline](https://github.com/kamranahmedse/claude-statusline).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsusomejias%2Fclaude-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsusomejias%2Fclaude-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsusomejias%2Fclaude-statusline/lists"}