modscode / Gallery / swarm-mod
swarm-mod
Spawn, watch and steer a swarm of Claude Code agents from a side pane
What it does
- Draws a pane, a band above the prompt, the status line
- Adds /swarm, /swarm-spawn
- Watches mcp__swarm-mod__swarm_status calls and can refuse them
- Hooks agent.offer, classic.SessionStart, session.end, session.start and 4 more
- Keeps its own state between turns
Good points
- No network calls
- Handles errors
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 swarm-mod by djmid (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/netgfx-swarm-mod/
// 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: "Swarm" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const label = '…'
const name = '…'
const task = '…'
const cwd = '…'
return (
<Box flexDirection="column">
<Text bold>
Spawn a swarm agent
</Text>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Input label="Name" placeholder="scout" value={`${name}`} />
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button label={`${label}: ${label} ▴`} plain />
</Box>
</Box>
<Input label="Task" placeholder="first prompt (optional)" value={`${task}`} />
<Text dimColor wrap="truncate-middle">
{`Workspace: ${cwd}`}
</Text>
<Text color="#ff5555" />
<Box flexDirection="row" columnGap={2}>
<Button label={`Spawn ${name}`} />
<Button label="Cancel" />
</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 working = '…'
const length = '…'
const fmtTokens = '…'
const glyph = '…'
const attention = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Text bold color="#c678dd">
swarm
</Text>
<Text dimColor>
{`${working}/${length} working · ${fmtTokens} tok`}
</Text>
<Text>
{`● ${glyph}`}
</Text>
<Text>
{`● ${glyph}`}
</Text>
<Text>
{`● ${glyph}`}
</Text>
<Button label={`! ${attention} need you`} />
<Button label="Swarm" plain />
<Button label={`Restore last swarm (${length})`} />
<Button label="+ Spawn agent" plain />
</Box>
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
await $.ui.status(`swarm worker "${name}" · reporting to the lead session`)
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.
hooks/register.js lines 1767–1773 · Pane
on('ui.render', { component: 'Pane' }, async ($, e, next) => {
if (e.requestId === MAIN) return renderMain($, e)
if (e.requestId === WIZARD) return renderWizard($, e)
if (e.requestId === ROSTERS) return renderRosters($, e)
if (typeof e.requestId === 'string' && e.requestId.startsWith(DETAIL)) return renderDetail($, e, e.requestId.slice(DETAIL.length))
return next(e)
})
hooks/register.js lines 1028–1148 · Pane
function renderMain($, e) {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const { list, working, attention, total } = counts()
const rows = []
rows.push(
Box({
key: 'head',
flexDirection: 'row',
columnGap: 1,
children: [
Text({ bold: true, color: '#c678dd', children: ['SWARM'] }),
Text({ dimColor: true, children: [list.length + ' agents · ' + working + ' working'] }),
...(attention ? [Text({ bold: true, color: '#ff5555', children: ['· ' + attention + ' need you'] })] : []),
],
}),
)
const liveCount = list.filter((a) => isLive(a) || a.restartAt).length
rows.push(
Box({
key: 'toolbar',
flexDirection: 'row',
columnGap: 2,
children: [
Button({ key: 'spawn', label: 'n: + Spawn agent', hotkey: 'n', onPress: () => openWizard($) }),
Button({ key: 'rosters', label: 'r: Rosters', hotkey: 'r', plain: true, onPress: () => openRosters($) }),
...(liveCount
? [Button({
key: 'kill-all',
label: killArmed ? 'k: Press again to kill ' + liveCount : 'k: Kill all',
hotkey: 'k',
...(killArmed ? {} : { plain: true }),
onPress: async () => {
if (!killArmed) {
killArmed = true
$.ui.invalidate('ui.render')
$.clock.after(6000, () => {
killArmed = false
$.ui.invalidate('ui.render')
})
return
}
await killAll($)
},
})]
: []),
],
}),
)
if (lastRoster && lastRoster.agents && lastRoster.agents.length) {
rows.push(
Button({
key: 'restore-last',
label: 'Restore last swarm here (' + lastRoster.agents.length + ' agents: ' + clip(lastRoster.agents.map((x) => x.name).join(', '), 50) + ')',
onPress: () => launchRoster($, lastRoster.agents, 'last swarm'),
}),
)
}
if (!list.length) {
rows.push(Text({ dimColor: true, children: ['No agents yet. Spawn one, or launch a saved roster (r).'] }))
}
for (const a of list) {
const sv = statusView(a)
rows.push(
Box({
key: 'row-' + a.key,
flexDirection: 'column',
children: [
Box({
flexDirection: 'row',
columnGap: 1,
children: [
Text({ color: a.color, children: ['●'] }),
Button({ key: 'open-' + a.key, label: a.name, plain: true, onPress: () => openDetail($, a.key) }),
a.status === 'failed'
? Button({ key: 'err-' + a.key, label: sv.glyph + ' ' + sv.word + ' · copy error', plain: true, onPress: async (press) => { await copyError($, a.key, press); await openDetail($, a.key) } })
: Text({ color: sv.color, bold: !!sv.bold, children: [sv.glyph + ' ' + sv.word] }),
...(a.pending
? [Button({ key: 'attn-' + a.key, label: a.pending.kind === 'approval' ? '! review' : '? answer', onPress: () => openDetail($, a.key) })]
: []),
],
}),
Text({
dimColor: true,
wrap: 'truncate-end',
children: [' ' + (a.activity || (a.transport === 'session' ? 'own window' : 'teammate')) + ' · ' + fmtTokens(totalTokens(a.tokens)) + ' tok' + (a.autoRestart ? ' · ↻' + (a.restarts ? ' ' + a.restarts + '/' + RESTART_MAX : '') : '')],
}),
],
}),
)
}
for (const c of conflicts) {
rows.push(Text({ key: 'conf-' + c.path, color: '#e5c07b', wrap: 'truncate-end', children: ['▲ ' + c.keys.map((k) => (agents[k] ? agents[k].name : k)).join(' & ') + ' both edited ' + baseName(c.path)] }))
}
if (list.length) {
rows.push(Text({ dimColor: true, children: ['total ' + fmtTokens(total) + ' tokens'] }))
rows.push(
Input({
key: 'broadcast',
label: 'Broadcast',
placeholder: 'message every live agent',
value: '',
submitLabel: 'send',
onSubmit: (v) => broadcast($, v),
}),
)
if (list.some((a) => !isLive(a))) {
rows.push(
Button({
key: 'clear-done',
label: 'x: Clear finished',
hotkey: 'x',
plain: true,
onPress: async () => {
for (const a of list) if (!isLive(a)) await removeAgent($, a.key)
},
}),
)
}
}
return Box({ flexDirection: 'column', gap: 0, children: rows })
}
hooks/register.js lines 1194–1246 · Pane
function renderWizard($, e) {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const redraw = () => $.ui.invalidate('ui.render')
if (!draft) {
return Box({ flexDirection: 'column', children: [Text({ dimColor: true, children: ['Nothing to spawn.'] }), Button({ key: 'w-close', label: 'Close', onPress: () => $.ui.close({ id: WIZARD }) })] })
}
const d = draft
const typeOptions = [{ value: 'default', label: 'Default (general-purpose)' }]
for (const t of [...BUILTIN_AGENTS.filter((b) => b !== 'general-purpose'), ...Object.keys(agentTypes).sort()]) {
if (!typeOptions.some((o) => o.value === t)) typeOptions.push({ value: t, label: t + (agentTypes[t] ? ' - ' + clip(agentTypes[t], 50) : '') })
}
const used = liveColors()
const colorOptions = PALETTE.filter((c) => !used.includes(c.hex) || c.hex === d.color).map((c) => ({ value: c.hex, label: c.name }))
const options = colorOptions.length ? colorOptions : PALETTE.map((c) => ({ value: c.hex, label: c.name }))
const notes = []
if (d.mode === 'teammate' && !d.teamsOn) {
notes.push(Text({ color: '#e5c07b', children: ['Agent teams are off (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1). It will run as a named background agent instead.'] }))
}
if (d.mode === 'teammate' && ['auto'].includes(d.approval)) {
notes.push(Text({ dimColor: true, children: ["Auto for a teammate follows the lead session's own mode."] }))
}
if (d.mode === 'session' && BUILTIN_AGENTS.includes(d.agentType) && d.agentType !== 'general-purpose') {
notes.push(Text({ dimColor: true, children: [d.agentType + ' is built in; a separate session starts as a normal session.'] }))
}
const ui = { Box, Text, Button }
const restartOptions = [{ value: 'off', label: 'Off' }, { value: 'on', label: 'Restart if it crashes or hangs (up to ' + RESTART_MAX + 'x)' }]
return Box({
flexDirection: 'column',
children: [
Text({ bold: true, children: ['Spawn a swarm agent'] }),
picker($, ui, { key: 'mode', label: 'Runs as', options: MODES, value: d.mode, next: 'w-agent', set: (v) => { d.mode = v } }),
picker($, ui, { key: 'agent', label: 'Agent', options: typeOptions, value: d.agentType, next: 'w-model', set: (v) => { d.agentType = v } }),
picker($, ui, { key: 'model', label: 'Model', options: MODELS, value: d.model, next: 'w-effort', set: (v) => { d.model = v } }),
picker($, ui, { key: 'effort', label: 'Thinking effort', options: EFFORTS, value: d.effort, next: 'w-name', set: (v) => { d.effort = v } }),
Input({ key: 'w-name', label: 'Name', placeholder: 'scout', value: d.name, onInput: (v) => { d.name = v }, onSubmit: (v) => { d.name = v; redraw() } }),
picker($, ui, { key: 'color', label: 'Color', options, value: d.color, next: 'w-approval', set: (v) => { d.color = v }, prefix: [Text({ color: d.color, children: ['●●●'] })] }),
picker($, ui, { key: 'approval', label: 'Approval mode', options: APPROVALS, value: d.approval, next: 'w-restart', set: (v) => { d.approval = v } }),
picker($, ui, { key: 'restart', label: 'Auto-restart', options: restartOptions, value: d.autoRestart ? 'on' : 'off', next: 'w-task', set: (v) => { d.autoRestart = v === 'on' } }),
Input({ key: 'w-task', label: 'Task', placeholder: d.mode === 'session' ? 'first prompt (optional)' : 'what should it work on?', value: d.task, onInput: (v) => { d.task = v }, onSubmit: (v) => { d.task = v; redraw() } }),
Text({ dimColor: true, wrap: 'truncate-middle', children: ['Workspace: ' + (d.cwd || 'this session’s directory')] }),
...notes,
...(wizardError ? [Text({ color: '#ff5555', children: [wizardError] })] : []),
Box({
flexDirection: 'row',
columnGap: 2,
children: [
Button({ key: 'w-spawn', label: 'Spawn ' + (String(d.name || '').trim() || 'agent'), onPress: () => spawnFromDraft($) }),
Button({ key: 'w-cancel', label: 'Cancel', onPress: async () => { draft = null; await $.ui.close({ id: WIZARD }) } }),
],
}),
],
})
}
hooks/register.js lines 1159–1192 · Pane
function picker($, ui, f) {
const { Box, Button } = ui
const cur = f.options.find((o) => o.value === f.value) || f.options[0]
const isOpen = openPick === f.key
const head = Button({
key: 'w-' + f.key,
label: f.label + ': ' + cur.label + (isOpen ? ' ▴' : ' ▾'),
plain: true,
onPress: async () => {
openPick = isOpen ? null : f.key
$.ui.invalidate('ui.render')
if (!isOpen) await moveFocus($, 'w-' + f.key + ':' + cur.value)
},
})
const rows = [f.prefix ? Box({ flexDirection: 'row', columnGap: 1, children: [...f.prefix, head] }) : head]
if (isOpen) {
rows.push(Box({
flexDirection: 'column',
paddingLeft: 2,
children: f.options.map((o) => Button({
key: 'w-' + f.key + ':' + o.value,
label: (o.value === cur.value ? '● ' : '○ ') + o.label,
plain: true,
onPress: async () => {
f.set(o.value)
openPick = null
$.ui.invalidate('ui.render')
await moveFocus($, f.next)
},
})),
}))
}
return Box({ key: 'f-' + f.key, flexDirection: 'column', children: rows })
}
hooks/register.js lines 1430–1479 · Pane
function renderRosters($, e) {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const rows = []
rows.push(Text({ bold: true, children: ['Saved rosters'] }))
rows.push(Text({ dimColor: true, children: ['A roster keeps each agent\'s name, color, type, model, effort, approval mode, transport, task and auto-restart. Launching one spawns them all in this workspace.'] }))
rows.push(
Input({
key: 'r-name',
label: 'Save this swarm as',
placeholder: 'roster name',
value: rosterNameDraft,
submitLabel: 'save',
onInput: (v) => { rosterNameDraft = v },
onSubmit: (v) => saveRoster($, v),
}),
)
if (rosterError) rows.push(Text({ color: '#ff5555', children: [rosterError] }))
if (!rosterList.length) rows.push(Text({ dimColor: true, children: ['No saved rosters yet.'] }))
for (const [i, r] of rosterList.entries()) {
const when = r.savedAt ? new Date(r.savedAt).toISOString().slice(0, 16).replace('T', ' ') : ''
rows.push(
Box({
key: 'roster-' + i,
flexDirection: 'column',
children: [
Box({
flexDirection: 'row',
columnGap: 2,
children: [
Text({ bold: true, children: [r.name] }),
Button({ key: 'rl-' + i, label: 'Launch', onPress: async () => { await $.ui.close({ id: ROSTERS }); await launchRoster($, r.agents, r.name) } }),
Button({ key: 'rd-' + i, label: 'Delete', plain: true, onPress: () => deleteRoster($, r.name) }),
],
}),
Box({
flexDirection: 'row',
columnGap: 1,
children: [
Text({ dimColor: true, children: [' '] }),
...r.agents.slice(0, 8).map((x, j) => Text({ key: 'dot-' + j, color: x.color, children: ['● ' + x.name] })),
Text({ dimColor: true, wrap: 'truncate-end', children: [(r.agents.length > 8 ? '+' + (r.agents.length - 8) + ' · ' : '') + when + (r.cwd ? ' · from ' + baseName(String(r.cwd).replace(/[\\/]+$/, '')) : '')] }),
],
}),
],
}),
)
}
rows.push(Button({ key: 'r-close', label: 'c: Close', hotkey: 'c', plain: true, onPress: () => $.ui.close({ id: ROSTERS }) }))
return Box({ flexDirection: 'column', children: rows })
}
hooks/register.js lines 1248–1407 · Pane
async function renderDetail($, e, key) {
const { Box, Text, Button, Input, Markdown } = $.ui.resolve(e)
const a = agents[key]
if (!a) {
return Box({ flexDirection: 'column', children: [Text({ dimColor: true, children: ['This agent is no longer in the swarm.'] }), Button({ key: 'close', label: 'Close', onPress: () => $.ui.close({ id: e.requestId }) })] })
}
const sv = statusView(a)
const t = a.tokens || emptyTokens()
const parts = []
parts.push(
Box({
flexDirection: 'row',
columnGap: 1,
children: [
Text({ color: a.color, children: ['●'] }),
Text({ bold: true, color: a.color, children: [a.name] }),
Text({ dimColor: true, children: ['· ' + (a.transport === 'session' ? 'separate session' : a.teammateId ? 'teammate ' + a.teammateId : 'teammate')] }),
],
}),
)
parts.push(Text({ dimColor: true, wrap: 'truncate-end', children: [a.agentType + ' · ' + labelOf(MODELS, a.model) + (a.resolvedModel ? ' (' + a.resolvedModel + ')' : '') + ' · effort ' + a.effort + ' · ' + labelOf(APPROVALS, a.approval) + ' · ' + colorName(a.color)] }))
parts.push(Text({ color: sv.color, bold: !!sv.bold, children: [sv.glyph + ' ' + sv.word + (a.activity ? ' · ' + a.activity : '')] }))
parts.push(Text({ children: ['tokens ' + fmtTokens(totalTokens(t)) + ' (in ' + fmtTokens(t.input) + ' · out ' + fmtTokens(t.output) + ' · cache read ' + fmtTokens(t.cacheRead) + ' · cache write ' + fmtTokens(t.cacheWrite) + ') ctx ' + fmtTokens(a.ctx) + ' · ' + (a.turns || 0) + ' turns'] }))
if (a.status === 'failed' && a.error) {
parts.push(
Box({
key: 'error',
flexDirection: 'column',
borderStyle: 'round',
paddingX: 1,
children: [
Text({ bold: true, color: '#ff5555', children: ['✕ Error'] }),
Text({ children: [a.error.length > 4000 ? a.error.slice(0, 4000) + '…' : a.error] }),
Button({ key: 'copy-error', label: 'o: Copy error', hotkey: 'o', plain: true, onPress: (press) => copyError($, key, press) }),
],
}),
)
}
for (const c of conflicts.filter((c) => c.keys.includes(key))) {
parts.push(Text({ color: '#e5c07b', children: ['▲ also edited by ' + c.keys.filter((k) => k !== key).map((k) => (agents[k] ? agents[k].name : k)).join(', ') + ': ' + c.path] }))
}
const p = a.pending
if (p && p.kind === 'approval') {
parts.push(
Box({
key: 'approval',
flexDirection: 'column',
borderStyle: 'round',
paddingX: 1,
children: [
Text({ bold: true, color: '#ff5555', children: ['! ' + a.name + ' wants to use ' + p.tool] }),
...(p.reason ? [Text({ dimColor: true, children: [p.reason] })] : []),
Text({ children: [clip(p.detail || p.summary, 1500)] }),
Box({
flexDirection: 'row',
columnGap: 2,
children: [
Button({ key: 'ap-allow', label: 'y: Approve', hotkey: 'y', onPress: () => resolvePending($, key, { decision: 'allow' }) }),
Button({ key: 'ap-deny', label: 'd: Deny', hotkey: 'd', onPress: () => resolvePending($, key, { decision: 'deny' }) }),
Button({ key: 'ap-native', label: 'l: Use its own prompt', hotkey: 'l', onPress: () => resolvePending($, key, { decision: 'native' }) }),
],
}),
],
}),
)
} else if (p && p.kind === 'question') {
const answers = qDraft[p.reqId] || (qDraft[p.reqId] = {})
const qs = p.questions || []
const qBlocks = qs.map((q, qi) =>
Box({
key: 'q-' + qi,
flexDirection: 'column',
children: [
Text({ bold: true, children: [(q.header ? '[' + q.header + '] ' : '') + q.question] }),
...(q.options || []).map((o, oi) => {
const chosen = String(answers[q.question] || '').split(', ').includes(o.label)
return Button({
key: 'q-' + qi + '-' + oi,
label: (chosen ? '✓ ' : ' ') + o.label + (o.description ? ' - ' + clip(o.description, 60) : ''),
plain: true,
onPress: () => {
if (q.multiSelect) {
const cur = String(answers[q.question] || '').split(', ').filter(Boolean)
answers[q.question] = (cur.includes(o.label) ? cur.filter((x) => x !== o.label) : [...cur, o.label]).join(', ')
} else {
answers[q.question] = o.label
}
$.ui.invalidate('ui.render')
},
})
}),
Input({ key: 'q-' + qi + '-other', label: 'Other', placeholder: 'type your own answer', value: '', onSubmit: (v) => { if (String(v).trim()) { answers[q.question] = String(v).trim(); $.ui.invalidate('ui.render') } } }),
],
}),
)
const ready = qs.every((q) => answers[q.question])
parts.push(
Box({
key: 'question',
flexDirection: 'column',
borderStyle: 'round',
paddingX: 1,
children: [
Text({ bold: true, color: '#ff79c6', children: ['? ' + a.name + ' is asking'] }),
...qBlocks,
Box({
flexDirection: 'row',
columnGap: 2,
children: [
Button({ key: 'q-send', label: ready ? 'Send answers' : 'Answer every question first', dimColor: !ready, onPress: () => (ready ? resolvePending($, key, { answers: { ...answers } }) : undefined) }),
Button({ key: 'q-native', label: 'Use its own prompt', plain: true, onPress: () => resolvePending($, key, { decision: 'native' }) }),
],
}),
],
}),
)
}
// Recent activity, and the conversation when this process can read it
const recent = (a.log || []).slice(expanded[key] ? -20 : -8)
if (recent.length) {
parts.push(Text({ bold: true, children: ['Recent'] }))
for (const [i, l] of recent.entries()) parts.push(Text({ key: 'log-' + i, dimColor: true, wrap: 'truncate-end', children: [' ' + l.text] }))
}
if (a.transport === 'teammate' && a.agentId && expanded[key]) {
try {
const msgs = await $.session.messages({ agentId: a.agentId })
if (Array.isArray(msgs) && msgs.length) {
parts.push(Text({ bold: true, children: ['Conversation'] }))
for (const [i, m] of msgs.slice(-8).entries()) {
const tools = (m.toolUses || []).map((u) => summarizeTool(u.tool, u.input)).join('; ')
const line = (m.role === 'assistant' ? a.name : 'in') + ': ' + clip(m.text || tools || '(tool results)', 300)
parts.push(Text({ key: 'msg-' + i, color: m.role === 'assistant' ? a.color : undefined, dimColor: m.role !== 'assistant', children: [line] }))
}
}
} catch {}
}
if (a.lastAnswer) {
parts.push(Text({ bold: true, children: ['Last answer'] }))
parts.push(Markdown({ key: 'answer', text: clip(a.lastAnswer, expanded[key] ? 6000 : 1200) }))
}
parts.push(
Input({
key: 'msg',
label: 'Message',
placeholder: 'send ' + a.name + ' a message',
value: '',
submitLabel: 'send',
onSubmit: (v) => sendTo($, key, v),
}),
)
const actions = []
const live = isLive(a) || !!a.restartAt
if (a.transport === 'session' && isLive(a)) {
actions.push(Button({ key: 'focus', label: 'w: Open its window', hotkey: 'w', onPress: () => focusWindow($, key) }))
actions.push(Button({ key: 'interrupt', label: 'i: Interrupt', hotkey: 'i', onPress: () => stopAgent($, key) }))
}
if (live) actions.push(Button({ key: 'kill', label: 'k: Kill', hotkey: 'k', onPress: () => killAgent($, key) }))
Licence text (MIT)
MIT License Copyright (c) 2026 Michael Dobekidis 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 programswrites filesenv 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 7cebf7287aee 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.hooks/register.js |
| Parses | Every file parses as TypeScript or JavaScript.2 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).hooks/register.js:86 uname (not on Windows); hooks/register.js:799 chmod (not on Windows) |
| 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.hooks/register.js:130 a program named at run time; hooks/register.js:195 a program named at run time; hooks/register.js:250 a program named at run time; hooks/register.js:392 a program named at run time; hooks/register.js:395 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 netgfx/claude-swarm-mod/plugin install swarm-mod@claude-swarm-modThis installs the marketplace's latest commit, which may not be the one read here (7cebf7287aee). 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 "netgfx-swarm-mod" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
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…AgentsNo subagents yetmain: 3 3 · 2h 10m ago────────Each subagent shows here the moment it starts, with what it is doing now.›● 3 build build 3›● 3 build build 3›● 3 build build 3buildAgentsbuild1-9 picks an agent · Tab walks the controls · Esc gives the keyboard back14:32 3 314:32 3 314:32 3 3No tool calls yet.Answer: StopMessage this agent… SendStopBack b
-
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…GTM board1 Board2 Detail3 Health (3)4 Views5 Analytics[build][build][build]Call this week (3) Fix login — Hold Fix login — Hold Fix login — Hold +3 moreHold (3) Fix login — Hold Fix login — Hold Fix login — Hold +3 moreDrop (3) Fix login — Hold Fix login — Hold Fix login — Hold +3 moreNot scored (3) Fix login — Hold Fix login — Hold Fix login — Hold +3 more