{"id":51675792,"url":"https://github.com/momenbasel/claude-code-statusline","last_synced_at":"2026-07-15T05:34:17.559Z","repository":{"id":370005896,"uuid":"1277238260","full_name":"momenbasel/claude-code-statusline","owner":"momenbasel","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-22T17:57:16.000Z","size":9,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-07T22:22:08.057Z","etag":null,"topics":[],"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/momenbasel.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-06-22T17:57:13.000Z","updated_at":"2026-07-01T16:17:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/momenbasel/claude-code-statusline","commit_stats":null,"previous_names":["momenbasel/claude-code-statusline"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/momenbasel/claude-code-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momenbasel%2Fclaude-code-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momenbasel%2Fclaude-code-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momenbasel%2Fclaude-code-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momenbasel%2Fclaude-code-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/momenbasel","download_url":"https://codeload.github.com/momenbasel/claude-code-statusline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/momenbasel%2Fclaude-code-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35493169,"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-07-15T02:00:06.706Z","response_time":131,"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":[],"created_at":"2026-07-15T05:34:16.937Z","updated_at":"2026-07-15T05:34:17.545Z","avatar_url":"https://github.com/momenbasel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Code Statusline\n\nA single-line [Claude Code](https://docs.anthropic.com/en/docs/claude-code) statusline:\nagnoster-style powerline segments, per-account identity, a Pac-Man context-window\nmuncher, and a live rate-limit gauge. Pure `bash` + `jq`, no dependencies to build.\n\n```\n  you   MAX 20×  ✦ Opus 4.8   ~/projects/acme-api   main *3 ↑1   ᗧ········•••••• 42% 84k/200k   5h 65% · 7d 88%\n└ account └ plan  └ model      └ path                 └ git        └ context gauge              └ usage limits\n```\n\nEach `` is a powerline separator and each leading icon is a Nerd Font glyph — the\nline above is the plain-text skeleton; on a real terminal with a Nerd Font it renders\nas solid colored segments with arrows and icons.\n\n## Features\n\n- **Powerline segments** — account · org · plan · model · path · git · context · limits, each on its own colored block with agnoster arrows.\n- **Per-account identity** — reads the *active* account from `~/.claude.json` (respects `CLAUDE_CONFIG_DIR`), so the badge follows whichever account/org/plan you're logged into. Team/Enterprise orgs get an org badge; personal accounts stay clean.\n- **Pac-Man context muncher** — the gauge eats food dots as the context window fills; turns green → amber → red under pressure, with a blinking ghost. Animates while Claude is working (needs `gdate`).\n- **Live rate-limit gauge** — 5-hour and 7-day remaining %, color-coded, straight from the payload Claude Code sends.\n- **Git segment** — branch, dirty count `*N`, ahead `↑N` / behind `↓N` vs upstream.\n- **Two styles** — `powerline` (Nerd Font) or `plain` (no special glyphs, works in any font).\n- **ASCII-safe source** — all glyphs are built with `printf '\\xNN'`, so the script survives copy/paste, gists, and git without losing its icons.\n\n## Requirements\n\n- `bash` and [`jq`](https://jqlang.github.io/jq/) (`brew install jq`)\n- A **Nerd Font** for the `powerline` style — install one from [nerdfonts.com](https://www.nerdfonts.com) and select it in your terminal. (Or set `STYLE=plain` and skip this.)\n- *Optional:* `coreutils` for `gdate` (`brew install coreutils`) — enables the smooth muncher animation. Without it the bar still works, just doesn't animate.\n\n## Install\n\n```bash\ngit clone https://github.com/momenbasel/claude-code-statusline.git\ncd claude-code-statusline\n./install.sh\n```\n\n`install.sh` copies `statusline.sh` to `~/.claude/scripts/` and sets `.statusLine` in\n`~/.claude/settings.json` (backing up the old file first). Open a new Claude Code\nsession and it appears.\n\n**Manual install** — copy `statusline.sh` anywhere and point Claude Code at it:\n\n```jsonc\n// ~/.claude/settings.json\n{\n  \"statusLine\": { \"type\": \"command\", \"command\": \"~/.claude/scripts/statusline.sh\" }\n}\n```\n\n## Preview\n\nSee it without launching Claude Code (renders at several fill levels):\n\n```bash\n./demo.sh\n```\n\n## Configuration\n\nToggles live at the top of `statusline.sh`:\n\n| Variable        | Default      | What it does                                                        |\n|-----------------|--------------|---------------------------------------------------------------------|\n| `STYLE`         | `powerline`  | `powerline` (Nerd Font) or `plain` (no special glyphs)              |\n| `GAUGE`         | `pacman`     | `pacman` muncher or a `bar` (▰▱) meter                               |\n| `GAUGE_W`       | `20`         | gauge width in cells — wider = finer resolution / more food dots    |\n| `ANIM`          | `1`          | animate the muncher while Claude re-renders (needs `gdate`)         |\n| `LOGOS`         | `1`          | show org / plan / folder icons                                      |\n| `SHOW_ACCOUNT`  | `1`          | show the account + org + plan badge                                 |\n| `SHOW_LIMITS`   | `1`          | show 5h + 7d usage remaining                                        |\n| `SHOW_LAST_MSG` | `0`          | echo your last prompt on a second line                              |\n| `ACCOUNT`       | `\"\"`         | override the account name (empty = auto-detect)                     |\n| `ORG_OVERRIDE`  | `\"\"`         | override the org badge (empty = auto-detect)                        |\n| `FRAME_MS`      | `180`        | muncher chomp period in ms                                          |\n| `BAR_DEBUG`     | `0`          | tee the stdin payload to `/tmp/cc-bar-input.json` for debugging     |\n\n### Custom glyph for a specific org\n\nThe org badge is data-driven — any org auto-detected from `~/.claude.json` gets a\ngeneric building glyph plus its name. To give one org a custom icon, add a `case`\nin the `LOGOS` block (search for `olog=`):\n\n```bash\ncase \"$org\" in\n  ACME)  olog=$(printf '\\xee\\x9c\\xa2') ;;   # any Nerd Font codepoint, as UTF-8 hex\nesac\n```\n\n## Troubleshooting\n\n- **Boxes / blank squares instead of icons** → your terminal font isn't a Nerd Font. Install one and select it, or set `STYLE=plain`.\n- **No 5h / 7d limits** → your Claude Code build doesn't send `rate_limits` in the payload; the segment hides itself automatically.\n- **Muncher doesn't animate** → install `coreutils` for `gdate` (`brew install coreutils`). Animation also only advances while Claude is actively re-rendering.\n- **Wrong account shown** → the bar follows the active account in `$CLAUDE_CONFIG_DIR/.claude.json` (falling back to `~/.claude.json`). Set `ACCOUNT`/`ORG_OVERRIDE` to pin them.\n\n## How it works\n\nClaude Code pipes a JSON payload to the statusline command on stdin (model, cwd,\ncontext window usage, rate limits, transcript path). The script parses it in a single\n`jq` pass and renders one ANSI line. Context % comes from the payload when present, or\nis reconstructed from the transcript tail as a fallback.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomenbasel%2Fclaude-code-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmomenbasel%2Fclaude-code-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmomenbasel%2Fclaude-code-statusline/lists"}