modscode JA

modscode / Gallery / subagents-monitor

subagents-monitor

Live side pane listing the session's subagents: status, elapsed and working time, model, effort and estimated cost.

Code you can checkTerminal + desktopPaneStatus lineBoxText

What it does

  • Draws a pane
  • Adds /subagents
  • Watches tool calls
  • Hooks agent.spawn, session.start, turn.complete, turn.step

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • 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)

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

// Drawn like subagents-monitor by Fazzani (pane, status), as modscode read it from the mod's code:
// https://modscode.com/gallery/fazzani-subagents-monitor/
// 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: "‹title›" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const heading = '…'
    const spin = '…'
    const working = '…'
    const done = '…'
    const failed = '…'
    const emptyTitle = '…'
    const emptyHint = '…'
    const spin2 = '…'
    const description = '…'
    const status = '…'
    const type = '…'
    const shortModel = '…'
    const effort = '…'
    const background = '…'
    const full = '…'
    const empty = '…'
    const clock = '…'
    const clock2 = '…'
    const tokens = '…'
    const tokens2 = '…'
    const usd = '…'
    const spin3 = '…'
    const description2 = '…'
    const status2 = '…'
    const type2 = '…'
    const shortModel2 = '…'
    const effort2 = '…'
    const background2 = '…'
    const full2 = '…'
    const empty2 = '…'
    const clock3 = '…'
    const clock4 = '…'
    const tokens3 = '…'
    const tokens4 = '…'
    const usd2 = '…'
    const spin4 = '…'
    const description3 = '…'
    const status3 = '…'
    const type3 = '…'
    const shortModel3 = '…'
    const effort3 = '…'
    const background3 = '…'
    const full3 = '…'
    const empty3 = '…'
    const clock5 = '…'
    const clock6 = '…'
    const tokens5 = '…'
    const tokens6 = '…'
    const usd3 = '…'
    const footerSubagents = '…'
    const sum = '…'
    const costUsd = '…'
    const footerSession = '…'
    const usd4 = '…'
    const legend = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" justifyContent="space-between">
          <Text bold color="#D97757">
            {heading}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Text color="#58A6FF">
              {spin}
              {" "}
              {working}
            </Text>
            <Text color="#3FB950">
              {"✓ "}
              {done}
            </Text>
            <Text color="#F85149">
              {"✗ "}
              {failed}
            </Text>
          </Box>
        </Box>
        <Text dimColor>
          ────────
        </Text>
        <Box flexDirection="column" paddingY={1}>
          <Text dimColor>
            {emptyTitle}
          </Text>
          <Text dimColor>
            {emptyHint}
          </Text>
        </Box>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexShrink={1}>
              <Text bold>
                {spin2}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {description}
              </Text>
            </Box>
            <Text bold>
              {" "}
              {status}
            </Text>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Text color="#D97757">
              {type}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text>
              {shortModel}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text italic>
              {effort}
            </Text>
            <Text dimColor>
              {"· "}
              {background}
            </Text>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexDirection="row">
              <Text>
                {full}
              </Text>
              <Text dimColor>
                {empty}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1}>
              <Text dimColor>
                ⏱
              </Text>
              <Text>
                {clock}
              </Text>
              <Text dimColor>
                ⚡
              </Text>
              <Text>
                {clock2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Text dimColor>
              {tokens}
              {" "}
              {tokens2}
            </Text>
            <Text color="#3FB950">
              ≈
              {usd}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexShrink={1}>
              <Text bold>
                {spin3}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {description2}
              </Text>
            </Box>
            <Text bold>
              {" "}
              {status2}
            </Text>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Text color="#D97757">
              {type2}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text>
              {shortModel2}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text italic>
              {effort2}
            </Text>
            <Text dimColor>
              {"· "}
              {background2}
            </Text>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexDirection="row">
              <Text>
                {full2}
              </Text>
              <Text dimColor>
                {empty2}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1}>
              <Text dimColor>
                ⏱
              </Text>
              <Text>
                {clock3}
              </Text>
              <Text dimColor>
                ⚡
              </Text>
              <Text>
                {clock4}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Text dimColor>
              {tokens3}
              {" "}
              {tokens4}
            </Text>
            <Text color="#3FB950">
              ≈
              {usd2}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" borderStyle="round" paddingX={1}>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexShrink={1}>
              <Text bold>
                {spin4}
                {" "}
              </Text>
              <Text wrap="truncate-end">
                {description3}
              </Text>
            </Box>
            <Text bold>
              {" "}
              {status3}
            </Text>
          </Box>
          <Box flexDirection="row" gap={1}>
            <Text color="#D97757">
              {type3}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text>
              {shortModel3}
            </Text>
            <Text dimColor>
              ·
            </Text>
            <Text italic>
              {effort3}
            </Text>
            <Text dimColor>
              {"· "}
              {background3}
            </Text>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Box flexDirection="row">
              <Text>
                {full3}
              </Text>
              <Text dimColor>
                {empty3}
              </Text>
            </Box>
            <Box flexDirection="row" gap={1}>
              <Text dimColor>
                ⏱
              </Text>
              <Text>
                {clock5}
              </Text>
              <Text dimColor>
                ⚡
              </Text>
              <Text>
                {clock6}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row" justifyContent="space-between">
            <Text dimColor>
              {tokens5}
              {" "}
              {tokens6}
            </Text>
            <Text color="#3FB950">
              ≈
              {usd3}
            </Text>
          </Box>
        </Box>
        <Text dimColor>
          ────────
        </Text>
        <Box flexDirection="row" justifyContent="space-between">
          <Text dimColor>
            {footerSubagents}
            {" ≈"}
            {`${sum}${costUsd}`}
          </Text>
          <Text dimColor>
            {footerSession}
            {" "}
            {usd4}
          </Text>
        </Box>
        <Text dimColor>
          {legend}
        </Text>
      </Box>
    )
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

