A portable, two-line statusline for AI CLIs. Shows model, context usage with tokens remaining, API-estimated costs, and Claude.ai rate-limit quotas with reset times.
Plain-text version of the same output (handy for copy/paste, terminal previews):
dir: statusline | branch: main | think:medium
context: 20% (205K/1.0M, 794K left) | π€ Opus 4.7 | π° API-est: $14.13 session / $0.00 today / $25.52 block (2h 34m left) | π₯ $15.96/hr | 5h quota: 25% | 7d quota: 14%
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bashThe bootstrap clones the repo into ~/.local/share/kinncj-statusline and runs the installer for every supported CLI it finds on $PATH. To pass flags through to the installer:
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --dry-run
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --target claude-code
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --uninstallOverride defaults via env: STATUSLINE_REPO=owner/fork STATUSLINE_REF=v1.2.3 STATUSLINE_DIR=~/elsewhere curl β¦ | bash.
git clone https://github.com/kinncj/statusline ~/Development/kinncj/statusline
cd ~/Development/kinncj/statusline
./install.sh # auto-detect all supported CLIs on $PATH
./install.sh --target opencode # one specific tool, repeatable
./install.sh --dry-run # preview without changing anything
./install.sh --uninstall # remove statusline wiring
./install.sh --no-animation # skip the animated intro (also: NO_COLOR=1, TUI_NO_ANIM=1)
./install.sh --quiet # suppress the logo entirelyThe installer renders a boxed, animated TUI by default. Animations auto-disable when stdout isn't a TTY (CI, pipes), and color follows NO_COLOR.
| Tool | Statusline | AGENTS.md | Config path |
|---|---|---|---|
| Claude Code | β | β | ~/.claude/settings.json |
| GitHub Copilot CLI | β | β | ~/.copilot/config.json (requires experimental: true, which the installer sets) |
| OpenCode | β upstream | β | ~/.config/opencode/opencode.json β feature not yet shipped by opencode; tracked at anomalyco/opencode#8619. Installer writes the proposed schema speculatively so a future ship auto-activates; today, opencode's built-in footer is what renders. |
| Pi (pi.dev) | β | β | ~/.pi/agent/extensions/kinncj-statusline/ (native Pi extension; auto-discovered, no settings to edit) |
| Hermes (nousresearch) | β | β + skill | ~/.hermes/ (full TUI, no script hook) |
- Pi is wired via a native extension (
extensions/pi/statusline.mjs) that Pi auto-discovers from~/.pi/agent/extensions/. The extension bridges Pi's session context (ctx.cwd,ctx.model,ctx.getContextUsage()) into the samestatusline.shwe use everywhere else and renders the output as a widget below the editor. Pi's own native footer stays as-is, so you get both lines. - Hermes ships a fixed built-in TUI with skin-level theming only and no extension point. We install AGENTS.md + the
statusline-editskill so the repo's instructions travel with you.
OpenCode has no statusline hook in 1.14.48 β verified against the binary's full plugin event list (chat.*, tool.execute.*, permission.ask, etc., all behavioral, none render). The feature is tracked upstream at anomalyco/opencode#8619 β still open. The installer prints a clear "pending upstream" warning, drops our statusline.sh into the config dir, and writes both proposed key shapes (statusline.command and experimental.statusline.command) into opencode.json so whichever the upstream merge picks will auto-activate without a re-install. Until then, opencode's built-in footer is what you see and our script sits idle. Building a plugin against today's API doesn't help β the only display surface is chat.message, which costs context tokens (the exact problem #8619 was filed to fix).
The full set of segments, in order; what actually renders depends on what the host pipes in (missing fields just silently drop):
context: N%of the context window, with(used/total, remaining)in human units. On Copilot CLI's auto-routed free models the primary fields gonullβ the statusline falls back tocurrent_context_used_percentage/displayed_context_limitso the block keeps rendering.- Cost cluster (Claude path, via
ccusage):π€model nameπ° API-est:session / today / billing-block costs β API list-price estimates, not what Claude.ai Pro/Max subscribers actually payπ₯ $X/hrburn rate
- Cost cluster (Copilot path, native fields):
π° N.N reqs Β· +A/-R Β· api N.Nsfromcost.total_premium_requests(fractional units, not an integer count),total_lines_added/removed, andtotal_api_duration_ms. Activates only whenccusagedidn't (Claude payloads never trigger it). 5h quota/7d quotapercentage and reset countdown (Claude.ai subscriber data only β Copilot's "Remaining reqs." native footer isn't exposed to thestatusLinehook).session: Nmwall time. Copilot supplies authoritativecost.total_duration_ms; Claude falls back totranscript_pathmtime.
The host-specific field map and the exact fallback chain live in AGENTS.md.
bash,jq,awk,sed,date,stat,gitnpx(for ccusage β optional; the cost block is skipped if unavailable)
Read AGENTS.md β it has the conventions, the bash gotchas, the host JSON schemas, and the test recipe. Mock fixtures live in tests/.
If you're an AI agent working in this repo (Claude Code, OpenCode, etc.), AGENTS.md is loaded automatically. The .claude/ and .opencode/ directories also contain in-repo agent definitions for testing and safe-edit workflows.
tests/run.sh # full bats suite (install bats first)
tests/run.sh claude-code # filter by nameSee AGENTS.md for the full recipe (mock fixtures, ccusage stub, etc.).
- Changelog β release notes per version.
- Contributing β how to send a patch and the bar it has to clear.
- Code of Conduct β Contributor Covenant 2.1.
- Security β how to report a vulnerability (don't open a public issue).
- Authors β maintainer + contributor credits.
Copyright Β© 2026 Kinn Coelho Juliao <kinncj@protonmail.com>
Released under the GNU General Public License v3.0 or later (SPDX-License-Identifier: GPL-3.0-or-later). You may use, modify, and redistribute this code β provided any derivative works stay under a GPL-compatible license. The full license text lives in LICENSE; each source file carries an SPDX header for unambiguous attribution.
