alexpeta/claude-playbook/tree/main/mods/cockpit
cockpit
Claude Code 提示栏上方的一条信息带:显示会话模型、上下文窗口、速率限制窗口和花费;每个运行中的子代理各占一行,显示其类型、模型、相对于 builder 上限的工具调用次数、运行时间和任务。
关于这个 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_CAPandCLAUDE_CALL_CAP_WARN_ATwithhooks/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/cockpitlists 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
$.stateand 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/usagedoes. - 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.
其他同名作品
- cockpitLolerHero · ★ 0
