ModsCode / Claude Code Mods / Ranking / agent-deck
agent-deck
A pane on the right that tracks this session's subagents as a tree: status, current action, files changed, tokens and cost
What it does
- Draws a pane, toasts
- Adds /deck
- Watches tool calls and can refuse them
- Hooks agent.spawn, classic.PermissionRequest, prompt.compose, prompt.submit and 2 more
Good points
- No network calls
- Starts no processes
- Written in TypeScript
- 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 agent-deck by Prabal Singh (pane, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/prabal-singh-agent-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 lead = '…'
const glyph = '…'
const line1 = '…'
const cont = '…'
const stats = '…'
const filter = '…'
const tools = '…'
const cont2 = '…'
const prompt = '…'
const cont3 = '…'
const tokensIn = '…'
const cacheRead = '…'
const cacheWrite = '…'
const tokens = '…'
const cont4 = '…'
const cont5 = '…'
const tail = '…'
const cont6 = '…'
const tail2 = '…'
const cont7 = '…'
const tail3 = '…'
const cont8 = '…'
const recent = '…'
const cont9 = '…'
const result = '…'
const lead2 = '…'
const glyph2 = '…'
const cont10 = '…'
const filter2 = '…'
const tools2 = '…'
const cont11 = '…'
const prompt2 = '…'
const cont12 = '…'
const tokens2 = '…'
const cont13 = '…'
const cont14 = '…'
const tail4 = '…'
const cont15 = '…'
const tail5 = '…'
const cont16 = '…'
const tail6 = '…'
const cont17 = '…'
const recent2 = '…'
const cont18 = '…'
const result2 = '…'
const lead3 = '…'
const glyph3 = '…'
const cont19 = '…'
const filter3 = '…'
const tools3 = '…'
const cont20 = '…'
const prompt3 = '…'
const cont21 = '…'
const tokens3 = '…'
const cont22 = '…'
const cont23 = '…'
const tail7 = '…'
const cont24 = '…'
const tail8 = '…'
const cont25 = '…'
const tail9 = '…'
const cont26 = '…'
const recent3 = '…'
const cont27 = '…'
const result3 = '…'
const length = '…'
const agent = '…'
const elapsed = '…'
const what = '…'
const first = '…'
const more = '…'
const agent2 = '…'
const elapsed2 = '…'
const what2 = '…'
const first2 = '…'
const more2 = '…'
const agent3 = '…'
const elapsed3 = '…'
const what3 = '…'
const first3 = '…'
const more3 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="column" overflow="hidden" flexShrink={0}>
<Text dimColor>
No subagents yet. They show here as a tree when one starts.
</Text>
<Box flexDirection="column" flexShrink={0}>
<Box flexDirection="row" flexShrink={0}>
<Text dimColor>
{lead}
</Text>
<Text>
{glyph}
{" "}
</Text>
<Button plain label={`${line1}`} />
</Box>
<Text dimColor>
{`${cont} ${stats}`}
</Text>
<Box flexDirection="column" flexShrink={0}>
<Text dimColor wrap="truncate-end">
{cont}
{" "}
{filter}
{" · "}
{tools}
{" tools"}
</Text>
<Text wrap="wrap">
{cont2}
{" Task: "}
{prompt}
</Text>
<Text dimColor>
{cont3}
{" Tokens: "}
{`${tokensIn}${cacheRead}${cacheWrite}`}
{" in · "}
{tokens}
{" out"}
</Text>
<Text>
{cont4}
{" Files changed:"}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont5}
{" "}
{tail}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont6}
{" "}
{tail2}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont7}
{" "}
{tail3}
</Text>
<Text dimColor wrap="truncate-end">
{cont8}
{" Last: "}
{recent}
</Text>
<Text wrap="wrap">
{cont9}
{" Result: "}
{result}
</Text>
</Box>
</Box>
<Box flexDirection="column" flexShrink={0}>
<Box flexDirection="row" flexShrink={0}>
<Text dimColor>
{lead2}
</Text>
<Text>
{glyph2}
{" "}
</Text>
<Button plain label={`${line1}`} />
</Box>
<Text dimColor>
{`${cont} ${stats}`}
</Text>
<Box flexDirection="column" flexShrink={0}>
<Text dimColor wrap="truncate-end">
{cont10}
{" "}
{filter2}
{" · "}
{tools2}
{" tools"}
</Text>
<Text wrap="wrap">
{cont11}
{" Task: "}
{prompt2}
</Text>
<Text dimColor>
{cont12}
{" Tokens: "}
{`${tokensIn}${cacheRead}${cacheWrite}`}
{" in · "}
{tokens2}
{" out"}
</Text>
<Text>
{cont13}
{" Files changed:"}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont14}
{" "}
{tail4}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont15}
{" "}
{tail5}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont16}
{" "}
{tail6}
</Text>
<Text dimColor wrap="truncate-end">
{cont17}
{" Last: "}
{recent2}
</Text>
<Text wrap="wrap">
{cont18}
{" Result: "}
{result2}
</Text>
</Box>
</Box>
<Box flexDirection="column" flexShrink={0}>
<Box flexDirection="row" flexShrink={0}>
<Text dimColor>
{lead3}
</Text>
<Text>
{glyph3}
{" "}
</Text>
<Button plain label={`${line1}`} />
</Box>
<Text dimColor>
{`${cont} ${stats}`}
</Text>
<Box flexDirection="column" flexShrink={0}>
<Text dimColor wrap="truncate-end">
{cont19}
{" "}
{filter3}
{" · "}
{tools3}
{" tools"}
</Text>
<Text wrap="wrap">
{cont20}
{" Task: "}
{prompt3}
</Text>
<Text dimColor>
{cont21}
{" Tokens: "}
{`${tokensIn}${cacheRead}${cacheWrite}`}
{" in · "}
{tokens3}
{" out"}
</Text>
<Text>
{cont22}
{" Files changed:"}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont23}
{" "}
{tail7}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont24}
{" "}
{tail8}
</Text>
<Text color="diffAdded" wrap="truncate-start">
{cont25}
{" "}
{tail9}
</Text>
<Text dimColor wrap="truncate-end">
{cont26}
{" Last: "}
{recent3}
</Text>
<Text wrap="wrap">
{cont27}
{" Result: "}
{result3}
</Text>
</Box>
</Box>
<Text dimColor>
+
0
{" more not shown (oldest first) · click a row for details"}
</Text>
</Box>
<Text bold color="warning">
{`Blocked on you (${length})`}
</Text>
<Text dimColor>
Nothing. Claude can keep going.
</Text>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" justifyContent="space-between">
<Text wrap="truncate-end">
<Text color="warning" bold>
Needs you
</Text>
<Text dimColor>
{" · "}
{agent}
</Text>
</Text>
<Text dimColor>
{elapsed}
{" ago"}
</Text>
</Box>
<Text wrap="wrap">
{what}
</Text>
<Text dimColor wrap="truncate-end">
{"$ "}
{first}
{more}
</Text>
<Box flexDirection="row" gap={2}>
<Button label="Copy" />
<Button label="Done" />
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" justifyContent="space-between">
<Text wrap="truncate-end">
<Text color="warning" bold>
Needs you
</Text>
<Text dimColor>
{" · "}
{agent2}
</Text>
</Text>
<Text dimColor>
{elapsed2}
{" ago"}
</Text>
</Box>
<Text wrap="wrap">
{what2}
</Text>
<Text dimColor wrap="truncate-end">
{"$ "}
{first2}
{more2}
</Text>
<Box flexDirection="row" gap={2}>
<Button label="Copy" />
<Button label="Done" />
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="row" justifyContent="space-between">
<Text wrap="truncate-end">
<Text color="warning" bold>
Needs you
</Text>
<Text dimColor>
{" · "}
{agent3}
</Text>
</Text>
<Text dimColor>
{elapsed3}
{" ago"}
</Text>
</Box>
<Text wrap="wrap">
{what3}
</Text>
<Text dimColor wrap="truncate-end">
{"$ "}
{first3}
{more3}
</Text>
<Box flexDirection="row" gap={2}>
<Button label="Copy" />
<Button label="Done" />
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const mark = '…'
const name = '…'
const elapsed = '…'
const cost = '…'
await $.ui.toast(`Subagents are being tracked: type /deck to show the panel`)
await $.ui.toast(`${mark} ${name} · ${elapsed} · ${cost}`)
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.
agent-deck/hooks/register.tsx lines 611–744 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const map = await read($, agents)
const open = await read($, expanded)
const at = Math.max(await read($, now), ...Object.values(map).map(r => r.lastActivity))
const rows = Object.values(map)
const lines = treeLines(map)
const total = rows.reduce((sum, r) => sum + r.costUsd, 0)
const count = (s: string[]) => rows.filter(r => s.includes(r.status)).length
const head = [
`${count(['running', 'pending', 'waiting'])} running`,
`${count(['completed'])} done`,
count(['failed', 'killed']) ? `${count(['failed', 'killed'])} failed` : '',
money(total),
].filter(Boolean).join(' · ')
const blocked = await read($, blockers)
const ORDER = ['decision', 'access', 'review', 'question', 'plan', 'permission', 'command', 'other', 'waiting']
const rank = (b: Blocker) => (ORDER.indexOf(b.kind) + 1 || ORDER.length) * 2 + Number(b.auto)
const needs: Blocker[] = [
...[...blocked].sort((a, b) => rank(a) - rank(b) || a.since - b.since),
]
const half = Math.max(6, Math.floor((e.props.scroll?.bodyRows ?? 24) / 2))
const width = Math.max(24, e.props.bodyColumns ?? 56)
const fit = (text: string, room: number) => (text.length > room ? `${text.slice(0, Math.max(1, room - 1))}…` : text)
// Rows never shrink: they are cut whole. Running agents take two lines, finished ones one, an open row its details.
const budget = half - 2
const cost = (r: AgentRow) =>
(isLive(r) ? 2 : 1) + (open === r.id ? 4 + r.files.length + (r.result ? 2 : 0) : 0)
const shown: TreeLine[] = []
let used = 0
let hidden = 0
for (const line of lines) {
const need = cost(line.row)
if (used + need > budget && !(isLive(line.row) && used + need <= budget + 2)) {
hidden++
continue
}
shown.push(line)
used += need
}
const color = (r: AgentRow) => {
const g = glyph(r, at)
return g === '⚠' ? 'warning' : g === '✓' ? 'success' : g === '✗' || g === '■' ? 'error' : 'claude'
}
return (
<Box flexDirection="column">
<Box flexDirection="column" height={half} overflow="hidden" flexShrink={0}>
{rows.length === 0 ? (
<Text dimColor>No subagents yet. They show here as a tree when one starts.</Text>
) : (
<Text bold>{head}</Text>
)}
{shown.map(({ row, lead, cont, subtreeCost }) => {
const isOpen = open === row.id
const took = `${row.joinedLate ? '≥' : ''}${elapsed((row.endedAt ?? at) - row.startedAt)}`
const files = row.files.length ? `${row.files.length} file${row.files.length === 1 ? '' : 's'}` : ''
const label = row.name ? `${row.name} — ${short(row.description, 44)}` : short(row.description, 56)
const live = isLive(row)
const stats = live
? [took, `${row.tools} tools`, files, money(subtreeCost), row.current].filter(Boolean).join(' · ')
: [took, files, money(subtreeCost)].filter(Boolean).join(' · ')
const room = Math.max(12, width - lead.length - 2)
const line1 = fit(live ? label : `${label} · ${stats}`, room)
return (
<Box key={row.id} flexDirection="column" flexShrink={0}>
<Box flexDirection="row" flexShrink={0}>
<Text dimColor>{lead}</Text>
<Text color={color(row)}>{glyph(row, at)} </Text>
<Button key={`row-${row.id}`} plain dimColor={!live} label={line1} onPress={() => update($, expanded, cur => (cur === row.id ? null : row.id))} />
</Box>
{live && <Text dimColor>{fit(`${cont} ${stats}`, width)}</Text>}
{isOpen && (
<Box flexDirection="column" flexShrink={0}>
<Text dimColor wrap="truncate-end">{cont} {[row.type, row.model.replace(/^claude-/, '')].filter(Boolean).join(' · ')} · {row.tools} tools</Text>
<Text wrap="wrap">{cont} Task: {short(row.prompt.replace(MAY_SPAWN, ''), 200)}</Text>
<Text dimColor>
{cont} Tokens: {tokens(row.tokensIn + row.cacheRead + row.cacheWrite)} in · {tokens(row.tokensOut)} out
</Text>
{row.files.length > 0 && <Text>{cont} Files changed:</Text>}
{row.files.map(f => (
<Text key={`${row.id}-${f}`} color="diffAdded" wrap="truncate-start">
{cont} {tail(f)}
</Text>
))}
{row.recent.length > 0 && <Text dimColor wrap="truncate-end">{cont} Last: {row.recent.slice(-3).join(' → ')}</Text>}
{row.result && <Text wrap="wrap">{cont} Result: {short(row.result, 300)}</Text>}
</Box>
)}
</Box>
)
})}
{hidden > 0 && <Text dimColor>+{hidden} more not shown (oldest first) · click a row for details</Text>}
</Box>
<Text bold color={needs.length ? 'warning' : undefined}>
{needs.length ? `Blocked on you (${needs.length})` : 'Blocked on you'}
</Text>
{needs.length === 0 && <Text dimColor>Nothing. Claude can keep going.</Text>}
{needs.map(b => {
const lines = b.command.split('\n')
const first = lines[0] ?? ''
const more = lines.length > 1 ? ` (+${lines.length - 1} lines)` : ''
return (
<Box key={b.id} flexDirection="column" marginTop={1}>
<Box flexDirection="row" justifyContent="space-between">
<Text wrap="truncate-end">
<Text color="warning" bold>{kindLabel(b.kind)}</Text>
{b.agent ? <Text dimColor> · {b.agent}</Text> : null}
</Text>
<Text dimColor>{elapsed(at - b.since)} ago</Text>
</Box>
<Text wrap="wrap">{b.what}</Text>
{b.command ? (
<Text dimColor wrap="truncate-end">
$ {first}
{more}
</Text>
) : null}
{!b.auto || b.command ? (
<Box flexDirection="row" gap={2}>
{b.command ? (
<Button key={`copy-${b.id}`} label="Copy" onPress={() => void $.ui.copy({ text: `! ${b.command}`, surface: e.surface })} />
) : null}
{!b.auto ? (
<Button key={`done-${b.id}`} label="Done" onPress={() => void dropBlocker($, x => x.id === b.id)} />
) : null}
</Box>
) : null}
</Box>
)
})}
</Box>
)
})Licence text (MIT)
MIT License Copyright (c) 2026 Prabal Singh 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
drives Claudetool calls
What its code shows
Read from the source at commit 76508d4ac697 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.agent-deck/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 something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).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.1 command: text only |
| 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 deck, adds tool ? |
| 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: prompt.submit, command.run (deck), tool.call, classic.PermissionRequest · shapes: prompt.compose · also: session.start, agent.spawn, turn.complete, ui.render (Pane) · 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.reads no files, environment variables, settings or 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.the clipboard |
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 Prabal-Singh/claude-mods/plugin install agent-deck@prabal-mods/reload-pluginsThis installs the marketplace's latest commit, which may not be the one read here (76508d4ac697). 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/Prabal-Singh/claude-modsgit -C claude-mods checkout 76508d4ac697c27048c27c8fecc1f2a0564b9fb8claude plugin validate claude-mods/agent-deckclaude --plugin-dir claude-mods/agent-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 "prabal-singh-agent-deck" with its code and make me one like itSearch them from Claude: the MCP connector
Similar mods
- ruflo-swarmruvnet★ 74,323
- code-modernizationAnthropic★ 37,653
- moai-boardMoAI-ADK★ 1,230
- crit-tuiTomasz Tomczyk★ 1,196
- lcu-approveLCU★ 894
- ai-maestro-secrets23blocks-OS★ 817
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/prabal-singh-agent-deck/)