ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 alexpeta

cockpit

Claude Code 提示列上方的一條資訊帶:顯示工作階段模型、上下文視窗、速率限制視窗和花費;每個執行中的子代理各佔一列,顯示類型、模型、相對於 builder 上限的工具呼叫次數、執行時間和任務。

alexpeta@alexpeta

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

已翻譯

關於這個 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 欄僅顯示數字。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add alexpeta/claude-playbook
claude plugin install cockpit
原文 / 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.

其他同名作品

更多類似作品