ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 alexpeta

cockpit

Claude Code のプロンプト上部に、セッションのモデル、コンテキストウィンドウ、レート制限ウィンドウ、コストを表示し、稼働中の各サブエージェントについて種別、モデル、builder 上限に対するツール呼び出し、実行時間、タスクを 1 行で示す帯を追加します。

alexpeta@alexpeta

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

翻訳済み

この mod について

cockpit は Claude Code のプロンプト上に情報帯を追加します。最初の行にはセッション情報として、モデル、コンテキストウィンドウ、レート制限ウィンドウ、コストを表示します。その下では、稼働中の各サブエージェントが 1 行を使い、種別、モデル、builder 上限に対するツール呼び出し数、実行時間、タスクを示します。完了したエージェントは 1 分間残り、チェックマークが付きます。

インストール(マシンごとに 1 回、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)。警告時に黄色、上限到達時に赤へ変わります。この mod は読み取りと描画だけを行い、ファイル、プロセス、ネットワークの呼び出しを使わず、ツール呼び出しを承認も拒否もしません。状態はセッション内だけに存在し、セッションと /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.

同名の他の作品

関連作品