plugins/subagents-monitor/hooks/register.tsx lines 324–448 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const m = t()
    const list = (await read($, agents)) ?? []
    const at = Math.max(await read($, now), ...list.map(row => row.endedAt ?? row.startedAt))
    const total = await read($, sessionUsd)
    const width = Math.max(28, e.props.bodyColumns)
    const isNarrow = width < 44

    const working = list.filter(row => row.status === 'working').length
    const done = list.filter(row => row.status === 'done').length
    const failed = list.length - working - done
    const estimated = list.reduce((sum, row) => sum + row.costUsd, 0)

    const byId = new Map(list.map(row => [row.id, row]))
    const ordered = [...list].sort((a, b) => {
      const live = Number(b.status === 'working') - Number(a.status === 'working')

      return live !== 0 ? live : b.startedAt - a.startedAt
    })
    const spin = SPINNER[Math.floor(at / 1000) % SPINNER.length]

    return (
      <Box flexDirection="column" width={width}>
        <Box flexDirection="row" justifyContent="space-between">
          <Text bold color={ACCENT}>
            {m.heading}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Text color={COLORS.working}>
              {working > 0 ? spin : '●'} {working}
            </Text>
            <Text color={COLORS.done}>✓ {done}</Text>
            {failed > 0 && <Text color={COLORS.failed}>✗ {failed}</Text>}
          </Box>
        </Box>
        <Text dimColor>{'─'.repeat(width)}</Text>

        {list.length === 0 && (
          <Box flexDirection="column" paddingY={1}>
            <Text dimColor>{m.emptyTitle}</Text>
            <Text dimColor>{m.emptyHint}</Text>
          </Box>
        )}

        {ordered.map(row => {
          const color = COLORS[row.status]
          const isLive = row.status === 'working'
          const elapsed = elapsedOf(row, at)
          const work = workingOf(row, at)
          const [full, empty] = bar(elapsed === 0 ? 0 : work / elapsed, isNarrow ? 6 : 10)
          const indent = depthOf(row, byId) * 2

          return (
            <Box
              key={`agent-${row.id}`}
              flexDirection="column"
              borderStyle="round"
              borderColor={color}
              borderDimColor={!isLive}
              paddingX={1}
              marginLeft={indent}
            >
              <Box flexDirection="row" justifyContent="space-between">
                <Box flexShrink={1}>
                  <Text color={color} bold>
                    {isLive ? spin : GLYPHS[row.status]}{' '}
                  </Text>
                  <Text bold={isLive} wrap="truncate-end">
                    {row.description}
                  </Text>
                </Box>
                <Text color={color} bold>
                  {' '}
                  {m.status[row.status]}
                </Text>
              </Box>

              <Box flexDirection="row" gap={1}>
                <Text color={ACCENT}>{row.type}</Text>
                <Text dimColor>·</Text>
                <Text>{shortModel(row.model)}</Text>
                {row.effort && (
                  <>
                    <Text dimColor>·</Text>
                    <Text italic>{row.effort}</Text>
                  </>
                )}
                {row.isBackground && <Text dimColor>· {m.background}</Text>}
              </Box>

              <Box flexDirection="row" justifyContent="space-between">
                <Box flexDirection="row">
                  <Text color={color}>{full}</Text>
                  <Text dimColor>{empty}</Text>
                </Box>
                <Box flexDirection="row" gap={1}>
                  <Text dimColor>⏱</Text>
                  <Text>{clock(elapsed)}</Text>
                  <Text dimColor>⚡</Text>
                  <Text>{clock(work)}</Text>
                </Box>
              </Box>

              <Box flexDirection="row" justifyContent="space-between">
                <Text dimColor>{tokens(row.tokens)} {m.tokens}</Text>
                <Text color={COLORS.done}>≈{usd(row.costUsd)}</Text>
              </Box>
            </Box>
          )
        })}

        {list.length > 0 && (
          <>
            <Text dimColor>{'─'.repeat(width)}</Text>
            <Box flexDirection="row" justifyContent="space-between">
              <Text dimColor>{m.footerSubagents} ≈{usd(estimated)}</Text>
              {total !== null && <Text dimColor>{m.footerSession} {usd(total)}</Text>}
            </Box>
            <Text dimColor>{m.legend}</Text>
          </>
        )}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Heni Fazzani

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

env varsdrives Claudetool calls

What its code shows

Read from the source at commit 6a268fb607b9 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 readEvery module hooks/hooks.json names was read.plugins/subagents-monitor/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.5 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.starts no programs
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no network
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

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 Fazzani/claude-mods
/plugin install subagents-monitor@claude-mods

This installs the marketplace's latest commit, which may not be the one read here (6a268fb607b9). 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 "fazzani-subagents-monitor" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs