{"id":51711913,"url":"https://github.com/jhlee0409/cctreeline","last_synced_at":"2026-07-16T22:31:16.610Z","repository":{"id":367494460,"uuid":"1281053212","full_name":"jhlee0409/cctreeline","owner":"jhlee0409","description":"A Claude Code statusline that surfaces your git worktrees and their open PRs, scoped to this session's edits.","archived":false,"fork":false,"pushed_at":"2026-06-26T08:08:47.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-26T09:16:08.326Z","etag":null,"topics":["anthropic","bash","claude","claude-code","cli","developer-tools","git","git-worktree","statusline","terminal","worktree"],"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/jhlee0409.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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-26T07:24:17.000Z","updated_at":"2026-06-26T08:10:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jhlee0409/cctreeline","commit_stats":null,"previous_names":["jhlee0409/cctreeline"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jhlee0409/cctreeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhlee0409%2Fcctreeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhlee0409%2Fcctreeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhlee0409%2Fcctreeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhlee0409%2Fcctreeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhlee0409","download_url":"https://codeload.github.com/jhlee0409/cctreeline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhlee0409%2Fcctreeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35560451,"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-16T02:00:06.687Z","response_time":83,"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","developer-tools","git","git-worktree","statusline","terminal","worktree"],"created_at":"2026-07-16T22:31:15.965Z","updated_at":"2026-07-16T22:31:16.601Z","avatar_url":"https://github.com/jhlee0409.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cctreeline\n\n[![License: MIT](https://img.shields.io/github/license/jhlee0409/cctreeline)](LICENSE)\n[![shellcheck](https://github.com/jhlee0409/cctreeline/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/jhlee0409/cctreeline/actions/workflows/shellcheck.yml)\n![GitHub stars](https://img.shields.io/github/stars/jhlee0409/cctreeline?style=social)\n\nA [Claude Code](https://claude.com/claude-code) statusline for people who run **multiple git worktrees** and **parallel Claude sessions**.\n\n![cctreeline statusline demo](demo/cctreeline.gif)\n\nMost statuslines tell you about *one* repo. `cctreeline` adds a third line that, for **only the worktrees you actually edited in the current session**, shows each one's open PR numbers — a view nothing else in the ecosystem gives you.\n\n```\n12m · myapp/server · main ⌂main ●3 +1 ↑2 · Opus 4.8 1M · id:a1b2c3d4-e5f6\nctx ███░░░░░░░ 31% · 7d·Opus █████░░░░░ 58% 2d3h · 5h-42% 3h12m\n⎇ feature-auth      PR: #142\n⎇ hotfix-payments   PR: #143 #144\n```\n\n- **Line 1** — session duration · repo-relative path · branch + **worktree badge** (`⌂main` vs `⎇wt(parent)`) + dirty marks (`●` modified, `+` staged, `↑` ahead) · model + **1M-context** badge · session id\n- **Line 2** — context-window gauge · **weekly** limit (auto-binding, per-model scope tag like `7d·Opus`) · **5h** rolling limit, each with a reset countdown\n- **Line 3** — per-worktree open-PR overview, **scoped to the worktrees edited this session**\n\n## Why another statusline?\n\nThere are excellent general-purpose statuslines — [ccstatusline](https://github.com/sirmalloc/ccstatusline), [claude-hud](https://github.com/jarrodwatts/claude-hud), [claude-powerline](https://github.com/Owloops/claude-powerline). `cctreeline` is **not** trying to beat them on breadth, themes, or a config TUI. It does one thing they don't:\n\n\u003e It joins **worktree** (main vs linked + parent repo) × **open PR number** × **files you edited this session**.\n\nIf you run several worktrees in parallel (one per task/PR) and bounce between Claude sessions, line 3 is your at-a-glance \"which of my in-flight branches have PRs, and which did I touch just now.\" If you only ever use one worktree, you don't need this — use ccstatusline.\n\nTwo secondary niceties:\n\n- **No `npx … @latest` in the render hot path.** Pure `bash` + `jq`. The render runs no network, downloads nothing, and pins no moving version — it just reads cache files that refresh in the background. (Some npm-based statuslines re-resolve a package on every frame.)\n- **Auto-binding weekly gauge.** One gauge that picks whichever weekly bucket is currently binding (per `/status`) and labels its model scope — instead of N fixed gauges. *(Caveat: the per-model scope relies on the OAuth usage API returning a `limits[]` array; where it doesn't, cctreeline falls back to a flat `7d` gauge. See [Limitations](#limitations).)*\n\n## Install\n\nRequires `bash`, `jq`, `git`. Optional: `gh` (PR numbers on line 3), `curl` (usage gauges), `timeout`/`gtimeout` from coreutils (bounds the `gh` call; stock on Linux, `brew install coreutils` on macOS — without it the PR fetch runs unbounded).\n\n```bash\ngit clone https://github.com/jhlee0409/cctreeline\ncd cctreeline\nbash install.sh\n```\n\nThe installer auto-detects your OS, date flavor, credential store, and dependencies, then asks **up to four** questions:\n\n1. **Enable 5h / weekly usage gauges?** — reads your Claude credentials (macOS Keychain or `~/.claude/.credentials.json`) and calls `api.anthropic.com`. *(Only asked when credentials **and** `curl` are present; skipped otherwise.)*\n2. **Enable the worktree + PR line?** — needs `gh` for PR numbers.\n3. **Use ASCII glyphs?** — for terminals without box-drawing fonts.\n4. **Compact line 2?** — show only `ctx` + `5h`, hide weekly/output-style.\n\nEverything else is detected. It backs up your `settings.json` and won't overwrite an existing statusline without asking.\n\nNon-interactive (`bash install.sh --defaults`, or any no-TTY run) uses safe defaults and keeps the credential-reading gauge **off** unless you pass `--enable-usage`.\n\n### Manual install\n\n```jsonc\n// ~/.claude/settings.json\n{ \"statusLine\": { \"type\": \"command\", \"command\": \"bash /path/to/cctreeline.sh\" } }\n```\n\n## Configuration\n\n`${XDG_CONFIG_HOME:-~/.config}/cctreeline/config` (shell key=value):\n\n| Key | Values | Default | Meaning |\n|---|---|---|---|\n| `CCTREELINE_USAGE_GAUGES` | `1` / `0` | `1` | Read credentials + show 5h/weekly gauges |\n| `CCTREELINE_WORKTREE_LINE` | `1` / `0` / `auto` | `auto` | Line 3 (`auto` = on inside a git repo) |\n| `CCTREELINE_COLOR` | `auto` / `256` / `none` | `auto` | `auto` honors `NO_COLOR` and `TERM=dumb` |\n| `CCTREELINE_GLYPHS` | `unicode` / `ascii` | `unicode` | Glyph set |\n| `CCTREELINE_DENSITY` | `full` / `compact` | `full` | `compact` = ctx + 5h only |\n| `CCTREELINE_REUSE_HUD_CACHE` | `auto` / `0` | `auto` | Reuse claude-hud's usage cache if present (avoids a duplicate API call) |\n\n## How it works\n\nThe render path (`cctreeline.sh` with no args) only reads stdin JSON and cache files, so it's fast and offline. Two background refreshers keep the caches warm (single-flight locked, TTL'd):\n\n- `cctreeline.sh --refresh-usage` — calls the OAuth usage API, writes `~/.cache/cctreeline/usage.json` (60s TTL)\n- `cctreeline.sh --refresh-worktrees \u003ccwd\u003e` — `git worktree list` + `gh pr list`, writes `~/.cache/cctreeline/worktrees.json` (120s TTL)\n\nYou never invoke these; the render path fires them via `nohup` when a cache goes stale.\n\n## Limitations\n\n- **Per-model weekly scope** depends on the OAuth usage API exposing a `limits[]` array with weekly buckets. On accounts/regions where the endpoint returns only a flat `seven_day` value, the gauge degrades to a plain `7d` (no model tag). This is an undocumented API surface — treat the scope tag as best-effort.\n- **No cost / $ display, no themes, no config TUI.** By design — this is a focused tool, not a framework. If you want those, ccstatusline / claude-powerline are better.\n- The worktree line (line 3) only appears for linked worktrees whose files you **edited this session** (the main repo is excluded). If you have no linked worktrees — or didn't edit any this session — line 3 is simply omitted (not a blank line). It's most useful when you run several worktrees in parallel.\n\n## Uninstall\n\nThe installer touches four places; to fully remove cctreeline:\n\n```bash\n# 1. restore your statusline — either from the timestamped backup the installer made…\nls ~/.claude/settings.json.cctreeline-bak.*        # pick the right one\ncp ~/.claude/settings.json.cctreeline-bak.\u003cepoch\u003e ~/.claude/settings.json\n#    …or, if cctreeline was your only statusline, just drop the key:\n#    jq 'del(.statusLine)' ~/.claude/settings.json | sponge ~/.claude/settings.json\n\n# 2. remove the runtime, config, and cache (respect XDG_*/CLAUDE_CONFIG_DIR if you set them)\nrm -rf \"${XDG_DATA_HOME:-$HOME/.local/share}/cctreeline\" \\\n       \"${XDG_CONFIG_HOME:-$HOME/.config}/cctreeline\" \\\n       \"${XDG_CACHE_HOME:-$HOME/.cache}/cctreeline\"\n```\n\n## Acknowledgements\n\nThe 5h/weekly usage refresh mirrors the OAuth-usage approach of [claude-hud](https://github.com/jarrodwatts/claude-hud) (MIT, by Jarrod Watts), and will reuse its usage cache if present to avoid a duplicate API call. Thanks also to [ccstatusline](https://github.com/sirmalloc/ccstatusline) and [claude-powerline](https://github.com/Owloops/claude-powerline) for charting the Claude Code statusline space.\n\n## Contributing\n\nIssues and PRs welcome — see [CONTRIBUTING.md](CONTRIBUTING.md). Security reports: [SECURITY.md](SECURITY.md).\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhlee0409%2Fcctreeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhlee0409%2Fcctreeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhlee0409%2Fcctreeline/lists"}