ModsCode / Claude Code Mods / Ranking / cockpit
cockpit
A denser Claude Code status line and a pane of the files, links and folders this session produced, with a fuzzy filter and four palettes.
What it does
- Draws a pane, toasts
- Adds /files
- Watches Write, Edit calls and can refuse them
- Hooks classic.MessageDisplay, session.start, ui.close, ui.focus
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Has a desktop-specific branch
- Handles errors
Code to start from
A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like cockpit by Julian Hansen (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/lolerhero-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 pane: open it with $.ui.open({ id: 'my-pane', title: "Files" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text } = $.ui.resolve(e)
const i = '…'
const MARK = '…'
const label = '…'
const tail = '…'
const tail2 = '…'
const tail3 = '…'
return (
<Box>
<Box flexDirection="row" columnGap={1}>
<Button plain hotkey={`${i}`} autoFocus>
{`${MARK} ${label}`}
</Button>
<Text italic wrap="truncate-end">
{tail}
</Text>
</Box>
<Box flexDirection="row" columnGap={1}>
<Button plain hotkey={`${i}`} autoFocus>
{`${MARK} ${label}`}
</Button>
<Text italic wrap="truncate-end">
{tail2}
</Text>
</Box>
<Box flexDirection="row" columnGap={1}>
<Button plain hotkey={`${i}`} autoFocus>
{`${MARK} ${label}`}
</Button>
<Text italic wrap="truncate-end">
{tail3}
</Text>
</Box>
<Text>
{" "}
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
const label = '…'
const exitCode = '…'
await $.ui.toast(`could not open ${label} (exit ${exitCode})`)
await $.ui.toast(`could not open ${label}`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
hooks/register.tsx lines 650–809 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
// The pane paints its own ground (Julian 2026-10-04): under a `*-ansi` Claude Code theme the
// dialog takes an ANSI grey from the terminal's scheme, and neither the rows nor the engine's
// blue hotkeys read on it. The palette's base, filling the body; text keeps the terminal's
// foreground. Docked the body is the screen; inline it is what the layout spares.
const ground = { flexDirection: 'column' as const, backgroundColor: BASE, minHeight: e.props?.scroll?.bodyRows }
const all = await stored($)
// Only what is still on disk: a file can be deleted or moved after it was collected, and a
// button that opens nothing reads as the mod being broken rather than as a missing file.
// A link is never checked: there is no disk to ask.
const checked = await Promise.all(
all.map(async entry =>
entry.kind === 'link' || (await $.fs.exists(entry.target).catch(() => false)) ? entry : null,
),
)
const list = checked.filter((entry): entry is Entry => entry !== null)
// The newest entry doubles as the empty check: `noUncheckedIndexedAccess` types it undefined.
const newest = list[list.length - 1]
if (!newest) {
return (
<Box {...ground}>
<Text>Nothing to open yet this session.</Text>
</Box>
)
}
// A page is as long as the body the surface granted, less the hint rows. Docked (fullscreen
// from 110 columns) that is floor to ceiling; inline above the prompt it is what the layout
// spares, which a wrapped prompt shortens. A page taller than the body made the engine scroll
// it: the hint fell off and the arrows scrolled instead of walking.
const body = e.props?.scroll?.bodyRows ?? Infinity
// The Input takes a row off the page while it is up.
// The pages are cut from `pool`: the list newest first, or the matches best first.
const pool = filtering && query ? fuzzy(query, list) : list.slice().reverse()
// Two hint rows only when they cost no entry; tight (inline under a long transcript) the hint is
// one row of keys, o and f first, the walk after them, no prose (Julian 2026-10-04: the walk is
// learned once, o and f are rarer). Hidden Buttons would lose their hotkeys, so the keys stay.
const room = body - (filtering ? 1 : 0)
const hintRows = room - HINT_ROWS >= Math.min(PER_PAGE, Math.max(1, pool.length)) ? HINT_ROWS : 1
const perPage = Math.max(1, Math.min(PER_PAGE, room - hintRows))
const pages = Math.max(1, Math.ceil(pool.length / perPage))
page = Math.min(page, pages - 1) // a file deleted since can shorten the list under us
const shown = pool.slice(page * perPage, (page + 1) * perPage)
const last = shown.length - 1
focused = Math.min(focused, Math.max(0, last)) // a shorter page than the one the ring was on
const lastRow = (p: number) => Math.min(perPage, pool.length - p * perPage) - 1
const startFilter = () => {
filtering = true
query = ''
page = 0
focused = 0
$.ui.invalidate('ui.render')
void $.ui.focus({ requestId: PANE, key: 'q' }).catch(() => null)
}
// j past the last row turns to the next page's first; k before the first, to the previous
// page's last. The list is a ring (Julian, 2026-10-04): past either end it comes round, j
// from the last entry to page 1's first row, k from the first to the last page's last.
const down = () => (focused < last ? go($, page, focused + 1) : go($, (page + 1) % pages, 0))
const up = () => {
const p = focused > 0 ? page : (page - 1 + pages) % pages
return go($, p, focused > 0 ? focused - 1 : lastRow(p))
}
const turn = (to: number) => () => go($, (to + pages) % pages, 0)
// A thing that opened takes the person to another app; the pane closes behind it, so they do
// not come back to a dialog they have to dismiss. A failed open keeps it to pick again.
const open = (entry: Entry) => () =>
openerFor($, entry.target)
.then(cmd => $.process.run(cmd))
.then(r =>
r.exitCode === 0
? $.ui.close({ id: PANE })
: $.ui.toast(`could not open ${entry.label} (exit ${r.exitCode})`),
)
.catch(() => $.ui.toast(`could not open ${entry.label}`))
// `o`: the folder of the focused row — a file's parent, a folder itself; a link has none.
const folderOfRow = () => {
const entry = shown[focused]
if (!entry) return
if (entry.kind === 'link') return $.ui.toast('Links have no folder')
const target = entry.kind === 'folder' ? entry.target : parentOf(entry.target)
return open({ ...entry, target, label: target })()
}
// The field, while filtering. Its text is drawn back on every change, so a redraw (a new
// entry arriving) does not empty it. Enter opens the best match; nothing when there is none.
// Resolved under the surfaces that have an `Input` (mobile does not), as `Image` is below.
let header = null
if (filtering && (e.surface === 'terminal' || e.surface === 'desktop' || e.surface === 'vscode')) {
const { Input } = $.ui.resolve(e)
header = (
<Input
key="q"
label="find"
value={query}
// Short: the hint row says the keys. A long placeholder pushed the Enter label onto a row
// of its own, and the engine's default label `submit` named nothing this field does.
placeholder="type to filter"
submitLabel="open"
autoFocus
onInput={(value: string) => {
query = value
page = 0
focused = 0
$.ui.invalidate('ui.render')
}}
onSubmit={() => (pool[0] ? open(pool[0])() : undefined)}
/>
)
}
let inline = null
// The newest file only, on page 1 only, and not while filtering (the list needs the rows):
// it is what `openPane` asked rows for. Left out when the body cannot hold it under the rows
// and the hint: a row is worth more than a preview.
const roomForImage = body >= shown.length + hintRows + IMAGE_ROWS + 1
if (page === 0 && !filtering && e.surface === 'terminal' && isPng(newest.target) && roomForImage) {
// Resolved here, not above: `Image` exists only in the terminal's element table, and
// narrowing on e.surface is what hands it over. A module has no element globals.
const { Image } = $.ui.resolve(e)
const stat = await $.fs.stat(newest.target).catch(() => null)
if (stat && stat.size <= INLINE_MAX_BYTES) {
const file = await $.fs.read(newest.target, { as: 'bytes' }).catch(() => null)
if (file) {
// A fixed, small box: it is what `openPane` asks rows for, and a terminal cell is about
// twice as tall as wide, so 3 columns a row keeps a screenshot roughly in proportion.
const cols = Math.min(IMAGE_ROWS * 3, Math.max(10, (e.props?.bodyColumns ?? 60) - 2))
inline = (
<Image
source={{ png: file.base64 }} // FsBytes is `{ base64 }`, already encoded
columns={cols}
rows={IMAGE_ROWS}
// The engine draws pixels in kitty and Ghostty only; everywhere else, this.
alt="(image preview needs kitty or Ghostty)"
/>
)
}
}
}
if (!pool.length) {
// A filter that matches nothing: the field stays, so the person can retype or Esc back.
return (
<Box {...ground}>
{header}
<Text>{`No match for ‹${query}›.`}</Text>
</Box>
)
}
return (
<Box {...ground}>
{header}
{shown.map((entry, i) => (
// `autoFocus?: true` is a literal-true type, so `false` is not "off", it is an
// invalid prop — and one invalid prop refuses the WHOLE tree, not just that element.Licence text (MIT)
MIT License Copyright (c) 2026 Julian Hansen 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.
How to build this: Pane (panel), Deny a tool call
What its code calls
runs programswrites filesenv varstool calls
What its code shows
Read from the source at commit 2f1d42fab91b on 2026-10-11. 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.hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.2 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, with its own branch for the desktop |
| 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).hooks/register.tsx:520 uname (not on Windows) |
| 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.hooks/register.tsx:722 a program named at run time |
| Reads and sends | Whether it both reads something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, files, the transcript, but reaches nothing outside |
| 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 |
| Settings hooks | Hooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone |
| Servers it ships | MCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/ |
| Skills, commands, agents | What its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows |
| Tools and MCP | Whether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command |
| Asks of the model | Completions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command files |
| Events it hooks | By what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: command.run (files), tool.call (Write, Edit) · reads: classic.MessageDisplay · also: session.start, ui.render (AbovePrompt, Pane), ui.focus, ui.close · timers: clock.every |
| Reads, by name | The environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: CLAUDE_CONFIG_DIR, USERPROFILE, HOME, OS; files: a path computed at run time; the transcript |
| Writes, by name | The files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.files: …/cockpit/….json, a path computed at run time |
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 its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
From its marketplace
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 LolerHero/claude-cockpit/plugin install cockpit@cockpit/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (2f1d42fab91b). Compare them before you install. /reload-plugins loads it into a session that is already open.
Try the commit ModsCode read
No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:
git clone https://github.com/LolerHero/claude-cockpitgit -C claude-cockpit checkout 2f1d42fab91bb97f8e42309d997a1aa769e0e22bclaude plugin validate claude-cockpitclaude --plugin-dir claude-cockpitThe validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.
Ask Claude about it
With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:
Read the ModsCode mod "lolerhero-cockpit" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- code-modernizationAnthropic★ 37,653
- crit-tuiTomasz Tomczyk★ 1,196
- ai-maestro-secrets23blocks-OS★ 817
- remctlFederico Viticci★ 595
- task-orchestrator-modJeff Picklyk★ 208
- agent-radarHamza Zafar★ 184
Badge for your README
If this is your mod, paste this into your README. It links to this page.
[](https://modscode.com/claude-mods/mods/lolerhero-cockpit/)