ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by alexpeta

cockpit

A band above the Claude Code prompt: session model, context window, rate-limit windows, and cost, plus one row per live subagent with its type, model, tool calls against the builder cap, runtime and task.

alexpeta@alexpeta

alexpeta/claude-playbook/tree/main/mods/cockpit

Translated

About this mod

cockpit 在 Claude Code 提示列上方加入一條資訊帶。第一行顯示工作階段資訊:模型、上下文視窗、速率限制視窗與花費;其下方每個執行中的子代理各佔一列,顯示類型、模型、工具呼叫次數(針對 builder 上限)、執行時間與任務,完成的代理會保留一分鐘並加上勾選標記。

安裝方式(每台機器一次,從 playbook 的 clone 執行):

claude plugin marketplace add ~/Github/claude-playbook
claude plugin install cockpit@claude-playbook

需要 Claude Code 2.1.287 或更新版本,可在 /plugin 的 Installed 分頁關閉。

設計重點:上限是鏡射而非強制,builder 計數讀取 CLAUDE_CALL_CAP_AGENTS、CLAUDE_CALL_CAP 與 CLAUDE_CALL_CAP_WARN_AT(預設 builder、400、360),計數會在警告時轉黃、達上限時轉紅。此外掛只讀取與繪製,不使用檔案、程序或網路呼叫,也不會核准或拒絕工具呼叫;狀態為工作階段本地,會隨工作階段與 /clear 結束。Claude Code 未回報的數值會留空而非顯示為零,顏色採用 Claude Code 自身的主題鍵。顯示寬度會決定細節層級:130 欄以上顯示所有計量與上下文走勢圖,90 欄以上顯示上下文與 builder 計量,低於 90 欄僅顯示數字。

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add alexpeta/claude-playbook
claude plugin install cockpit
Original text / README

cockpit

A band above the Claude Code prompt. The first line is the session: its model, the context window, the rate-limit windows and what the session has cost. Under it, one row per live subagent: its type, its model, its tool calls (against the builder cap, for the builder type), how long it has run, and its task. A finished agent keeps its row for a minute, with a tick.

✻ Opus 5.5   ctx ━━━━━━━━━╸━━━━━━ 62% 124k/200k ▁▂▃▅▆   5h ━━━╸━━━━ 41% ↻2h10m   $3.10
  ├─ ⠹ builder  Opus 5.5   ━━━━━━━━╸━━━━━━━ 212/400     34m  slice-a
  └─ ✓ Explore  Haiku 4.5  17 calls                     <1m  list the decisions

Install

Once per machine, from the playbook's clone (the marketplace reads the plugin in place, so a git pull is the update, from the next session start):

claude plugin marketplace add ~/Github/claude-playbook
claude plugin install cockpit@claude-playbook

Mods need Claude Code 2.1.287 or later. Turn it off in /plugin, Installed tab.

What it reads, and what it never does

  • The cap is mirrored, not enforced. The builder count reads CLAUDE_CALL_CAP_AGENTS, CLAUDE_CALL_CAP and CLAUDE_CALL_CAP_WARN_AT with hooks/call-cap.py's defaults (builder, 400, 360): the band shows the count, the hook stops the build. The count turns from green to yellow at the warning and red at the cap.
  • It only reads and draws. claude plugin validate mods/cockpit lists its calls: the session's usage and model, the agent list, the clock, those three variables, its own state, and drawing. No file, process or network call, and it never approves or refuses a tool call.
  • Its state is session-local. The counts live in $.state and die with the session (and with /clear, after which the figures are read again). The durable record of a build is the call-cap hook's ledger.
  • A figure Claude Code does not report is left out, never zeroed: no context fill before the first response, no rate limits off a subscription. An agent that started before the band loaded is named with no model or count.
  • Colours are Claude Code's own theme keys (claude, permission, rate_limit_fill, success, warning, error, subtle, and the subagent palette), read off the 2.1.289 binary's theme tables, so the band follows the person's theme as /usage does.
  • Width decides the detail. From 130 columns: every meter and the context sparkline (the fill after each turn, so a compaction shows as a drop). From 90: the context and builder meters. Below 90: the numbers.

Develop

claude --plugin-dir mods/cockpit        # loads it for one session, reloads on save
claude plugin validate mods/cockpit
claude plugin test mods/cockpit         # 7 tests, terminal and desktop surfaces
tsc -p mods/cockpit                     # once Claude Code has loaded it: it writes the tsconfig

The tests were mutation-checked on 2026-10-04: twelve deliberate breaks (the count, the warning and cap thresholds, the finished-agent window, the context colour, the reset clock, the width tiers, the sparkline's scale and history, the capped type) each turned a test red.

Other works with the same name

Similar projects