modscode / Gallery / agent-bus
agent-bus
The agent bus beside the transcript: /bus opens a pane of queued, running and recent tasks with their results, a running count rides the status line, and a task this session dispatched reports back to it when it finishes.
What it does
- Draws a pane, toasts
- Adds /bus
- Hooks prompt.submit, session.start, ui.close
- Keeps its own state between turns
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Handles errors
- Writes no files
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 agent-bus by Noah Airmet (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/noah-airmet-agent-bus/
// 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: "‹PANE_TITLE›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box } = $.ui.resolve(e)
return (
<Box flexDirection="column" paddingTop={1} paddingRight={1} />
)
})
on('session.start', async ($, e, next) => {
const id = '…'
await $.ui.toast(`${id}'s result did not fit in the prompt`)
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.
plugin/hooks/register.tsx lines 564–595 · Pane
on(
'ui.render',
{ component: 'Pane', requestId: 'bus' },
async ($, e, next) => {
if (!host) return next(e)
const { Box, Text, Button, Markdown, Input, Select } = (await $.ui.resolve(
e,
)) as Ui
const isDocked = e.props.placement === 'dock'
const [snapshot, selected, detail, armed, composer] = await Promise.all([
read($, snapshotAtom),
read($, selectedAtom),
read($, detailAtom),
read($, armedAtom),
read($, composerAtom),
])
return paneView(
{
ui: { Box, Text, Button, Markdown, Input, Select },
actions: actionsOf(host),
columns: Math.max(1, e.props.bodyColumns - (isDocked ? 1 : 0)),
home,
canCompose: e.surface !== 'mobile',
},
{ snapshot, selected, detail, armed, composer, isDocked },
)
},
)plugin/hooks/pane-view.tsx lines 374–454 · Pane
export function paneView(kit: Kit, model: PaneModel): RenderElement {
const { Box } = kit.ui
const snapshot = model.snapshot
const frame = (children: RenderElement[]): RenderElement => (
<Box
flexDirection="column"
paddingTop={model.isDocked ? 1 : 0}
paddingRight={model.isDocked ? 1 : 0}
>
{children}
</Box>
)
if (!snapshot) {
return frame([dimNote(kit, 'Reading the bus…')])
}
if (snapshot.error) {
return frame([dimNote(kit, snapshot.error)])
}
const hosts = snapshot.hosts.map(host => host.name)
const isTagged = hosts.length > 1
const isComposing = model.isDocked && model.composer?.isOpen === true
const isComposable = model.isDocked && kit.canCompose && !isComposing
if (snapshot.tasks.length === 0) {
return frame(
present([
headerView(kit, snapshot, isComposable),
<Box height={1} />,
isComposing && model.composer
? composerView(kit, model.composer, hosts)
: dimNote(kit, 'No bus tasks yet.'),
]),
)
}
const selected = selectedOf(snapshot, model.selected)
const active = snapshot.tasks.filter(isActive)
const recent = snapshot.tasks
.filter(task => !isActive(task))
.slice(0, model.isDocked ? RECENT_ROWS_DOCKED : RECENT_ROWS_INLINE)
const rowsOf = (tasks: BusTask[]): RenderElement[] =>
tasks.map(task =>
taskRow(
kit,
task,
snapshot.now,
model.isDocked && task === selected,
isTagged,
),
)
return frame(
present([
headerView(kit, snapshot, isComposable),
<Box height={1} />,
...rowsOf(active),
active.length > 0 && recent.length > 0 ? <Box height={1} /> : null,
recent.length > 0 ? dimNote(kit, 'Recent') : null,
...rowsOf(recent),
...(isComposing && model.composer
? [
<Box height={1} />,
divider(kit),
composerView(kit, model.composer, hosts),
]
: model.isDocked && selected
? [
<Box height={1} />,
divider(kit),
detailView(kit, model, selected),
]
: []),
]),
)
}plugin/hooks/pane-view.tsx lines 121–173 · Pane
function headerView(
kit: Kit,
snapshot: BusSnapshot,
isComposable: boolean,
): RenderElement {
const { Box, Text, Button } = kit.ui
const tasks = snapshot.tasks
const running = tasks.filter(task => task.state === 'running').length
const queued = tasks.filter(task => task.state === 'queued').length
const last = tasks.find(task => !isActive(task))
const [lead, aside] =
running > 0
? [`${running} running`, queued > 0 ? ` · ${queued} queued` : '']
: queued > 0
? [`${queued} queued`, '']
: [
'Idle',
last?.finished_at
? ` · last finished ${spanOf(snapshot.now - last.finished_at)} ago`
: '',
]
const unreachable = snapshot.hosts.filter(host => host.error !== null)
const line = (
<Box flexDirection="row" height={1}>
<Text wrap="truncate-end">
<Text bold>{lead}</Text>
<Text dimColor>{aside}</Text>
</Text>
<Box flexGrow={1} />
{isComposable ? (
<Button key="compose" plain dimColor hotkey="n" onPress={kit.actions.compose}>
New task
</Button>
) : null}
</Box>
)
return unreachable.length === 0 ? (
line
) : (
<Box flexDirection="column">
{line}
{unreachable.map(host => (
<Text color="warning" wrap="truncate-end">
{`Couldn't reach ${host.name}`}
</Text>
))}
</Box>
)
}plugin/hooks/pane-view.tsx lines 292–367 · Pane
function composerView(
kit: Kit,
composer: BusComposer,
hosts: string[],
): RenderElement {
const { Box, Text, Button, Input, Select } = kit.ui
const lane = LANES.find(one => one.value === composer.lane)
const hint = composer.isSending
? 'Dispatching…'
: `Enter dispatches to ${lane?.value ?? composer.lane}, ${composer.mode}` +
(hosts.length > 1 || composer.host !== LOCAL ? `, on ${composer.host}` : '')
return (
<Box flexDirection="column">
<Box flexDirection="row" height={1}>
<Text bold>New task</Text>
<Box flexGrow={1} />
<Button key="discard" role="dismiss" onPress={kit.actions.discard}>
Discard
</Button>
</Box>
<Box height={1} />
{hosts.length > 1 ? (
<Select
key="host"
label="Machine "
value={composer.host}
options={hosts.map(host => ({
value: host,
label: host === LOCAL ? 'this machine' : host,
}))}
onSelect={kit.actions.setHost}
/>
) : null}
<Select
key="lane"
label="Lane "
value={composer.lane}
options={LANES.map(({ value, label }) => ({ value, label }))}
onSelect={kit.actions.setLane}
/>
<Select
key="mode"
label="Mode "
value={composer.mode}
options={MODES.map(({ value, label }) => ({ value, label }))}
onSelect={kit.actions.setMode}
/>
<Input
key="cwd"
label="Folder "
value={
composer.host === LOCAL
? homeFolded(composer.cwd, kit.home)
: composer.cwd
}
onInput={kit.actions.setCwd}
onSubmit={kit.actions.setCwd}
/>
<Box height={1} />
<Input
key="prompt"
label="Prompt "
placeholder="What should the worker do?"
submitLabel="dispatch"
value={composer.prompt}
autoFocus
onInput={kit.actions.setPrompt}
onSubmit={kit.actions.dispatch}
/>
<Box height={1} />
{dimNote(kit, hint)}
</Box>
)
}plugin/hooks/pane-view.tsx lines 97–105 · Pane
function dimNote(kit: Kit, text: string): RenderElement {
const { Text } = kit.ui
return (
<Text dimColor wrap="truncate-end">
{text}
</Text>
)
}plugin/hooks/pane-view.tsx lines 107–115 · Pane
function divider(kit: Kit): RenderElement {
const { Text } = kit.ui
return (
<Text dimColor wrap="truncate-end">
{'─'.repeat(Math.max(1, kit.columns))}
</Text>
)
}Licence text (MIT)
MIT License Copyright (c) 2026 Noah Airmet 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
runs programsreads filesenv varsremembers
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 d87323accde9 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.plugin/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.3 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.plugin/hooks/register.tsx:475 a program named at run time |
| 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 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 Noah-Airmet/agent-bus/plugin install agent-bus@agent-busThis installs the marketplace's latest commit, which may not be the one read here (d87323accde9). Compare them before you install.
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 "noah-airmet-agent-bus" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…QuestList 1 Kanban 2Fleet f This repo l Refs g Refresh r Normal size z Collapse cOpen FilterokAll reposDoneClosedClose itList* marks a task whose refs disagree about its status; origin/dev is drawn where it has one. Resolving it is that reposit…New task in acme/app CreateClosed tracker change in acme/app not committed yet. Until they land, this repository's other checkouts cannot see the ids in them and can mint the same… Ask Claude to land them⋯
-
Ask Claude…Vikunja 3 doing · 3 blockedVikunjaloading… · demo dataRefresh rAnyoneVikunjaAnyMarBlocked ShowHideDue buildbuildbuildClearFind # Mar findClearFOUND #Marlooking…MarNo task has that number.Apr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighTHIS SESSION3Apr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighbuild3Nothing here.my-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhigh3 more not shown. Narrow them with the filters.build3Nothing here.my-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhigh
-
Ask Claude…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
Ask Claude…GitHub inboxGitHubloading…Refresh rbuildbuildbuildClose xStealth IssuesNo open issues in this view.#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopenPull requestsNo open pull requests.#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopenChecks for #3Plain
-
Ask Claude…AskSide questions. Answers stay here, out of the chat.Nothing asked yet.────────Remove ask────────› Copythinking…No answer.(empty)Use promptUse promptUse promptCopyRetryRemove────────› Copythinking…No answer.(empty)Use promptUse promptUse promptCopyRetryRemove────────› Copythinking…No answer.(empty)Use promptUse promptUse promptCopyRetryRemoveSuggest next promptsClear answered