{"id":50517513,"url":"https://github.com/jimmyolo/cc-statusline","last_synced_at":"2026-06-03T01:02:17.564Z","repository":{"id":358883069,"uuid":"1235224813","full_name":"jimmyolo/cc-statusline","owner":"jimmyolo","description":"Multi-line ANSI statusline renderer for Claude Code — model, cost, context, rate limits, tokens, agents/tools/todos in 3-4 lines","archived":false,"fork":false,"pushed_at":"2026-05-19T12:16:12.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-19T15:11:13.461Z","etag":null,"topics":["bash","claude-code","jq","statusline"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimmyolo.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-11T06:04:24.000Z","updated_at":"2026-05-19T12:16:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jimmyolo/cc-statusline","commit_stats":null,"previous_names":["jimmyolo/cc-statusline"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jimmyolo/cc-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyolo%2Fcc-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyolo%2Fcc-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyolo%2Fcc-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyolo%2Fcc-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimmyolo","download_url":"https://codeload.github.com/jimmyolo/cc-statusline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimmyolo%2Fcc-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33843611,"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-02T02:00:07.132Z","response_time":109,"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":["bash","claude-code","jq","statusline"],"created_at":"2026-06-03T01:02:11.977Z","updated_at":"2026-06-03T01:02:17.538Z","avatar_url":"https://github.com/jimmyolo.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cc-statusline\n\nA multi-line, ANSI-colored statusline renderer for [Claude Code](https://claude.com/claude-code), written in pure `bash` + `jq`. Surfaces model, cost, context, rate limits, token usage, cache hit rate, live agent/tool/todo activity, and the last prompt — all in 3–4 lines.\n\n## Sample output\n\n```\nOpus 4.7 (1M context) (H) 1M v1.2.3 | repo (main) | +42 -7 lines | 3A | NOR\n●●●◐●●●●●● 35% | $1.23 (today $5.67) | 5h 23% (2h 14m) | 7d 57% (5d 8h)\ncache 97% | in: 123.4K out: 7.8K | api wait 30m 00s (50%) | agents 2 reviewer-opus-high,coder-sonnet-max\ntools Read,Bash | todos 3/7 fix smoke test | 14:23 ❯ update README sample output\n```\n\nL3 groups \"session-wide consumption\" (cache, tokens, api wait) plus the active subagent indicator. L4 groups \"live activity \u0026 user intent\" (currently running tools, todo progress, last prompt). Both lines render conditionally — empty fields drop out.\n\nThe `agents …` indicator on L3 is dual-mode: **magenta** while subagent(s) are running (`agents N name1,name2`), **dim** as a fallback showing the most recent subagent_type once they finish — so the field doesn't vanish the moment a subagent completes.\n\n## Requirements\n\n- `bash` 4+\n- `jq`\n- `bc` (for token K/M formatting)\n- `git` (optional — enables branch / repo-link / diff stats)\n- A terminal that renders ANSI color + OSC 8 hyperlinks (most modern terminals do)\n\n## Install\n\n```bash\n# 1. Clone anywhere\ngit clone https://github.com/jimmyolo/cc-statusline.git ~/projects/cc-statusline\n\n# 2. Symlink into ~/.claude/ (or copy — symlink lets `git pull` pick up updates)\nln -s ~/projects/cc-statusline/cc-statusline.sh ~/.claude/cc-statusline.sh\n\n# 3. Wire up in ~/.claude/settings.json\n#    Add (or merge into existing settings):\n#    {\n#      \"statusLine\": {\n#        \"type\": \"command\",\n#        \"command\": \"bash ~/.claude/cc-statusline.sh\"\n#      }\n#    }\n```\n\nStatusline is hot-reloaded — next refresh picks up the new script. No session restart needed.\n\n## Field reference\n\nThe script reads 22 fields from the JSON Claude Code pipes to its `statusLine.command` on stdin. Each field maps to a specific display block:\n\n| Field | JSON path | Displayed in |\n|---|---|---|\n| `MODEL` | `.model.display_name` | L1 model badge |\n| `DIR` | `.workspace.current_dir` | Repo-link basename fallback |\n| `COST` | `.cost.total_cost_usd` | L2 cost + today tracker |\n| `PCT` | `.context_window.used_percentage` | L2 context bar |\n| `CTX_SIZE` | `.context_window.context_window_size` | L1 `1M`/`200K` label |\n| `DURATION_MS` | `.cost.total_duration_ms` | L3 api-wait %, plus disabled blocks |\n| `LINES_ADD` / `LINES_DEL` | `.cost.total_lines_{added,removed}` | L1 `+N -N lines` |\n| `VIM_MODE` | `.vim.mode` | L1 NOR / INS |\n| `VERSION` | `.version` | L1 `vX.Y.Z` |\n| `RATE_5H` / `RATE_7D` | `.rate_limits.{five_hour,seven_day}.used_percentage` | L2 rate-limit % |\n| `RESET_5H` / `RESET_7D` | `.rate_limits.{five_hour,seven_day}.resets_at` | L2 countdown |\n| `TOTAL_IN_TOKENS` / `TOTAL_OUT_TOKENS` | `.context_window.total_{input,output}_tokens` | L3 `in:` / `out:` |\n| `API_DURATION_MS` | `.cost.total_api_duration_ms` | L3 api wait |\n| `CACHE_READ` / `CACHE_CREATE` / `CUR_INPUT` | `.context_window.current_usage.*` | L3 cache hit (cur detail disabled by default) |\n| `SESSION_ID` | `.session_id` | Today-cost tracker + last-prompt lookup |\n| `TRANSCRIPT_PATH` | `.transcript_path` | L3 agents · L4 tools · todos |\n\nThe full mapping (with paired-disable annotations) lives at the top of [`cc-statusline.sh`](cc-statusline.sh).\n\n## Layout\n\n| Line | Contents |\n|---|---|\n| L1 | model · ctx-size · version · repo-link · branch · lines · git-stats · vim |\n| L2 | context-bar · cost (session + today) · 5h limit · 7d limit |\n| L3 | cache-hit · tokens in/out · api wait · agents (magenta=running, dim=last seen) |\n| L4 | running tools · todos (with current task) · last prompt (with `❯` marker) — entire line conditionally rendered |\n\nDisabled by default (one-line uncomment to re-enable — see [Customization](#customization)): per-message duration (`DUR`), tokens-per-minute burn rate, and current-usage detail (`cur N in / N read / N write`).\n\n## Customization\n\nThe script is annotated for surgical edits:\n\n- **Field map at the top** — see which `F[N]` feeds which line.\n- **Inline `# → L\u003cn\u003e` comments** on every variable assignment.\n- **`# INPUTS:` banner** above each `L1`/`L2`/`L3`/`L4` block lists every variable that line consumes.\n- **`Paired-disable note`** above each disabled block (Duration, Burn rate, cur-detail) tells you whether the underlying `F[N]` extraction can be commented out too.\n\nTo disable a display block:\n\n1. Comment out the relevant `L1=`/`L2=`/`L3=`/`L4=` concat line(s).\n2. Check the field map — if any `F[N]` is consumed *only* by what you disabled, comment its extraction too.\n3. Re-run the smoke test (`bash test/smoke.sh`) to confirm no regression.\n\nTo re-enable the bundled disabled blocks (Duration, Burn rate, cur-detail):\n\n1. Uncomment the block body.\n2. For `DUR` / `BURN_PART`: inject the produced variable into the desired `L1`–`L4` line. For `cur-detail`: the block already self-appends to `L3` — just uncomment the four lines in place.\n\n## Testing\n\n```bash\nbash test/smoke.sh\n```\n\nRuns the script against `test/sample.json` and asserts:\n\n- Output contains at least 3 non-empty lines.\n- Output contains expected markers (model name, version, context size, cost).\n- Script does not crash.\n\nThe smoke test is robust to volatile fields (today-cost tracker, countdown timers) by checking for structural markers rather than exact byte equality.\n\n## License\n\n[The Unlicense](LICENSE) — public domain, do whatever.\n\n## Acknowledgements\n\nInspired by `claude-dashboard`'s per-session cost aggregation logic. Layout \u0026 feature set hand-tuned for personal workflow.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmyolo%2Fcc-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimmyolo%2Fcc-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimmyolo%2Fcc-statusline/lists"}