cockpit
A quiet band above the prompt: model, effort, context %, cost, current task and live subagents
What it does
- Draws a band above the prompt
- Adds /cockpit
- Watches tool calls and can refuse them
- Hooks agent.spawn, session.start, turn.complete, turn.step
Good points
- No network calls
- Starts no processes
- Small: 354 lines
- Written in TypeScript
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like cockpit by Fredj Hammami (band), as modscode read it from the mod's code:
// https://modscode.com/gallery/11fred11-cockpit/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text } = $.ui.resolve(e)
const shortModel = '…'
const effort = '…'
const cells = '…'
const cells2 = '…'
const cells3 = '…'
const usd = '…'
const running = '…'
const doing = '…'
const mark = '…'
const type = '…'
const label = '…'
const what = '…'
const fmtTokens = '…'
const fmtElapsed = '…'
const mark2 = '…'
const type2 = '…'
const label2 = '…'
const what2 = '…'
const fmtTokens2 = '…'
const fmtElapsed2 = '…'
const mark3 = '…'
const type3 = '…'
const label3 = '…'
const what3 = '…'
const fmtTokens3 = '…'
const fmtElapsed3 = '…'
return (
<Box flexDirection="column">
<Box gap={2}>
<Text>
<Text bold>
{shortModel}
</Text>
<Text dimColor>
{" · "}
{effort}
</Text>
</Text>
<Text>
<Text dimColor>
{"ctx "}
</Text>
<Text>
{cells}
</Text>
<Text>
{cells2}
</Text>
<Text>
{cells3}
</Text>
<Text dimColor>
▱▱▱▱▱▱▱▱
</Text>
<Text>
{" "}
–
</Text>
</Text>
<Text dimColor>
$
{usd}
</Text>
<Text color="claude">
{running}
{" agent"}
</Text>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{"▸ "}
{doing}
</Text>
</Box>
</Box>
<Box>
<Text>
{mark}
{" "}
</Text>
<Box flexShrink={0}>
<Text wrap="truncate-end">
{type}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{label}
</Text>
</Box>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{what}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtTokens}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtElapsed}
</Text>
</Box>
</Box>
<Box>
<Text>
{mark2}
{" "}
</Text>
<Box flexShrink={0}>
<Text wrap="truncate-end">
{type2}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{label2}
</Text>
</Box>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{what2}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtTokens2}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtElapsed2}
</Text>
</Box>
</Box>
<Box>
<Text>
{mark3}
{" "}
</Text>
<Box flexShrink={0}>
<Text wrap="truncate-end">
{type3}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{label3}
</Text>
</Box>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{what3}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtTokens3}
</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>
{fmtElapsed3}
</Text>
</Box>
</Box>
{await next(e)}
</Box>
)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugins/cockpit/hooks/register.tsx lines 270–353 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const { Box, Text } = $.ui.resolve(e)
const loop = await read($, main)
const current = await read($, task)
const list = await read($, agents)
const u = await read($, usage)
const at = await read($, now)
const isAll = await read($, isExpanded)
const width = e.props.bodyColumns
const shown = list
.filter(a => isAll || a.status === 'running' || (a.endedAt ?? 0) > at - LINGER_MS)
.slice(-MAX_AGENT_ROWS)
const running = list.filter(a => a.status === 'running').length
const pct = u.percent
const limits = ctxLimits(warnAt, dangerAt, u.window)
const runs = pct === undefined ? [] : ctxRuns(pct, limits)
const filled = runs.reduce((n, run) => n + run.cells.length, 0)
const doing = current ?? (e.props.isWorking ? loop.activity : undefined)
const typeWidth = Math.min(16, Math.max(...shown.map(a => a.type.length), 4))
const modelWidth = Math.max(...shown.map(a => shortModel(a.model).length + (a.effort ? a.effort.length + 3 : 0)), 4)
const fixed = 2 + typeWidth + 1 + modelWidth + 1 + 6 + 6 + 4
const textWidth = Math.max(10, width - fixed)
return (
<Box flexDirection="column" width={width}>
<Box gap={2}>
{loop.model && (
<Text>
<Text bold>{shortModel(loop.model)}</Text>
{loop.effort && <Text dimColor> · {loop.effort}</Text>}
</Text>
)}
<Text>
<Text dimColor>ctx </Text>
{runs.map(run => (
<Text color={run.color}>{run.cells}</Text>
))}
<Text dimColor>{'▱'.repeat(CTX_CELLS - filled)}</Text>
<Text color={pct === undefined ? undefined : ctxColor(pct, limits)}> {pct === undefined ? '–' : `${pct}%`}</Text>
</Text>
{u.usd !== undefined && <Text dimColor>${u.usd.toFixed(2)}</Text>}
{running > 0 && <Text color="claude">{running} agent{running === 1 ? '' : 's'}</Text>}
{doing && (
<Box flexShrink={1}>
<Text wrap="truncate-end" dimColor={!current}>▸ {doing}</Text>
</Box>
)}
</Box>
{shown.map(a => {
const isRunning = a.status === 'running'
const mark = isRunning ? '●' : a.status === 'done' ? '✓' : '✗'
const markColor = isRunning ? 'claude' : a.status === 'done' ? 'success' : 'error'
const label = `${shortModel(a.model)}${a.effort ? ` · ${a.effort}` : ''}`
const what = isRunning && a.activity ? `${a.description} — ${a.activity}` : a.description
return (
<Box key={a.id}>
<Text color={markColor}>{mark} </Text>
<Box width={typeWidth + 1} flexShrink={0}>
<Text wrap="truncate-end">{a.type}</Text>
</Box>
<Box width={modelWidth + 1} flexShrink={0}>
<Text dimColor>{label}</Text>
</Box>
<Box width={textWidth} flexShrink={1}>
<Text wrap="truncate-end" dimColor={!isRunning}>{what}</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>{a.tokens ? fmtTokens(a.tokens) : ''}</Text>
</Box>
<Box width={6} flexShrink={0} justifyContent="flex-end">
<Text dimColor>{fmtElapsed((a.endedAt ?? at) - a.startedAt)}</Text>
</Box>
</Box>
)
})}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Fredj Hammami Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
drives Claudetool calls
What its code shows
Read from the source at commit 6e7e025fac71 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugins/cockpit/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.1 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reaches no network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add 11Fred11/fredj-hammami-plugins/plugin install cockpit@fredj-hammamiThis installs the marketplace's latest commit, which may not be the one read here (6e7e025fac71). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "11fred11-cockpit" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Blast RadiusBlast Radius: npm testWould Cancel. Proceed Proceed ProceedProceed 1Cancel 2
-
Ask Claude…Replay TheaterReplay Theater 31 31 31src/app.ts (step 01 of 3)● Write● Write● WritePrev pNext nClose q
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
What it does
- Draws a band above the prompt
- Adds /seo-spend, /seo-doctor, /seo-cockpit
- Watches Agent calls and can refuse them
- Hooks agent.spawn, classic.SessionStart, prompt.submit, session.compact and 3 more
-
could not fill the prompt boxcould not fill:Ask Claude…
-
▴Token OptimizerCheckpointCheckpointCheckpointbuildStart freshbuildStart freshbuildStart freshbuildCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointbuildbuildbuildTokens savedSaved Clean up tokens in 30 days (chat 2 this session)Ask Claude…