modscode / Gallery / flight-deck
flight-deck
Band tracking session tokens, tool calls, model working time and cache countdown, with a pane that shows each subagent's transcript
What it does
- Draws a pane, a band above the prompt
- Adds /agent-log
- Watches tool calls and can refuse them
- Hooks agent.spawn, prompt.submit, session.measure, session.start and 5 more
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- Has a desktop-specific branch
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 flight-deck by bez (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/tunglt1810-flight-deck/
// 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: "Agents" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const cellText = '…'
const cellText2 = '…'
const cellText3 = '…'
const cellText4 = '…'
const cellText5 = '…'
const cellText6 = '…'
const cellText7 = '…'
const cellText8 = '…'
const cellText9 = '…'
const cellText10 = '…'
const cellText11 = '…'
const cellText12 = '…'
const cellText13 = '…'
const cellText14 = '…'
const cellText15 = '…'
const cellText16 = '…'
const cellText17 = '…'
const name = '…'
const cellText18 = '…'
const cellText19 = '…'
const cellText20 = '…'
const cellText21 = '…'
const cellText22 = '…'
const cellText23 = '…'
const cellText24 = '…'
const cellText25 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="column">
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText}
</Text>
</Box>
<Box flexDirection="row" gap={1}>
dash:head:model
dash:head:cost
dash:head:pct
dash:head:time
dash:head:runs
</Box>
<Box flexDirection="row" gap={1}>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText2}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText3}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText4}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText5}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText6}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText7}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText8}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText9}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText10}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText11}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText12}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText13}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText14}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText15}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText16}
</Text>
</Box>
</Box>
<Text dimColor wrap="truncate">
────────
</Text>
</Box>
<Box flexDirection="row" gap={1}>
head:mark
<Box flexShrink={0}>
head:name
</Box>
head:runs
head:time
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0} />
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText17}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain label={`${name}`} />
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText18}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText19}
</Text>
</Box>
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0} />
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText20}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain label={`${name}`} />
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText21}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText22}
</Text>
</Box>
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0} />
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText23}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain label={`${name}`} />
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText24}
</Text>
</Box>
<Box flexShrink={0}>
<Text wrap="truncate">
{cellText25}
</Text>
</Box>
</Box>
</Box>
)
})
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const text = '…'
const text2 = '…'
const text3 = '…'
const text4 = '…'
const text5 = '…'
const text6 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row">
<Text wrap="truncate">
<Text>
{text}
</Text>
<Text>
{text2}
</Text>
<Text>
{text3}
</Text>
</Text>
<Button variant="primary" label={`${text}`} />
<Text wrap="truncate">
<Text>
{text4}
</Text>
<Text>
{text5}
</Text>
<Text>
{text6}
</Text>
</Text>
</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.
mods/flight-deck/hooks/register.tsx lines 633–658 · Pane
on('ui.render', { component: 'Pane', requestId: PANE_ID }, async ($, e) => {
// Only `paneData`, the view and (on the terminal) the spinner are read here: each read
// value redraws the pane when it changes.
isPaneFocused = e.props.isFocused
const id = await $.session.id()
const data = await read($, shownData)
const isCurrent = data.sessionId === id
return (
<AgentPane
ui={$.ui.resolve(e)}
entries={isCurrent ? data.entries : {}}
view={await read($, pane)}
stats={isCurrent ? data.stats : null}
dashboard={isCurrent ? data.dashboard : null}
// Only the terminal reads the spinner: a read value redraws the pane when it changes, and
// a desktop drops a click on a button that a redraw replaced. Its cells are `Client`s.
spin={e.surface === 'terminal' ? await read($, spin) : null}
now={await $.clock.now()}
columns={e.props.bodyColumns}
onOpen={(agentId) => act($, { kind: 'open', agentId })}
onBack={() => act($, { kind: 'back' })}
onWrap={() => act($, { kind: 'wrap' })}
onTool={(toolUseId) => act($, { kind: 'tool', toolUseId })}
/>
)
})mods/flight-deck/src/pane.tsx lines 104–263 · Pane
export const AgentPane = ({
ui,
entries,
view,
stats,
dashboard,
spin,
now,
columns,
onOpen,
onBack,
onWrap,
onTool,
}: Props) => {
const { Box, Text, Button, Code, Markdown } = ui
const viewed = view.agentId
// State of an older shape (a hot reload) has no flag: the rows are cut then.
const isWrapped = view.isWrapped === true
const codeWrap = isWrapped ? 'wrap' : 'truncate-end'
const isClient = spin === null && 'Client' in ui
const cell = (key: string, c: Cell) =>
isClient ? (
<ui.Client
key={key}
module="./cellClient.tsx"
props={c}
width={c.width ?? cellText(c, 0, now).length}
height={1}
/>
) : (
<Box key={key} flexShrink={0} {...(c.width === undefined ? {} : { width: c.width })}>
<Text
wrap="truncate"
{...(c.color === undefined ? {} : { color: c.color })}
{...(c.dim === true ? { dimColor: true } : {})}
{...(c.bold === true ? { bold: true } : {})}
>
{cellText(c, spin ?? 0, now)}
</Text>
</Box>
)
if (viewed === null) {
const head = (key: string, text: string, width: number, align?: 'right') =>
cell(key, { text, dim: true, width, ...(align === undefined ? {} : { align }) })
const rule = (key: string) => (
<Text key={key} dimColor wrap="truncate">
{'─'.repeat(Math.max(0, columns))}
</Text>
)
// The dashboard: the session's cost, then per model an estimated cost (≈), its share of
// the total (colored by its size), the working time and the runs of its agents.
const board = () => {
if (dashboard === null) return null
const MODEL = Math.min(MAX_MODEL, Math.max(5, ...dashboard.rows.map((r) => r.model.length)))
return (
<Box key="dashboard" flexDirection="column">
{cell('cost', { text: `total ≈$${formatUsd(dashboard.costUsd)}`, bold: true })}
{dashboard.rows.length > 0 && (
<Box key="dash:head" flexDirection="row" gap={1}>
{head('dash:head:model', 'model', MODEL)}
{head('dash:head:cost', 'cost($)', USD_WIDTH, 'right')}
{head('dash:head:pct', 'cost(%)', PCT_WIDTH, 'right')}
{head('dash:head:time', 'time', TIME_WIDTH, 'right')}
{head('dash:head:runs', 'runs', RUNS_WIDTH, 'right')}
</Box>
)}
{dashboard.rows.map((r) => {
const pct = sharePct(r.costUsd, dashboard.costUsd)
return (
<Box key={`dash:${r.model}`} flexDirection="row" gap={1}>
{cell(`dash:model:${r.model}`, { text: cut(r.model, MODEL), width: MODEL })}
{cell(`dash:cost:${r.model}`, {
text: r.costUsd === null ? '—' : `≈${formatUsd(r.costUsd)}`,
width: USD_WIDTH,
align: 'right',
})}
{cell(`dash:pct:${r.model}`, {
text: pct === null ? '' : `${pct}%`,
...(pct === null ? {} : { color: shareColor(pct) }),
width: PCT_WIDTH,
align: 'right',
})}
{cell(`dash:time:${r.model}`, {
text: r.model === SIDE ? '' : formatDuration(r.workMs),
dim: true,
width: TIME_WIDTH,
align: 'right',
})}
{cell(`dash:runs:${r.model}`, {
text: r.model === SIDE ? '' : runsText(r),
dim: true,
width: RUNS_WIDTH,
align: 'right',
})}
</Box>
)
})}
{rule('dash:rule')}
</Box>
)
}
const rows = treeRows(entries)
if (rows.length === 0)
return (
<Box flexDirection="column">
{board()}
<Text dimColor>No agents yet.</Text>
</Box>
)
const t = agentTable(
rows.map((r) => r.agent),
columns,
)
return (
<Box flexDirection="column">
{board()}
<Box key="head" flexDirection="row" gap={1}>
{/* Built as a row is, a mark and a box of the name's width: a desktop sizes a box
and a cell in different units, so only the same parts line up. */}
{head('head:mark', '', MARK_WIDTH)}
<Box key="head:namebox" width={t.name} flexShrink={0}>
{head('head:name', 'agents', t.name)}
</Box>
{head('head:runs', 'runs', t.runs, 'right')}
{head('head:time', 'time', t.time, 'right')}
</Box>
{rows.map(({ agent, depth }) => {
const recent = recency(agent, now)
const tone: Tone = recent === 'old' ? { dim: true } : { color: RECENCY_TONE[recent] }
return (
// A Button takes no color: the status is the colored mark before it, and an ended
// agent's row is dim at rest. The runs and the time take the color of the recency.
<Box key={`row:${agent.id}`} flexDirection="row" alignItems="center" gap={1}>
{depth > 0 && <Box key={`indent:${agent.id}`} width={depth * 2 - 1} flexShrink={0} />}
{cell(`mark:${agent.id}`, agentMark(agent))}
<Box key={`name:${agent.id}`} width={t.name - depth * 2} flexShrink={0}>
<Button
key={`agent:${agent.id}`}
plain
{...(agent.status === 'running' ? {} : { dimColor: true })}
label={cut(name(agent), t.name - depth * 2)}
onPress={() => onOpen(agent.id)}
/>
</Box>
{cell(`runs:${agent.id}`, {
text: String(agent.runs),
...tone,
width: t.runs,
align: 'right',
})}
{cell(`time:${agent.id}`, timeCell(agent, now, 'right', tone, ''))}
</Box>
)
})}
</Box>
)
}
mods/flight-deck/hooks/register.tsx lines 660–691 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const session = await currentMeter($)
const now = (await read($, nowAtom)) || (await $.clock.now())
const tweens = await read($, shown)
// An agent's transcript is on screen: draw that agent's numbers, which are not animated.
const isPaneOpen = (await read($, pane)).isOpen
const viewed = e.props.view.agentId
const snap = viewed === undefined ? session : agentView(session, viewed)
const reg = viewed === undefined ? null : await read($, agents)
const model = modelLabel(viewed === undefined ? undefined : reg?.entries[viewed])
const ttls = (await read($, ttlsAtom)) ?? cacheTtls({}, options.cacheTtl)
return (
<Band
ui={$.ui.resolve(e)}
snap={snap}
shown={
viewed === undefined && tweens.sessionId === session.sessionId
? shownAt(tweens, now)
: undefined
}
isAgentView={viewed !== undefined}
{...(model === undefined ? {} : { model })}
busySince={session.busySince}
now={now}
ttl={viewed === undefined ? ttls.main : ttls.agent}
columns={e.props.bodyColumns ?? 120}
isPaneOpen={isPaneOpen}
onToggle={() => togglePane($)}
/>
)
})mods/flight-deck/src/band.tsx lines 26–70 · Band
export const Band = ({
ui,
snap,
shown,
busySince,
now,
ttl,
columns,
isAgentView,
model,
isPaneOpen,
onToggle,
}: Props) => {
const { Box, Text, Button } = ui
const segments = bandSegments({
snap,
shown,
busySince,
now,
ttl,
columns,
isAgentView,
isPaneOpen,
...(model === undefined ? {} : { model }),
})
const run = (segs: Segment[], key: string) => (
<Text key={key} wrap="truncate">
{segs.map((s, i) => (
<Text key={String(i)} color={s.color} bold={s.bold} inverse={s.inverse}>
{s.text}
</Text>
))}
</Text>
)
const at = segments.findIndex((s) => s.isButton)
const button = segments[at]
if (button === undefined) return run(segments, 'all')
return (
<Box flexDirection="row">
{run(segments.slice(0, at), 'before')}
<Button key="agents" variant="primary" label={button.text} onPress={onToggle} />
{run(segments.slice(at + 1), 'after')}
</Box>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 bez 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
env varsdrives Claudetool callsremembers
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit 8627045db44c 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.mods/flight-deck/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.26 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.its repository's .claude-plugin/marketplace.json does not list it: no install line to give |
| 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's .claude-plugin/marketplace.json does not list it, so there is no install line to give. Read it as code, or follow its author's README.
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 "tunglt1810-flight-deck" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Ask Claude…
-
Ask Claude…Temper Run◈ TemperIntentUntitled runAcceptance criteria (what must be true) · 3 of 3 metNo criteria found in intent.md.✔ Walk through✔ Walk through✔ Walk throughand 3 more. Open the pane in a wider terminal.Phase · DiscussFix login · paused● build● build● build✓ done ● you are here ○ upcoming ↺ redo14:32Teach meTimeline, oldest firstCheckCheckCheckOpen findings · 3#a1b2c3d high: ResumeFixAccept with reasonExplain#a1b2c3d high: ResumeFixAccept with reasonExplain#a1b2c3d high: ResumeFixAccept with reasonExplainMore actions. Press the number shown.K build K PlanK build K PlanK build K Plan0 Fewer actions 0 Show or hide the other actions.8 Close the game 8 A small game for the wait.
-
Ask Claude…Mod controlsLive Claude ModCount: 0 / Initial / oneAdd oneName InitialOne**Markdown** with a [link](https://example.com)
const count = 1;
./counter.tsxFill composerAppend noteSuggest draftCopy text -
Ask Claude…Agents●●●✻ AgentsEditNo agents yet. They show here while they run.Agent──Fix login────────● build ········━━━━━━━━········2h 10m● build ········━━━━━━━━········2h 10m● build ········━━━━━━━━········2h 10m✗ Grepclick an agent to open it · click "done" to hide finished ones
-
Ask Claude…Workers▾ main a1b2c3d · ok · preview Workers/WorkersDoneWorkersDoneDoneDoneDoneDoneDoneDoneDoneDonelast 3 runs · line = load · red = retry· Workers· Workers· Workers▾ Fix loginNeeds youNeeds youbuildbuildbuildbuildbuildbuildbuildbuildbuildDoneDoneDoneno dataDoneDoneDoneDoneDoneDoneDoneDoneDone▾ Fix loginNeeds youNeeds youbuildbuildbuildbuildbuildbuildbuildbuildbuildDoneDoneDoneno dataDoneDoneDoneDoneDoneDoneDoneDoneDone▾ Fix loginNeeds youNeeds youbuildbuildbuildbuildbuildbuildbuildbuildbuildDoneDoneDoneno dataDoneDoneDoneDoneDoneDoneDoneDoneDoneNeeds you⋯#3 Fix login ok ⚡ conflict#3 Fix login ok ⚡ conflict#3 Fix login ok ⚡ conflict
-
Ask Claude…Pick a look for builddraw your own with /familiar draw. esc closes●●●●●●●●●clawd 3●●●●●●●●●clawd 3●●●●●●●●●clawd 3