flightdeck
Flightdeck: a live agent dashboard for Claude Code. Main model vitals, an on-call architect, every permission check, subagent cards and swimlanes, a turn receipt and a session log, all from real session events
何をするか
- 欄を描く
- /flightdeck を足す
- ツールの呼び出しを見張る(止めることがある)
- agent.offer・agent.spawn・classic.UserPromptSubmit・session.append ほか 7 個にフックする
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like flightdeck by Stephen Casella (pane, status), as modscode read it from the mod's code:
// https://modscode.com/gallery/scasella-flightdeck/
// 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: "Flightdeck" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const modelName = '…'
const architectLabel = '…'
const label = '…'
const type = '…'
const prettyModel = '…'
const status = '…'
const steps = '…'
const text = '…'
const answer = '…'
const type2 = '…'
const type3 = '…'
const type4 = '…'
const type5 = '…'
const type6 = '…'
const fmtClock = '…'
const who = '…'
const fmtClock2 = '…'
const who2 = '…'
const text2 = '…'
const fmtClock3 = '…'
const who3 = '…'
const text3 = '…'
return (
<Box flexDirection="column">
<Box justifyContent="center">
<Text bold wrap="truncate">
<Text>
FLIGHTDECK
</Text>
<Text>
{" · "}
</Text>
<Text>
{modelName}
</Text>
<Text>
{" WORKS"}
</Text>
<Text>
{" · "}
</Text>
<Text>
{architectLabel}
</Text>
<Text>
{" ADVISING"}
</Text>
</Text>
</Box>
<Box justifyContent="center" columnGap={2}>
<Text>
<Text>
■
</Text>
<Text dimColor>
{` ${label}`}
</Text>
</Text>
<Text>
<Text>
■
</Text>
<Text dimColor>
{` ${label}`}
</Text>
</Text>
<Text>
<Text>
■
</Text>
<Text dimColor>
{` ${label}`}
</Text>
</Text>
</Box>
<Box flexDirection="column">
<Box columnGap={2}>
<Box flexDirection="column">
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type2}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type3}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type4}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type5}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" borderStyle="single" paddingX={1}>
<Text bold wrap="wrap">
{type6}
</Text>
<Text dimColor wrap="truncate">
{`${type} · ${prettyModel} · ${status} · ${steps} steps`}
</Text>
<Text>
no tool calls yet
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text wrap="truncate">
{`✗ ${text}`}
</Text>
<Text dimColor wrap="wrap">
{`» ${answer}`}
</Text>
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Text dimColor>
session log · this agent
</Text>
<Text>
nothing yet
</Text>
<Box>
<Box width={9} flexShrink={0}>
<Text>
{fmtClock}
</Text>
</Box>
<Box width={13} flexShrink={0}>
<Text bold wrap="truncate">
{who}
</Text>
</Box>
<Text wrap="truncate">
{text}
</Text>
</Box>
<Box>
<Box width={9} flexShrink={0}>
<Text>
{fmtClock2}
</Text>
</Box>
<Box width={13} flexShrink={0}>
<Text bold wrap="truncate">
{who2}
</Text>
</Box>
<Text wrap="truncate">
{text2}
</Text>
</Box>
<Box>
<Box width={9} flexShrink={0}>
<Text>
{fmtClock3}
</Text>
</Box>
<Box width={13} flexShrink={0}>
<Text bold wrap="truncate">
{who3}
</Text>
</Box>
<Text wrap="truncate">
{text3}
</Text>
</Box>
</Box>
</Box>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 520〜679 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const els = $.ui.resolve(e)
const { Box, Text, Button } = els
const hasClient = 'Client' in els
const [m, u, a, g, cards, lp, lines, t, r, v, now] = await Promise.all([
getMain($),
getUsage($),
getArchitect($),
getGate($),
getCards($),
getLoops($),
getLog($),
getTurn($),
read($, receipt),
getView($),
$.clock.now(),
])
const W = Math.max(40, e.props.bodyColumns)
const layout = v.layout ?? cfg.layout
const isWide = layout === 'wide' || (layout === 'auto' && W >= 110)
const colW = isWide ? Math.floor((W - 2) / 2) : W
const modelName = prettyModel(m.model)
const viewed = e.props.view?.agentId ?? null
const advising = isAdvising(a)
const running = cards.filter(c => c.status === 'running')
const showArchitect = a.consults.length > 0 || a.ids.length > 0
const motion = cfg.motion && hasClient
// A panel with nothing to show yet takes no room: most sessions never spawn an agent.
const isEmpty: Record<Panel, boolean> = {
main: false,
architect: !showArchitect,
gate: g.recent.length === 0 && gateSummary(g).total === 0,
agents: cards.length === 0,
loops: lp.length === 0,
receipt: !m.isRunning && !r,
log: false,
}
const panels = cfg.panels.filter(p => !isEmpty[p])
const decider = m.mode === 'auto' ? 'classifier' : 'you'
// A connector between panels: animated while its flow is live, a dim line otherwise.
const rail = (key: string, active: boolean, color: string, width: number, marks: number[] = [], isMerge = false) =>
motion ? (
<els.Client
key={key}
module="./rail.tsx"
width={width}
height={1}
props={{ active, width, color, dim: C.faint, marks, isMerge }}
/>
) : (
<Text color={C.faint}>{'─'.repeat(Math.max(1, width))}</Text>
)
// A start time of 0 is unknown (state saved before it was recorded): no clock, not decades.
const clock = (key: string, since: number, endAt: number | null, color: string) =>
since <= 0 ? (
<Text color={color}>—</Text>
) : hasClient ? (
<els.Client key={key} module="./elapsed.tsx" props={{ since, now, endAt, color }} />
) : (
<Text color={color}>{fmtTimer((endAt ?? now) - since)}</Text>
)
// ---- main
const effortN = { low: 1, medium: 2, high: 3, xhigh: 4, max: 4 }[m.effort] ?? 0
const ctxGauge = u.pct !== null ? gauge(u.pct, 10) : null
const mainPanel = (w: number) => (
<Box flexDirection="column" borderStyle="round" borderColor={C.main} paddingX={1} width={w}>
<Box justifyContent="space-between">
<Text color={C.main} bold>
{modelName} · main
</Text>
<Text color={m.isRunning ? C.main : C.dim}>{m.isRunning ? '● working' : '○ idle'}</Text>
</Box>
<Text wrap="truncate">
<Text dimColor>effort </Text>
<Text color={C.main}>{'▮'.repeat(effortN) + '▯'.repeat(4 - effortN)} </Text>
<Text color={C.main} bold>
{m.effort || '—'}
</Text>
{m.mode ? <Text dimColor>{` mode ${m.mode}`}</Text> : null}
<Text dimColor>{` ${m.steps} req`}</Text>
</Text>
{ctxGauge ? (
<Text wrap="truncate">
<Text dimColor>ctx </Text>
<Text color={u.pct !== null && u.pct >= 80 ? C.warn : C.main}>{ctxGauge.on}</Text>
<Text color={C.faint}>{ctxGauge.off}</Text>
<Text bold>{` ${Math.round(u.pct ?? 0)}%`}</Text>
{u.tokens !== null ? <Text dimColor>{` ${kTokens(u.tokens)}/${kTokens(u.window)}`}</Text> : null}
{u.compactions > 0 ? <Text color={C.amber}>{` ⟲${u.compactions}`}</Text> : null}
</Text>
) : null}
{u.costUsd !== null || u.limits.length > 0 ? (
<Text wrap="truncate">
{u.costUsd !== null ? <Text color={C.text}>{`${fmtUsd(u.costUsd)} `}</Text> : null}
{u.limits.slice(0, 2).map(l => {
const lg = gauge(l.pct, 5)
return (
<Text wrap="truncate">
<Text dimColor>{`${limitLabel(l.kind)} `}</Text>
<Text color={l.pct >= 80 ? C.warn : C.main}>{lg.on}</Text>
<Text color={C.faint}>{lg.off}</Text>
<Text dimColor>{` ${Math.round(l.pct)}% `}</Text>
</Text>
)
})}
</Text>
) : null}
</Box>
)
// ---- architect
const lastConsult = a.consults[a.consults.length - 1]
const architectPanel = (w: number) => {
const tl = consultTimeline(a, now, Math.max(8, w - 4))
return (
<Box flexDirection="column" borderStyle="round" borderColor={C.arch} paddingX={1} width={w}>
<Box justifyContent="space-between">
<Text color={C.arch} bold>
{cfg.architectLabel} · {advising ? 'advising' : 'on call'}
</Text>
<Text>
<Text dimColor>consults </Text>
<Text color={C.arch} bold>
{a.consults.length}
</Text>
</Text>
</Box>
<Text color={C.arch}>{tl}</Text>
{lastConsult ? (
<Text dimColor wrap="truncate">
{advising
? `consulting since ${fmtClock(lastConsult.at)}`
: `last ${fmtDuration(now - (lastConsult.endAt ?? lastConsult.at))} ago · took ${fmtDuration((lastConsult.endAt ?? now) - lastConsult.at)}`}
</Text>
) : (
<Text dimColor>not consulted yet</Text>
)}
{cfg.moments ? (
<Box flexWrap="wrap" columnGap={2}>
{(['before a plan', 'error repeats', 'before done'] as const).map(mo => {
const isOn = lastConsult?.moment === mo
return (
<Text color={isOn ? C.arch : C.dim} bold={isOn}>
{isOn ? '◆' : '◇'} {mo}
</Text>
)
})}
<Text color={C.faint}>(inferred)</Text>
</Box>
) : null}
{a.lastAdvice ? (
<Text color={C.arch} wrap="truncate">
» {a.lastAdvice}
</Text>
) : null}
</Box>
)ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Stephen Casella 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.
コードが呼ぶもの
ツール呼び出し
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット f31daca523d3 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。4 ファイルを解析 |
| コードが Mod の中で完結 | import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中 |
| 読める | 圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし |
| 呼び出しが見える | 通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で |
| 入れる前に自分で判断する材料 | |
| 描く場所 | コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに同じように描く |
| 入れる手順 | リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる |
| Windows のプログラム | $.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add scasella/claude-flightdeck/plugin install flightdeck@claude-flightdeck入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(f31daca523d3)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「scasella-flightdeck」をコードごと読んで、同じようなペインを作って似たデザイン
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
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
-
Claude に頼む…SessiondeckSESSIONDECK · Opus WORKS■ build■ build■ buildnotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecknotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecknotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecknotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecknotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecknotenote · Opus · ok · 3 stepsno tool calls yet✗ Bash✗ Bash✗ Bash» Sessiondecksession log · this agentnothing yet14:32alexBash14:32alexBash14:32alexBash
-
Claude に頼む…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
Claude に頼む…Timer● MonAprNo timer runningStopResume last CollapseFri week./meter.tsxUnbilled Wed h$1.24 · expenses MarMayToday, Oct 6This week
-
Claude に頼む…Verinoda: WriteVerinodamain Write Write Writebuild u VerinodaSon commitHenüz commit incelenmedi VerinodaGlobKısalt dOtomatik bağlamBağlam● auto 3● auto 3● auto 3▲ Oturum proje dışında başladı; bağlam eklenmezVerinodaİnceleme● Açık GlobKapalı rCommit sonrası risk ve bulgular bildirilirKontrol● Açık GlobKapalı kPython/Java/Kotlin düzenlemesindeki var olmayan isimler Claude'a söylenirVerinodaIndex yokVerinodaVerinodaVerinodaVerinodaVerinodaVerinodaVerinodaVerinodaVerinodaVerinoda