Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / agent-map

agent-map

Agent Map: every Claude Code session on this computer and what each one started (subagents, background shells, loops), what needs you or may be stuck, a Peek on any of them with actions, tasks and a launcher. Reads savvy-progress and fligh…

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputText
writes files, runs programs, draws

What it does

  • Draws a pane, toasts
  • Adds /agent-map
  • Watches tool calls and can refuse them
  • Hooks agent.offer, agent.spawn, classic.Stop, prompt.submit and 4 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • 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)

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

// Drawn like agent-map by Hillman Chan (pane, band, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/chifunghillmanchan-agent-map/
// 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: "Agent Map" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const label = '…'
    const spin = '…'
    const zoom = '…'
    const glyphOf = '…'
    const padEnd = '…'
    const time = '…'
    const l = '…'
    const p = '…'
    const p2 = '…'
    const p3 = '…'
    const glyphOf2 = '…'
    const m = '…'
    const p4 = '…'
    const p5 = '…'
    const p6 = '…'
    const glyphOf3 = '…'
    const p7 = '…'
    const p8 = '…'
    const p9 = '…'
    const glyphOf4 = '…'
    const glyphOf5 = '…'
    const p10 = '…'
    const p11 = '…'
    const p12 = '…'
    const glyphOf6 = '…'
    const p13 = '…'
    const p14 = '…'
    const p15 = '…'
    const glyphOf7 = '…'
    const p16 = '…'
    const p17 = '…'
    const p18 = '…'
    const glyphOf8 = '…'
    const glyphOf9 = '…'
    const p19 = '…'
    const p20 = '…'
    const p21 = '…'
    const glyphOf10 = '…'
    const p22 = '…'
    const p23 = '…'
    const p24 = '…'
    const glyphOf11 = '…'
    const p25 = '…'
    const p26 = '…'
    const p27 = '…'
    const glyphOf12 = '…'
    const glyphOf13 = '…'
    const glyphOf14 = '…'
    const glyphOf15 = '…'
    const length = '…'
    const indent = '…'
    const line = '…'
    const indent2 = '…'
    const line2 = '…'
    const indent3 = '…'
    const line3 = '…'
    const indent4 = '…'
    const line4 = '…'
    const indent5 = '…'
    const line5 = '…'
    const indent6 = '…'
    const line6 = '…'
    const indent7 = '…'
    const line7 = '…'
    const indent8 = '…'
    const line8 = '…'
    const indent9 = '…'
    const line9 = '…'
    const indent10 = '…'
    const line10 = '…'
    const indent11 = '…'
    const line11 = '…'
    const indent12 = '…'
    const line12 = '…'
    const indent13 = '…'
    const line13 = '…'
    const indent14 = '…'
    const line14 = '…'
    const indent15 = '…'
    const line15 = '…'
    const indent16 = '…'
    const line16 = '…'
    const indent17 = '…'
    const line17 = '…'
    const indent18 = '…'
    const line18 = '…'
    const indent19 = '…'
    const line19 = '…'
    const indent20 = '…'
    const line20 = '…'
    const indent21 = '…'
    const line21 = '…'
    const indent22 = '…'
    const line22 = '…'
    const indent23 = '…'
    const line23 = '…'
    const indent24 = '…'
    const line24 = '…'
    const error = '…'
    const spin2 = '…'
    const m2 = '…'
    const spin3 = '…'
    const m3 = '…'
    const indent25 = '…'
    const line25 = '…'
    const indent26 = '…'
    return (
      <Box flexDirection="column">
        <Box gap={1}>
          <Button variant="primary" label={`${label}`} />
          <Button variant="primary" label={`${label}`} />
          <Button variant="primary" label={`${label}`} />
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="column">
            <Box>
              <Text bold color="yellow">
                NOW
              </Text>
              <Text dimColor />
            </Box>
            <Text color="cyan">
              {`${spin} Claude working `}
            </Text>
            <Box flexDirection="column" marginTop={1}>
              <Box>
                <Text bold color="yellow">
                  NEEDS YOU
                </Text>
                <Text dimColor />
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Box gap={1}>
                <Text dimColor>
                  view
                </Text>
                <Button plain label={`[auto: ${zoom}]`} />
                <Button plain label={`[auto: ${zoom}]`} />
                <Button plain label={`[auto: ${zoom}]`} />
              </Box>
              <Box flexDirection="column">
                <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1}>
                  <Box>
                    <Text>
                      {glyphOf}
                      {" "}
                    </Text>
                    <Button plain label={`${padEnd} ${time}`} />
                  </Box>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                </Box>
                <Box flexDirection="column" marginLeft={1}>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p}
                      </Text>
                      <Text dimColor>
                        {p2}
                      </Text>
                      <Text dimColor>
                        {p3}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf2}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p4}
                      </Text>
                      <Text dimColor>
                        {p5}
                      </Text>
                      <Text dimColor>
                        {p6}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf3}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p7}
                      </Text>
                      <Text dimColor>
                        {p8}
                      </Text>
                      <Text dimColor>
                        {p9}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf4}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                </Box>
              </Box>
              <Box flexDirection="column">
                <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1}>
                  <Box>
                    <Text>
                      {glyphOf5}
                      {" "}
                    </Text>
                    <Button plain label={`${padEnd} ${time}`} />
                  </Box>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                </Box>
                <Box flexDirection="column" marginLeft={1}>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p10}
                      </Text>
                      <Text dimColor>
                        {p11}
                      </Text>
                      <Text dimColor>
                        {p12}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf6}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p13}
                      </Text>
                      <Text dimColor>
                        {p14}
                      </Text>
                      <Text dimColor>
                        {p15}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf7}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p16}
                      </Text>
                      <Text dimColor>
                        {p17}
                      </Text>
                      <Text dimColor>
                        {p18}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf8}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                </Box>
              </Box>
              <Box flexDirection="column">
                <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1}>
                  <Box>
                    <Text>
                      {glyphOf9}
                      {" "}
                    </Text>
                    <Button plain label={`${padEnd} ${time}`} />
                  </Box>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                  <Text color="yellow">
                    {`  ${l}`}
                  </Text>
                </Box>
                <Box flexDirection="column" marginLeft={1}>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p19}
                      </Text>
                      <Text dimColor>
                        {p20}
                      </Text>
                      <Text dimColor>
                        {p21}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf10}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p22}
                      </Text>
                      <Text dimColor>
                        {p23}
                      </Text>
                      <Text dimColor>
                        {p24}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf11}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                  <Box>
                    <Box flexDirection="column" width={4}>
                      <Text dimColor>
                        {p25}
                      </Text>
                      <Text dimColor>
                        {p26}
                      </Text>
                      <Text dimColor>
                        {p27}
                      </Text>
                    </Box>
                    <Box borderStyle="round" borderColor="gray" flexDirection="column" paddingX={1} flexGrow={1}>
                      <Box>
                        <Text>
                          {glyphOf12}
                          {" "}
                        </Text>
                        <Button plain label={`${m}`} />
                      </Box>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                      <Text color="yellow">
                        {`  ${l}`}
                      </Text>
                    </Box>
                  </Box>
                </Box>
              </Box>
              <Box flexDirection="column" marginTop={1}>
                <Box>
                  <Text bold>
                    IDLE
                  </Text>
                  <Text dimColor />
                </Box>
                <Box gap={1}>
                  <Text>
                    {glyphOf13}
                  </Text>
                  <Button plain label={`${padEnd}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                </Box>
                <Box gap={1}>
                  <Text>
                    {glyphOf14}
                  </Text>
                  <Button plain label={`${padEnd}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                </Box>
                <Box gap={1}>
                  <Text>
                    {glyphOf15}
                  </Text>
                  <Button plain label={`${padEnd}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                  <Button plain label={`${glyphOf}`} />
                </Box>
              </Box>
              <Box gap={1}>
                <Text dimColor>
                  {`board · ${length} message today`}
                </Text>
                <Button plain label="[open]" />
              </Box>
            </Box>
            <Box flexDirection="column" marginTop={1}>
              <Box>
                <Text bold color="magenta">
                  AGENT
                </Text>
                <Text>
                  {`  ${m}`}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent}
                </Text>
                <Text color="yellow">
                  {line}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent2}
                </Text>
                <Text color="yellow">
                  {line2}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent3}
                </Text>
                <Text color="yellow">
                  {line3}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent4}
                </Text>
                <Text>
                  {line4}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent5}
                </Text>
                <Text>
                  {line5}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent6}
                </Text>
                <Text>
                  {line6}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent7}
                </Text>
                <Text color="white">
                  {line7}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent8}
                </Text>
                <Text color="white">
                  {line8}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent9}
                </Text>
                <Text color="white">
                  {line9}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent10}
                </Text>
                <Text color="cyan">
                  {line10}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent11}
                </Text>
                <Text color="cyan">
                  {line11}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent12}
                </Text>
                <Text color="cyan">
                  {line12}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent13}
                </Text>
                <Text>
                  {line13}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent14}
                </Text>
                <Text>
                  {line14}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent15}
                </Text>
                <Text>
                  {line15}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent16}
                </Text>
                <Text color="magenta">
                  {line16}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent17}
                </Text>
                <Text color="magenta">
                  {line17}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent18}
                </Text>
                <Text color="magenta">
                  {line18}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent19}
                </Text>
                <Text>
                  {line19}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent20}
                </Text>
                <Text>
                  {line20}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent21}
                </Text>
                <Text>
                  {line21}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent22}
                </Text>
                <Text>
                  {line22}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent23}
                </Text>
                <Text>
                  {line23}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent24}
                </Text>
                <Text>
                  {line24}
                </Text>
              </Box>
              <Text color="red">
                {error}
              </Text>
              <Box>
                <Text>
                  {spin}
                  {" "}
                </Text>
                <Text>
                  {m}
                </Text>
              </Box>
              <Box>
                <Text>
                  {spin2}
                  {" "}
                </Text>
                <Text>
                  {m2}
                </Text>
              </Box>
              <Box>
                <Text>
                  {spin3}
                  {" "}
                </Text>
                <Text>
                  {m3}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent25}
                </Text>
                <Text>
                  {line25}
                </Text>
              </Box>
              <Box>
                <Text dimColor>
                  {indent26}
                </Text>
                <Text />
              </Box>
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`That is this 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.tsx lines 1267–1426 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const table = $.ui.resolve(e)
    const { Box, Text, Button } = table
    // Mobile draws no text fields: there the board and the launcher show without their boxes.
    const Input = 'Input' in table ? table.Input : null
    // Only remote surfaces (the desktop) draw vector art; the terminal gets the tree alone.
    const Svg = 'Svg' in table ? table.Svg : null
    const width = Math.max(24, e.props.bodyColumns)
    const bodyRows = Math.max(20, e.props.scroll.bodyRows)
    const now = await $.clock.now()
    const jobList = await read($, jobs)
    const g = await read($, goal)
    const agentList = await read($, agents)
    const cardList = await read($, cardsAtom)
    const loopList = await read($, loopsAtom)
    const catalogList = await read($, catalogAtom)
    const launch = await read($, launchAtom)
    const hb = await read($, hubAtom)
    const m0 = await read($, main)
    const peekState = await read($, peek)
    const view = await read($, viewAtom)
    // Recording mode (its own mod) sets this flag; mask before cutting to width.
    const isRecording = (await $.env.get('CLAUDE_MODS_RECORDING')) === '1'
    const terms = recordingTerms(await $.env.get('CLAUDE_MODS_RECORDING_TERMS'))
    const m = (text: string): string => (isRecording ? mask(text, terms) : text)
    const spin = SPIN[Math.floor(now / 1000) % SPIN.length] ?? '*'

    const map = await currentMap($, now)
    const self = map[0]
    const views = agentViews(agentList, cardList, jobList)
    const groups = groupNow(jobList, agentList, m0)

    const heading = (title: string, right: string, color?: string) => (
      <Box>
        <Text bold color={color}>{title}</Text>
        <Text dimColor>{right === '' ? '' : `  ${right}`}</Text>
      </Box>
    )
    // A labelled detail line: "   role  Read-only search…", wrapped.
    const detail = (key: string, label: string, text: string, lines: number, color?: string) => {
      const indent = `   ${label === '' ? '' : `${label.padEnd(5)} `}`
      return wrap(m(text), width - indent.length, lines).map((line, i) => (
        <Box key={`${key}:${i}`}>
          <Text dimColor>{i === 0 ? indent : ' '.repeat(indent.length)}</Text>
          <Text color={color} dimColor={color === undefined}>{line}</Text>
        </Box>
      ))
    }
    const glyphOf = (status: string, kind: string): string =>
      kind === 'loop' ? '↻' : status === 'running' ? spin : (STATUS_GLYPH[status] ?? '·')
    const colorOf = (status: string, kind: string): string =>
      status === 'running' && kind === 'agent' ? 'magenta' : (STATUS_COLOR[status] ?? 'gray')
    const nodeKey = (s: MapSession, n: MapNode): string =>
      s.isSelf ? (n.kind === 'agent' ? `agent:${n.id}` : `node:self:${n.id}`) : `node:${s.sessionId}:${n.id}`
    const timeOf = (n: MapNode): string => n.kind === 'loop' ? '' : dur((n.to ?? now) - n.from)
    const bar = (p: MapNode['progress']): string =>
      p === null ? '' : `${'▰'.repeat(Math.min(p.done, 10))}${'▱'.repeat(Math.max(0, Math.min(p.total, 10) - Math.min(p.done, 10)))} ${p.done}/${p.total}`
    const lineTwo = (n: MapNode): string => {
      if (n.status === 'waiting' || n.status === 'stuck') return n.why || n.now
      if (n.status === 'done' || n.status === 'failed') return n.why === '' ? n.now : `→ ${n.why}`
      const p = bar(n.progress)
      return p === '' ? n.now : `${p}${n.now === '' ? '' : ` · ${n.now}`}`
    }

    // Opening one thing below the map: this session's subagents read their transcript; anything else is the view's.
    const openNode = async (s: MapSession, n: MapNode): Promise<void> => {
      if (s.isSelf && n.kind === 'agent') {
        await update($, viewAtom, v => ({ ...v, sel: null, confirm: null }))
        await togglePeek($, n.id)
        return
      }
      const sel = `node:${s.sessionId}:${n.id}`
      await update($, peek, () => NO_PEEK)
      await update($, viewAtom, v => ({ ...v, sel: v.sel === sel ? null : sel, confirm: null }))
    }
    const openSession = async (s: MapSession): Promise<void> => {
      const sel = `session:${s.sessionId}`
      await update($, peek, () => NO_PEEK)
      await update($, viewAtom, v => ({ ...v, sel: v.sel === sel ? null : sel, confirm: null }))
    }
    const setView = (patch: Partial<View>) => () => update($, viewAtom, v => ({ ...v, ...patch }))

    // ---- what needs the person: this session's own asks, then other sessions', then what may be stuck ----
    type NeedRow = { key: string; glyph: string; color: string; text: string; from: number | null; onPress: (() => Promise<unknown>) | null }
    const needRows: NeedRow[] = []
    for (const r of groups.needs) {
      const agentId = r.agentId
      needRows.push({
        key: r.key, glyph: r.glyph, color: 'yellow', text: r.text, from: r.from,
        onPress: agentId === undefined ? null : () => togglePeek($, agentId),
      })
    }
    const mapNeeds: MapNeed[] = needsOf(map)
    let elsewhere = 0
    for (const n of mapNeeds) {
      if (n.isSelf && n.kind === 'wait') continue
      const s = map.find(x => x.sessionId === n.sessionId)
      if (s === undefined) continue
      if (!n.isSelf) elsewhere += 1
      const node = n.nodeId === null ? undefined : s.nodes.find(x => x.id === n.nodeId)
      needRows.push({
        key: n.nodeId === null ? `need:session:${n.sessionId}` : `need:node:${n.isSelf ? 'self' : n.sessionId}:${n.nodeId}`,
        glyph: n.kind === 'wait' ? '!' : '?',
        color: n.kind === 'wait' ? 'yellow' : STUCK_COLOR,
        text: `${n.where}: ${n.why}`,
        from: n.since,
        onPress: node !== undefined ? () => openNode(s, node) : !s.isSelf ? () => jumpTo($, s.sessionId) : () => openSession(s),
      })
    }
    const needRow = (r: NeedRow) => {
      const time = r.from === null ? '' : dur(now - r.from)
      const room = width - time.length - 3
      const [first = '', second] = wrap(m(r.text), room, 2)
      const label = `${padEnd(first, room)} ${time}`
      return (
        <Box key={`wrap:${r.key}`} flexDirection="column">
          <Box>
            <Text color={r.color}>{r.glyph} </Text>
            {r.onPress === null
              ? <Text bold>{label}</Text>
              : <Button key={r.key} plain label={label} onPress={r.onPress} />}
          </Box>
          {second !== undefined && <Text dimColor>{`  ${second}`}</Text>}
        </Box>
      )
    }

    // ---- the tabs ----
    const done = g.tasks.filter(t => t.status === 'completed').length
    const total = g.tasks.length
    const tab = (id: View['tab'], label: string) => (view.tab === id
      ? <Button key={`tab:${id}`} variant="primary" label={label} onPress={setView({ tab: id, confirm: null })} />
      : <Button key={`tab:${id}`} plain dimColor label={label} onPress={setView({ tab: id, confirm: null })} />)
    const tabs = (
      <Box gap={1}>
        {tab('map', needRows.length > 0 ? `Map ${needRows.length}!` : 'Map')}
        {tab('tasks', total === 0 ? 'Tasks' : `Tasks ${done}/${total}`)}
        {tab('launch', 'Launch')}
      </Box>
    )

    // ---- the map ----
    const working = map.reduce((n, s) => n + s.nodes.filter(x => x.kind === 'agent' && x.status === 'running').length, 0)
    const counts = [
      `${map.length} session${map.length === 1 ? '' : 's'}`,
      needRows.length > 0 ? `${needRows.length} need you` : '',
      working > 0 ? `${working} agent${working === 1 ? '' : 's'} working` : '',
    ].filter(x => x !== '').join(' · ')
    // Other sessions with nothing running fold into one line each under IDLE.
    const quiet = map.filter(s => !s.isSelf && s.status === 'idle' && !s.nodes.some(n => n.status === 'running' || n.status === 'waiting' || n.status === 'stuck'))
    const active = map.filter(s => !quiet.includes(s))
    const isPeekOpen = peekState.agentId !== null || view.sel !== null
    const isDesktopGraph = Svg !== null && e.surface === 'desktop'
    const zoom: Zoom = isDesktopGraph ? 'lines' : view.zoom === 'auto' ? autoZoom(active, needRows.length + quiet.length, bodyRows - (isPeekOpen ? 16 : 0)) : view.zoom

    const sessionTitle = (s: MapSession): string =>
      `${s.name}${s.branch === '' ? '' : ` · ${s.branch}`}${s.isSelf ? ' · here' : ''}${s.hasMap ? '' : ' · (no map)'}`
    const sessionLine = (s: MapSession): string => s.status === 'waiting' || s.status === 'stuck' ? s.why || s.doing : s.doing

    const card = (s: MapSession) => {
Licence text (MIT)
MIT License

Copyright (c) 2026 Hillman Chan

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

runs programswrites filesenv varsdrives Claudetool callsrememberscalls tools

What its code shows

Read from the source at commit d8308ab49ed2. 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.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.7 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, with its own branch for the desktop
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.hooks/register.tsx:463 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, the transcript and reaches the network, another session
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.no skills, commands, agents or workflows
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).hooks/register.tsx:1636 a tool named at run time; command.run: /?; tool.call: CronDelete
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.prompt.submit (as the person), agent.spawn, adds command agent-map, adds tool hub
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 (agent-map), prompt.submit, classic.Stop, tool.call · shapes: agent.offer · also: session.start, session.end, turn.start, turn.complete (+2) · 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: CLAUDE_MODS_RECORDING, CLAUDE_MODS_RECORDING_TERMS, HOME, CLAUDE_CONFIG_DIR; files: a path computed at run time, /Applications/iTerm.app, …/…; the transcript
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.files: a path computed at run time; another session; the prompt box

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 ChiFungHillmanChan/agent-map
/plugin install agent-map@agent-map
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (d8308ab49ed2). 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/ChiFungHillmanChan/agent-map
git -C agent-map checkout d8308ab49ed2c442d6ea14762dc33a832af0b79f
claude plugin validate agent-map
claude --plugin-dir agent-map

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 or ChatGPT about it

With ModsCode added as a connector, Claude or ChatGPT can read this mod's code, what it reaches and how its controls are wired, and build on them. Ask it like this:

Read the ModsCode mod "chifunghillmanchan-agent-map" with its code and make me one like it

Add the ModsCode MCP to Claude or ChatGPT

Similar mods

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/chifunghillmanchan-agent-map.svg)](https://modscode.com/claude-mods/mods/chifunghillmanchan-agent-map/)