Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / agent-bus

agent-bus

A message bus between agent sessions: mail is served between tool calls, a Monitor wakes an idle agent, urgent mail can be typed into Orca terminals, a /bus chat pane, an unread band and a localhost web chat show it all. Built on orca-bus.

Code you can checkTerminal + desktopPaneBandToastBoxButtonClientInputText
runs programs, draws

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /bus
  • Hooks classic.PostToolUse, classic.SessionStart, classic.Stop, session.start and 2 more
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors
  • Writes no files

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)

register.tsx
import type { Register } from 'claude-code'

// Drawn like agent-bus by Azoof Ahmed (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/azoof-ahmed-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 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 unread = '…'
    const at = '…'
    return (
      <Box flexDirection="column">
        <Box gap={1}>
          <Text bold>
            bus:
          </Text>
          <Text>
            {unread}
            {" unread"}
          </Text>
          <Text>
            {"· "}
            {at}
            {" @you"}
          </Text>
          <Button label="Open" />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Bus" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Client } = $.ui.resolve(e)
    const unread = '…'
    const mentions = '…'
    const age = '…'
    const marks = '…'
    const time = '…'
    const who = '…'
    const tick = '…'
    const rx = '…'
    const marks2 = '…'
    const time2 = '…'
    const who2 = '…'
    const tick2 = '…'
    const marks3 = '…'
    const time3 = '…'
    const who3 = '…'
    const tick3 = '…'
    const note = '…'
    const n = '…'
    const em = '…'
    const r = '…'
    return (
      <Box flexDirection="column">
        <Box gap={1}>
          <Text bold>
            bus
          </Text>
          <Text>
            user
          </Text>
          <Text>
            ●
            {unread}
          </Text>
          <Text>
            @
            {mentions}
          </Text>
          <Text>
            dlv✓
          </Text>
          <Text dimColor>
            {age}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="column">
            <Button plain>
              <Text>
                ›
              </Text>
              <Text>
                {marks}
              </Text>
              <Text dimColor>
                {time}
                {" "}
              </Text>
              <Text>
                {who}
              </Text>
              <Text>
                {tick}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {`↳(deleted) ¶ ${rx}`}
              </Text>
            </Button>
            <Box flexDirection="column" paddingLeft={2} />
          </Box>
          <Box flexDirection="column">
            <Button plain>
              <Text>
                ›
              </Text>
              <Text>
                {marks2}
              </Text>
              <Text dimColor>
                {time2}
                {" "}
              </Text>
              <Text>
                {who2}
              </Text>
              <Text>
                {tick2}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {`↳(deleted) ¶ ${rx}`}
              </Text>
            </Button>
            <Box flexDirection="column" paddingLeft={2} />
          </Box>
          <Box flexDirection="column">
            <Button plain>
              <Text>
                ›
              </Text>
              <Text>
                {marks3}
              </Text>
              <Text dimColor>
                {time3}
                {" "}
              </Text>
              <Text>
                {who3}
              </Text>
              <Text>
                {tick3}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {`↳(deleted) ¶ ${rx}`}
              </Text>
            </Button>
            <Box flexDirection="column" paddingLeft={2} />
          </Box>
        </Box>
        <Text wrap="truncate-end">
          {note}
        </Text>
        <Box gap={1}>
          <Button plain hotkey={`${n}`} label={`${em}`} />
          <Button plain hotkey={`${n}`} label={`${em}`} />
          <Button plain hotkey={`${n}`} label={`${em}`} />
        </Box>
        <Box gap={1}>
          <Button plain label={`@${r}`} />
          <Button plain label={`@${r}`} />
          <Button plain label={`@${r}`} />
        </Box>
        <Text dimColor>
          this surface has no text field: compose with /bus send
        </Text>
        <Box gap={1}>
          <Button plain hotkey="j" label="↓" />
          <Button plain hotkey="k" label="↑" />
          <Button plain hotkey="o" label="open" />
          <Button plain hotkey="r" label="reply" />
          <Button plain hotkey="e" label="react" />
          <Button plain hotkey="x" label="cancel" />
          <Button plain hotkey="q" label="close" />
        </Box>
        <Client module="./keys.tsx" />
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const from = '…'
    const text = '…'
    await $.ui.toast(`↳ ${from}: ${text}`)
    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-bus/hooks/register.tsx lines 499–515 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (!cfg.band || paneOpen || e.props.hasSurvey) return next(e)
    const s = await read($, snap)
    const unread = s?.unread ?? 0
    const at = s?.mentions ?? 0
    if (!s?.bus || (unread === 0 && at === 0)) return next(e)
    const { Box, Text, Button } = $.ui.resolve(e)
    const t = cfg.theme
    return (
      <Box gap={1}>
        <Text key="bus-band" bold color={t.accent}>bus:</Text>
        <Text key="bus-unread">{unread} unread</Text>
        {at > 0 && <Text key="bus-at" color={t.warn}>· {at} @you</Text>}
        <Button key="bus-open" label="Open" onPress={async () => { await openPane($) }} />
      </Box>
    )
  })
