ModsCode / Claude Code Mods / Ranking / 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
- Adds /agent-log
- Watches SendMessage calls and can refuse them
- Hooks agent.spawn, prompt.compose, prompt.context, prompt.submit and 11 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
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 flight-deck by bez (pane, band), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/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: "🤖 Flight Deck" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text } = $.ui.resolve(e)
const cellText = '…'
const text = '…'
const text2 = '…'
const text3 = '…'
const label = '…'
const name = '…'
const i = '…'
const cellText2 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" gap={1}>
<Button label="← agents" />
ctx:title
<Box>
<Text wrap="truncate">
{cellText}
</Text>
</Box>
<Button label="recount" />
</Box>
<Box flexDirection="column">
ctx:head
<Box height={1} flexShrink={1} overflow="hidden">
<Text wrap="truncate">
<Text>
{text}
</Text>
<Text>
{text2}
</Text>
<Text>
{text3}
</Text>
</Text>
</Box>
<Box height={1} overflow="hidden">
<Text dimColor>
────────
</Text>
</Box>
ovh:head
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
head:tokens
head:share
head:carry
</Box>
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain label={`${label}`} />
</Box>
{`catnum:tokens:${name}`}
{`catnum:share:${name}`}
{`catnum:carry:${name}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain label={`${label}`} />
</Box>
{`catnum:tokens:${name}`}
{`catnum:share:${name}`}
{`catnum:carry:${name}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain label={`${label}`} />
</Box>
{`catnum:tokens:${name}`}
{`catnum:share:${name}`}
{`catnum:carry:${name}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Box flexShrink={0}>
<Button plain dimColor label="" />
</Box>
{`itemnum:${name}:${i}`}
</Box>
</Box>
<Box flexDirection="column">
<Box height={1} overflow="hidden">
<Text dimColor>
────────
</Text>
</Box>
<Box>
<Text wrap="truncate">
{cellText2}
</Text>
</Box>
<Box flexDirection="row" gap={1}>
dead:head:server
dead:head:tools
dead:head:tokens
</Box>
<Box flexDirection="row" gap={1}>
{`dead:name:${name}`}
{`dead:tools:${name}`}
{`dead:tokens:${name}`}
</Box>
<Box flexDirection="row" gap={1}>
{`dead:name:${name}`}
{`dead:tools:${name}`}
{`dead:tokens:${name}`}
</Box>
<Box flexDirection="row" gap={1}>
{`dead:name:${name}`}
{`dead:tools:${name}`}
{`dead:tokens:${name}`}
</Box>
</Box>
</Box>
</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 1383–1466 · 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
// Only the terminal draws the costs on each frame. `now` is read while a cost runs, so the
// frame tick draws the pane again; a pane at rest does not read it.
const now = await $.clock.now()
const costs = e.surface === 'terminal' ? await read($, paneShown) : null
if (costs !== null && !isNamedSettled(costs, now)) await read($, nowAtom)
// The terminal's pane has no margin and no title of its own: a cell of padding at each
// side, and the title as the first row.
const ui = $.ui.resolve(e)
const pad = e.surface === 'terminal' ? 1 : 0
// The rows above the pane body on the terminal: the title and the empty row below it.
const above = e.surface === 'terminal' ? TITLE_ROWS : 0
// The offset of a scroll event is newer than the pane's own until the engine gives the
// pane another offset: that one is then the newest (the window can move with no event).
const asked = await read($, paneScroll)
const offset =
asked !== null && asked.seen === e.props.scroll.offset ? asked.offset : e.props.scroll.offset
drawnOffset = e.props.scroll.offset
isPaneOnTerminal = e.surface === 'terminal'
// After this hook returns its drawing: a scroll that waits for it goes on.
const drawn = onPaneDrawn
if (drawn !== null) setTimeout(drawn, 0)
const body = (
<AgentPane
ui={ui}
entries={isCurrent ? data.entries : {}}
view={await read($, pane)}
stats={isCurrent ? data.stats : null}
dashboard={isCurrent ? data.dashboard : null}
// State of an older shape (a hot reload) has no context.
context={isCurrent ? (data.context ?? null) : null}
// State of an older shape (a hot reload) has no breaks.
breaks={isCurrent ? (data.breaks ?? null) : null}
{...(costs !== null && costs.sessionId === id ? { shownUsd: namedAt(costs, now) } : {})}
// 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}
holdsText={holdsText((await $.session.version()).base)}
now={now}
columns={e.props.bodyColumns - pad * 2}
scrollTop={e.surface === 'terminal' ? Math.max(0, offset - above) : 0}
{...(offset === e.props.scroll.offset || e.surface !== 'terminal'
? {}
: { scrollFrom: Math.max(0, e.props.scroll.offset - above) })}
onOpen={(agentId) => act($, { kind: 'open', agentId })}
onExpand={(agentId) => act($, { kind: 'expand', agentId })}
onBack={() => act($, { kind: 'back' })}
onWrap={() => act($, { kind: 'wrap' })}
onTool={(toolUseId) => act($, { kind: 'tool', toolUseId })}
onContext={() => act($, { kind: 'context' })}
onCache={() => act($, { kind: 'cache' })}
onRecount={() => act($, { kind: 'recount' })}
onCategory={(name) => act($, { kind: 'category', name })}
drafts={drafts}
onCompose={(agentId) => act($, { kind: 'compose', agentId })}
onStop={(agentId) => act($, { kind: 'stop', agentId })}
onDraft={(agentId, text, width) => {
const before = fieldLayout(drafts[agentId] ?? '', width)
const after = fieldLayout(text, width)
drafts[agentId] = text
// The pane draws the field by its layout: a field that got or lost a row, or
// whose label changes its length, draws the pane again.
if (before.rows !== after.rows || before.pad !== after.pad) void redraw($)
}}
onSend={(agentId, text) => act($, { kind: 'send', agentId, text })}
onAllow={(agentId) => act($, { kind: 'allow', agentId })}
/>
)
if (pad === 0) return body
return (
<ui.Box flexDirection="column" paddingX={pad}>
<ui.Text bold>{PANE_TITLE}</ui.Text>
{/* An empty row parts the title from the body. */}
<ui.Text> </ui.Text>
{body}
</ui.Box>
)
})mods/flight-deck/src/pane.tsx lines 181–340 · Pane
export const AgentPane = ({
ui,
entries,
view,
stats,
dashboard,
context,
breaks,
shownUsd,
spin,
holdsText,
now,
columns,
scrollTop,
scrollFrom,
onOpen,
onExpand,
onBack,
onWrap,
onTool,
onContext,
onCache,
onRecount,
onCategory,
drafts,
onCompose,
onStop,
onDraft,
onAllow,
onSend,
}: 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, isRest = false) =>
isClient ? (
<ui.Client
key={key}
module="./cellClient.tsx"
props={c}
width={c.width ?? cellText(c, 0, now).length}
height={1}
/>
) : (
<Box
key={key}
{...(isRest
? { flexGrow: 1, flexShrink: 1 }
: { 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>
)
// The cell that takes the rest of its row: `width` cells on a desktop, with its text cut to
// them. The terminal's layout gives the cell its width and cuts the text.
const rest = (key: string, text: string, width: number, tone: Omit<Cell, 'text'> = {}) =>
cell(
key,
isClient
? { ...tone, text: cut(text, width), width }
: { ...tone, text: cut(text, Infinity) },
true,
)
// A button of the terminal in a box that the layout can make narrower than the label. The
// layout wraps a label to the width that it has. So the inner box is as wide as the label,
// which keeps the label on one row, and the outer box cuts it.
const oneRow = (key: string, label: string, button: ReturnType<typeof cell>, isRest = false) => (
<Box key={key} flexGrow={isRest ? 1 : 0} flexShrink={1} overflow="hidden">
<Box width={label.length} flexShrink={0}>
{button}
</Box>
</Box>
)
// The box that takes the rest of its row, around a button with `label`: `width` cells on a
// desktop.
const restBox = (key: string, width: number, label: string, button: ReturnType<typeof cell>) =>
isClient ? (
<Box key={key} width={width} flexShrink={0}>
{button}
</Box>
) : (
oneRow(key, label, button, true)
)
// A row of real buttons of the terminal shows one row: the layout wraps a label in a narrow
// pane, and the rows below must keep their place.
const oneRowOnly = isClient ? {} : { height: 1, overflow: 'hidden' as const }
// A line across the terminal's pane: it is longer than a pane, and its box shows one row of it.
const line = (key: string) => (
<Box key={key} height={1} overflow="hidden">
<Text dimColor>{'─'.repeat(RULE_LENGTH)}</Text>
</Box>
)
const allow = (id: string) => {
const button = <Button key={`allow:${id}`} label={ALLOW_LABEL} onPress={() => onAllow(id)} />
// A real button of the terminal: its box has room for the label and the `[ ]` around it.
return isClient ? (
button
) : (
<Box key={`allowbox:${id}`} flexShrink={1} overflow="hidden">
<Box width={ALLOW_LABEL.length + BUTTON_CHROME} flexShrink={0}>
{button}
</Box>
</Box>
)
}
// The reason of a message or a stop that the engine refused, below the controls of the agent.
// A message that auto mode did not judge has a button there: it lets the messages of the
// pane go.
const controlError = (key: string, id: string) =>
view.controlError?.agentId !== id ? null : 'isAsk' in view.controlError ? (
<Box key={key} flexDirection="row" {...oneRowOnly}>
{allow(id)}
</Box>
) : (
<Text key={key} color={PALETTE.red} wrap="truncate">
{view.controlError.reason}
</Text>
)
// The message field of an agent. It has no placeholder: text that an input method composes
// (Vietnamese on macOS) is not in the field yet, so the engine draws the placeholder below it.
// Enter sends the text. Only the terminal and a desktop draw a field.
// The field takes its whole row: `width` cells on a desktop, where no box grows.
const say = (id: string, width: number) =>
'Input' in ui ? (
<Box
key={`saybox:${id}`}
flexDirection="column"
{...(isClient
? { width, flexShrink: 0 }
: {
flexGrow: 1,
flexShrink: 1,
})}
>
<ui.Input
key={`say:${id}`}
// The terminal cuts a field whose first row fills its width: the label grows
// by a cell then, and the text wraps in another place. See `fieldLayout`.
label={'›'.repeat(1 + (isClient ? 0 : fieldLayout(drafts[id] ?? '', width).pad))}
value={drafts[id] ?? ''}
submitLabel="send"
autoFocus
onInput={(text) => onDraft(id, text, width)}
onSubmit={(text) => onSend(id, text)}
/>
</Box>
) : null
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.
How to build this: Pane (panel), Deny a tool call
What its code calls
env varsdrives Claudetool callsrememberscalls tools
What its code shows
Read from the source at commit 58a02a826ee8 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.mods/flight-deck/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.35 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.its repository's .claude-plugin/marketplace.json does not list it: no marketplace line to give; the page shows how to try the commit read |
| 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 something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads environment variables, the transcript, settings.json, 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).tool.call: TaskStop |
| 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 agent-log |
| 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: tool.check (SendMessage), tool.call, prompt.submit, command.run (agent-log) · shapes: turn.step, prompt.compose, prompt.context, tool.describe · reads: ui.input, ui.press · also: session.start, session.compact, agent.spawn, session.measure (+6) · timers: clock.after, 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: FORCE_PROMPT_CACHING_5M, CLAUDE_CODE_PROMPT_CACHE_TTL, CLAUDE_CODE_SUBAGENT_PROMPT_C…, ENABLE_PROMPT_CACHING_1H, CLAUDE_CODE_DISABLE_1M_CONTEXT; the transcript; settings.json |
| 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.writes no files, environment variables, settings or conversation rows |
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.
Its repository's .claude-plugin/marketplace.json does not list it, so there is no marketplace line to give.
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/tunglt1810/claude-gadgetsgit -C claude-gadgets checkout 58a02a826ee8888b5115d5959529d538e48d4e41claude plugin validate claude-gadgets/mods/flight-deckclaude --plugin-dir claude-gadgets/mods/flight-deckThe 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 "tunglt1810-flight-deck" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- crit-tuiTomasz Tomczyk★ 1,196
- console-statusSaM-runtime★ 69
- tempergalando★ 17
- verdictKOZMOS★ 9
- chimaera-ui-probemartinappberg★ 4
- file-treeha-ptt0601★ 4
More from this repository
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/tunglt1810-flight-deck/)