agent-bus/hooks/register.tsx lines 519–678 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    ensurePolling($)
    const els = $.ui.resolve(e)
    const { Box, Text, Button } = els
    const Input = 'Input' in els ? els.Input : null
    const Client = 'Client' in els ? els.Client : null
    const t = cfg.theme
    const s = await read($, snap)
    const err = await read($, error)
    const cols = Math.max(20, e.props.bodyColumns)
    const bodyRows = Math.max(8, e.props.scroll?.bodyRows ?? e.viewport?.rows ?? 24)

    if (!s) {
      return (
        <Box flexDirection="column">
          <Text color={err ? t.err : t.dim}>{err ?? 'loading the bus…'}</Text>
          <Button key="retry" hotkey="g" label="retry" onPress={async () => { await refresh($, true) }} />
        </Box>
      )
    }
    if (!s.bus) {
      return (
        <Box flexDirection="column">
          <Text>No bus in this project.</Text>
          <Text dimColor>`/bus init` creates {s.dir ?? '.claude/bus'}</Text>
          <Text dimColor>A bus elsewhere: set "busDir" under "agent-bus" in .claude/claude-mods.json</Text>
        </Box>
      )
    }

    const ms = messages(s)
    const sel = selIndex(ms, await read($, selected))
    const ex = await read($, expanded)
    const md = await read($, mode)
    const dr = await read($, draft)
    const re = await read($, replyTo)
    const note = await read($, notice)
    const roles = (s.roles ?? []).map(r => r.name)
    const health = s.health
    const nameW = cols < 50 ? 8 : 11

    // header: who, unread, @you, bus health
    const header = (
      <Box key="hdr" gap={1}>
        <Text bold color={t.accent}>bus</Text>
        <Text color={t.me}>{ME}</Text>
        {(s.unread ?? 0) > 0 && <Text color={t.ok}>●{s.unread}</Text>}
        {(s.mentions ?? 0) > 0 && <Text color={t.warn}>@{s.mentions}</Text>}
        <Text color={health?.deliver ? t.ok : t.dim}>{health?.deliver ? 'dlv✓' : 'dlv·'}</Text>
        {health?.last_write_age !== null && health?.last_write_age !== undefined && (
          <Text dimColor>{age(health.last_write_age)}</Text>
        )}
      </Box>
    )

    // the expanded message's lines
    const exMsg = ex ? ms.find(m => m.id === ex.id) : undefined
    const detail: RenderChildren[] = []
    if (exMsg && ex) {
      detail.push(<Text key="d-text" wrap="wrap">{exMsg.deleted ? '(deleted)' : exMsg.text}</Text>)
      const dest = [...exMsg.to, ...exMsg.cc.map(c => `cc ${c}`)].join(', ') || (exMsg.chan ? `#${exMsg.chan}` : '#all')
      detail.push(<Text key="d-to" dimColor wrap="truncate-end">{`${exMsg.id} → ${dest}${exMsg.topic ? ` [${exMsg.topic}]` : ''}`}</Text>)
      if (exMsg.receipts.length > 0) {
        detail.push(
          <Text key="d-rc" wrap="wrap" color={t.dim}>
            {exMsg.receipts.map(r => `${r.to} ${r.tick} ${r.r}`).join(' · ')}
          </Text>,
        )
      }
      const rx = Object.entries(exMsg.reactions).filter(([, by]) => by.length > 0)
      if (rx.length > 0) {
        detail.push(<Text key="d-rx" wrap="wrap">{rx.map(([em, by]) => `${em} ${by.join(',')}`).join('  ')}</Text>)
      }
      if (exMsg.body) {
        const lines = ex.loading ? ['(loading body…)'] : (ex.body ?? '').split('\n').slice(0, 60)
        lines.forEach((l, n) => detail.push(<Text key={`d-b${n}`} wrap="wrap">{l === '' ? ' ' : l}</Text>))
      }
    }

    // rows that fit: the bottom block is the composer, the key bar, the key region and one optional row
    const extra = (md === 'react' ? 1 : 0) + (completions(dr, roles).length > 0 ? 1 : 0) + (note || err ? 1 : 0)
    const fit = Math.max(1, bodyRows - 4 - extra - (exMsg ? Math.min(detail.length, bodyRows - 6) : 0))
    const start = Math.max(0, Math.min(sel - Math.floor(fit / 2), ms.length - fit))
    const shown = ms.slice(start, start + fit)

    const rows = shown.map((m, n) => {
      const idx = start + n
      const isSel = idx === sel
      const mine = m.from === ME
      const who = mine ? `→${m.to[0] ?? (m.chan ? `#${m.chan}` : '#all')}` : m.from
      const marks = `${m.unread ? '●' : ' '}${m.mention || m.reply_to_me ? '@' : ' '}`
      const tick = mine ? ` ${tickOf(m)}` : ''
      const rx = Object.entries(m.reactions).filter(([, by]) => by.length > 0).map(([em]) => em).join('')
      return (
        <Box key={`row-${m.id}`} flexDirection="column">
          <Button key={`msg-${m.id}`} plain onPress={async () => { await update($, selected, () => m.id); await expand($, m) }}>
            <Text color={isSel ? t.accent : undefined} bold={isSel}>{isSel ? '›' : ' '}</Text>
            <Text color={m.mention || m.reply_to_me ? t.warn : t.ok}>{marks}</Text>
            <Text dimColor>{m.time.slice(11, 16)} </Text>
            <Text color={mine ? t.me : t.accent}>{short(who, nameW)}</Text>
            <Text color={t.dim}>{tick} </Text>
            <Text backgroundColor={isSel ? t.selBg : undefined} wrap="truncate-end">
              {`${m.reply_to ? '↳' : ''}${m.deleted ? '(deleted)' : m.text}${m.body ? ' ¶' : ''}${rx ? ` ${rx}` : ''}`}
            </Text>
          </Button>
          {ex && ex.id === m.id && (
            <Box key={`det-${m.id}`} flexDirection="column" paddingLeft={2}>
              {detail}
            </Box>
          )}
        </Box>
      )
    })

    const sugg = completions(dr, roles)
    const parent = re ? ms.find(m => m.id === re) : undefined

    return (
      <Box flexDirection="column">
        {header}
        {ms.length === 0 ? <Text key="empty" dimColor>No messages yet.</Text> : <Box key="list" flexDirection="column">{rows}</Box>}
        {(note || err) && <Text key="note" color={err ? t.err : t.dim} wrap="truncate-end">{err ?? note}</Text>}
        {md === 'react' && (
          <Box key="react-row" gap={1}>
            {EMOJI.map((em, n) => (
              <Button key={`rx-${n + 1}`} plain hotkey={String(n + 1)} label={em} onPress={async () => { await react($, em) }} />
            ))}
          </Box>
        )}
        {sugg.length > 0 && (
          <Box key="ac-row" gap={1}>
            {sugg.map(r => (
              <Button
                key={`ac-${r}`}
                plain
                label={`@${r}`}
                onPress={async () => {
                  await update($, draft, d => d.replace(/@[\w.-]*$/, `@${r} `))
                  await focusComposer($)
                }}
              />
            ))}
          </Box>
        )}
        {Input ? (
          <Input
            key="composer"
            label={parent ? `↳${short(parent.from, 10)} ` : '› '}
            placeholder={cols < 50 ? '@role message' : '@role message · Enter sends'}
            value={dr}
            submitLabel="send"
            onInput={async (v: string) => { await update($, draft, () => v) }}
            onSubmit={async (v: string) => { await sendDraft($, v) }}
          />
        ) : (
          <Text key="no-input" dimColor>this surface has no text field: compose with /bus send</Text>
        )}
        <Box key="keybar" gap={1}>
          <Button key="k-down" plain hotkey="j" label="↓" onPress={async () => { await act($, 'down') }} />
          <Button key="k-up" plain hotkey="k" label="↑" onPress={async () => { await act($, 'up') }} />
Licence text (MIT)
MIT License

Copyright (c) 2026 Azoof Ahmed

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), Add a slash command

What its code calls

runs programsreads filesenv vars

What its code shows

Read from the source at commit 2a5a52f44009 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 readEvery module hooks/hooks.json names was read.agent-bus/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo 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 openNetwork 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 drawsThe 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 lineWhether 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 WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.agent-bus/hooks/register.tsx:69 a program named at run time
Reads and sendsWhether 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, files, but reaches nothing outside
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn 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 hooksHooks 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 shipsMCP 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, agentsWhat 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.skill agent-bus: runs a command before Claude reads it
Tools and MCPWhether 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 modelCompletions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.adds command bus
Events it hooksBy 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: command.run (bus), classic.Stop · reads: ui.message, classic.SessionStart, classic.PostToolUse · also: session.start, ui.close, ui.render (AbovePrompt, Pane) · timers: clock.every
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.env: AGENT_BUS_ROLE; files: …/inbox/….jsonl
Writes, by nameThe 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.env: AGENT_BUS_DIR, AGENT_BUS_BACKEND, AGENT_BUS_NUDGE_AFTER, AGENT_BUS_CHAT_PORT, AGENT_BUS_CHAT_BIND (+7)

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 azoof-ahmed/claude-mods
/plugin install agent-bus@claude-mods
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (2a5a52f44009). 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/azoof-ahmed/claude-mods
git -C claude-mods checkout 2a5a52f440094b38521bc8474cee663490b03c87
claude plugin validate claude-mods/agent-bus
claude --plugin-dir claude-mods/agent-bus

The 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 "azoof-ahmed-agent-bus" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More from this repository

Badge for your README

If this is your mod, paste this into your README. It links to this page.

README.md
[![ModsCode](https://modscode.com/badge/azoof-ahmed-agent-bus.svg)](https://modscode.com/claude-mods/mods/azoof-ahmed-agent-bus/)