modscode JA

modscode / Gallery / session-dashboard

session-dashboard

A side pane for the current session: prompt cache hot/cold, tool calls and errors, background commands with restart and stop, the approved plan, task list, subagents and swarm agents, and token usage for the main agent and subagents

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputText

What it does

  • Draws a pane, toasts
  • Watches tool calls and can refuse them
  • Hooks classic.PermissionRequest, classic.SessionStart, classic.Stop, classic.StopFailure and 9 more
  • Keeps its own state between turns
  • Starts processes

Good points

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

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

// Drawn like session-dashboard by djmid (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/netgfx-session-dashboard/
// 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: "Dashboard" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const word = '…'
    const detail = '…'
    const value = '…'
    const main = '…'
    const sub = '…'
    const value2 = '…'
    const kind = '…'
    const fmtAgo = '…'
    const tool = '…'
    const message = '…'
    const running = '…'
    const length = '…'
    const pid = '…'
    const port = '…'
    const command = '…'
    const pid2 = '…'
    const port2 = '…'
    const pid3 = '…'
    const port3 = '…'
    const busy = '…'
    const name = '…'
    const fitStart = '…'
    const name2 = '…'
    const name3 = '…'
    const requests = '…'
    const reduce = '…'
    const value3 = '…'
    const value4 = '…'
    const value5 = '…'
    const value6 = '…'
    const value7 = '…'
    const value8 = '…'
    const fmtNum = '…'
    const fmtNum2 = '…'
    const fmtNum3 = '…'
    const fmtNum4 = '…'
    const fmtNum5 = '…'
    const fmtNum6 = '…'
    const fmtNum7 = '…'
    const fmtNum8 = '…'
    const label = '…'
    const fmtNum9 = '…'
    const fmtNum10 = '…'
    const fmtNum11 = '…'
    const fmtNum12 = '…'
    const fmtNum13 = '…'
    const fmtNum14 = '…'
    const fmtNum15 = '…'
    const fmtNum16 = '…'
    const fmtNum17 = '…'
    const fmtNum18 = '…'
    const fmtNum19 = '…'
    const fmtNum20 = '…'
    const fmtNum21 = '…'
    const fmtNum22 = '…'
    const fmtNum23 = '…'
    const fmtNum24 = '…'
    const usd = '…'
    const pct = '…'
    const fmtUntil = '…'
    const turns = '…'
    const fmtPct = '…'
    const fmtNum25 = '…'
    const fmtPct2 = '…'
    const fmtNum26 = '…'
    const fmtPct3 = '…'
    const fmtNum27 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" justifyContent="space-between" marginBottom={1}>
          <Text bold>
            SESSION DASHBOARD
          </Text>
          <Box marginRight={1}>
            <Button label="hide" hotkey="q" plain dimColor />
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text>
              {"   "}
            </Text>
            <Text bold>
              Cache (
              <Text bold>
                {word}
              </Text>
              )
            </Text>
            <Box flexGrow={1} justifyContent="flex-end">
              <Text dimColor wrap="truncate-start">
                {detail}
              </Text>
            </Box>
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row">
            <Box flexDirection="column">
              <Text dimColor bold>
                TOOL CALLS
              </Text>
              <Text bold>
                {value}
              </Text>
              <Text dimColor wrap="truncate-end">
                {`main ${main} · sub ${sub}`}
              </Text>
            </Box>
            <Box flexDirection="column">
              <Text dimColor bold>
                ERRORS
              </Text>
              <Text bold>
                {value2}
              </Text>
              <Text dimColor wrap="truncate-end">
                {`${kind} ${fmtAgo}`}
              </Text>
            </Box>
          </Box>
          <Button label="▾ hide errors" hotkey="e" plain dimColor />
          <Box flexDirection="row" columnGap={1}>
            <Text color="#F85149">
              ✕
            </Text>
            <Text wrap="truncate-end">
              {`${kind} · ${tool}: ${message}`}
            </Text>
          </Box>
          <Box flexDirection="row" columnGap={1}>
            <Text color="#F85149">
              ✕
            </Text>
            <Text wrap="truncate-end">
              {`${kind} · ${tool}: ${message}`}
            </Text>
          </Box>
          <Box flexDirection="row" columnGap={1}>
            <Text color="#F85149">
              ✕
            </Text>
            <Text wrap="truncate-end">
              {`${kind} · ${tool}: ${message}`}
            </Text>
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text bold dimColor>
              BACKGROUND
            </Text>
            <Text dimColor>
              {`${running} running · ${length} ended`}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text dimColor>
              PID
            </Text>
            <Text dimColor>
              PORT
            </Text>
            <Text dimColor>
              COMMAND
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text>
              {pid}
            </Text>
            <Text color="#3B8EEA">
              {port}
            </Text>
            <Box flexShrink={1}>
              <Text wrap="truncate-end">
                {`${command}`}
              </Text>
            </Box>
            <Box flexDirection="row" columnGap={1} marginLeft={1}>
              <Button label="↻" />
              <Button label="✕" />
            </Box>
          </Box>
          <Box flexDirection="row">
            <Text>
              {pid2}
            </Text>
            <Text color="#3B8EEA">
              {port2}
            </Text>
            <Box flexShrink={1}>
              <Text wrap="truncate-end">
                {`${command}`}
              </Text>
            </Box>
            <Box flexDirection="row" columnGap={1} marginLeft={1}>
              <Button label="↻" />
              <Button label="✕" />
            </Box>
          </Box>
          <Box flexDirection="row">
            <Text>
              {pid3}
            </Text>
            <Text color="#3B8EEA">
              {port3}
            </Text>
            <Box flexShrink={1}>
              <Text wrap="truncate-end">
                {`${command}`}
              </Text>
            </Box>
            <Box flexDirection="row" columnGap={1} marginLeft={1}>
              <Button label="↻" />
              <Button label="✕" />
            </Box>
          </Box>
          <Box flexDirection="row" columnGap={2}>
            <Button label="rescan" hotkey="s" plain dimColor />
            <Button label="clear ended" hotkey="x" plain dimColor />
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row">
            <Box flexGrow={1} flexDirection="row" columnGap={1}>
              <Text bold dimColor>
                LINKED FOLDERS
              </Text>
              <Text dimColor>
                {length}
              </Text>
              <Text color="#D29922">
                {busy}
              </Text>
            </Box>
            <Box marginRight={1}>
              <Button label="+" hotkey="l" />
            </Box>
          </Box>
          <Box flexDirection="row">
            <Text bold color="#A371F7" wrap="truncate-end">
              {name}
            </Text>
            <Box flexShrink={1}>
              <Text dimColor wrap="truncate-start">
                {`→ ${fitStart}`}
              </Text>
            </Box>
            <Box flexDirection="row" flexShrink={0} columnGap={1} marginLeft={1}>
              <Button label="✎" />
              <Button label="✕" />
            </Box>
          </Box>
          <Box flexDirection="row">
            <Text bold color="#A371F7" wrap="truncate-end">
              {name2}
            </Text>
            <Box flexShrink={1}>
              <Text dimColor wrap="truncate-start">
                {`→ ${fitStart}`}
              </Text>
            </Box>
            <Box flexDirection="row" flexShrink={0} columnGap={1} marginLeft={1}>
              <Button label="✎" />
              <Button label="✕" />
            </Box>
          </Box>
          <Box flexDirection="row">
            <Text bold color="#A371F7" wrap="truncate-end">
              {name3}
            </Text>
            <Box flexShrink={1}>
              <Text dimColor wrap="truncate-start">
                {`→ ${fitStart}`}
              </Text>
            </Box>
            <Box flexDirection="row" flexShrink={0} columnGap={1} marginLeft={1}>
              <Button label="✎" />
              <Button label="✕" />
            </Box>
          </Box>
          <Input label="folder" placeholder="path to a folder on this machine" submitLabel="link" autoFocus />
          <Text dimColor wrap="truncate-end">
            None. Press + to link a folder into the workspace.
          </Text>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text bold dimColor>
              TASKS
            </Text>
          </Box>
          <Text dimColor>
            No plan, tasks or agents yet.
          </Text>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text bold dimColor>
              TOKENS
            </Text>
            <Text dimColor>
              {`${requests}${reduce} requests`}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text dimColor />
            <Text dimColor>
              {value3}
            </Text>
            <Text dimColor>
              {value4}
            </Text>
            <Text dimColor>
              {value5}
            </Text>
            <Text dimColor>
              {value6}
            </Text>
            <Text dimColor>
              {value7}
            </Text>
            <Text dimColor>
              {value8}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              main agent
            </Text>
            <Text>
              {fmtNum}
            </Text>
            <Text>
              {fmtNum2}
            </Text>
            <Text>
              {fmtNum3}
            </Text>
            <Text>
              {fmtNum4}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              {`subagents (${length})`}
            </Text>
            <Text>
              {fmtNum5}
            </Text>
            <Text>
              {fmtNum6}
            </Text>
            <Text>
              {fmtNum7}
            </Text>
            <Text>
              {fmtNum8}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              {`  ${label}`}
            </Text>
            <Text>
              {fmtNum9}
            </Text>
            <Text>
              {fmtNum10}
            </Text>
            <Text>
              {fmtNum11}
            </Text>
            <Text>
              {fmtNum12}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              {`  ${label}`}
            </Text>
            <Text>
              {fmtNum13}
            </Text>
            <Text>
              {fmtNum14}
            </Text>
            <Text>
              {fmtNum15}
            </Text>
            <Text>
              {fmtNum16}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              {`  ${label}`}
            </Text>
            <Text>
              {fmtNum17}
            </Text>
            <Text>
              {fmtNum18}
            </Text>
            <Text>
              {fmtNum19}
            </Text>
            <Text>
              {fmtNum20}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text wrap="truncate-end">
              total
            </Text>
            <Text>
              {fmtNum21}
            </Text>
            <Text>
              {fmtNum22}
            </Text>
            <Text>
              {fmtNum23}
            </Text>
            <Text>
              {fmtNum24}
            </Text>
          </Box>
          <Text>
            {" "}
          </Text>
          <Box flexDirection="row" columnGap={1}>
            <Text dimColor>
              context
            </Text>
            <Text bold>
              —
            </Text>
            <Text dimColor>
              {`of ${fmtNum}`}
            </Text>
            <Text dimColor>
              {`· $${usd}`}
            </Text>
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text bold dimColor>
              USAGE LIMITS
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text dimColor>
              5-hour
            </Text>
            <Text>
              ████████
            </Text>
            <Text bold>
              {`${pct}%`}
            </Text>
            <Text dimColor wrap="truncate-end">
              {` ${fmtUntil}`}
            </Text>
          </Box>
          <Box flexDirection="row">
            <Text dimColor>
              weekly
            </Text>
            <Text>
              ████████
            </Text>
            <Text bold>
              {`${pct}%`}
            </Text>
            <Text dimColor wrap="truncate-end">
              {` ${fmtUntil}`}
            </Text>
          </Box>
        </Box>
        <Text dimColor wrap="truncate-end">
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="row" columnGap={1}>
            <Text bold dimColor>
              TOTAL DISTRIBUTION
            </Text>
            <Text dimColor wrap="truncate-end">
              {`${fmtNum} tokens · ${turns} turn`}
            </Text>
          </Box>
          <Box flexDirection="column" columnGap={2} rowGap={1}>
            <Box flexDirection="column" width={16} flexShrink={0}>
              <Button label="hide small %" hotkey="p" plain dimColor />
            </Box>
            <Box flexDirection="column">
              <Box flexDirection="row" columnGap={1}>
                <Text>
                  ██
                </Text>
                <Button label={`${label}`} plain />
                <Box flexGrow={1} justifyContent="flex-end" columnGap={1}>
                  <Text bold>
                    {fmtPct}
                  </Text>
                  <Text dimColor>
                    {fmtNum25}
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="row" columnGap={1}>
                <Text>
                  ██
                </Text>
                <Button label={`${label}`} plain />
                <Box flexGrow={1} justifyContent="flex-end" columnGap={1}>
                  <Text bold>
                    {fmtPct2}
                  </Text>
                  <Text dimColor>
                    {fmtNum26}
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="row" columnGap={1}>
                <Text>
                  ██
                </Text>
                <Button label={`${label}`} plain />
                <Box flexGrow={1} justifyContent="flex-end" columnGap={1}>
                  <Text bold>
                    {fmtPct3}
                  </Text>
                  <Text dimColor>
                    {fmtNum27}
                  </Text>
                </Box>
              </Box>
            </Box>
          </Box>
          <Text dimColor wrap="truncate-end">
            tool use and retries are estimated from call sizes
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Counters reset`)
    await $.ui.toast(`Dashboard opens as a right-hand sidebar only in the fullscreen layout: start Claude Code with CLAUDE_CODE_NO_FLICKER=1 …`)
    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 338–415 · Pane
  on('ui.render', { component: 'Pane' }, async ($, e, next) => {
    if (e.requestId !== PANE) return next(e)
    // Seated above the prompt (a pane kept from a main-screen session): close it
    if (e.surface === 'terminal' && e.props.placement === 'inline') {
      paneOpen = false
      void $.ui.close({ id: PANE })
    }
    const E = $.ui.resolve(e)
    const now = Date.now()
    const redraw = () => $.ui.invalidate('ui.render')
    // Read while drawing, so the pane is drawn again when swarm-mod writes it
    const swarm = await readSwarm($)

    return renderDashboard(
      E,
      {
        width: (e.props.bodyColumns ?? 54) - 1,
        now,
        snap: S,
        cache: cacheStatus(S.cache, now, ttlMs),
        ttlMs,
        ttlSource,
        usage,
        errorsOpen,
        promptOpen,
        links,
        linkUi,
        distUi,
        swarm,
      },
      {
        refresh: (proc) => restartProcess($, proc),
        close: (proc) => closeProcess($, proc),
        toggleErrors: () => {
          errorsOpen = !errorsOpen
          redraw()
        },
        togglePrompt: () => {
          promptOpen = !promptOpen
          redraw()
        },
        rescan: () => scanProcesses($, true),
        clearExited: () => {
          S.procs = S.procs.filter((p) => p.status === 'running')
          changed($)
        },
        closePane: async () => {
          await $.ui.close({ id: PANE })
          paneOpen = false
        },
        addLink: () => pickAndLink($),
        addLinkPath: (path) => {
          linkUi.adding = false
          redraw()
          if (cleanPath(path)) return withBusy($, 'linking…', () => linkFolder($, path))
        },
        editLink: (link) => {
          linkUi.editing = linkUi.editing === link.name ? null : link.name
          redraw()
        },
        renameLink: (link, name) => {
          linkUi.editing = null
          redraw()
          return withBusy($, 'renaming…', () => renameLink($, link, name))
        },
        unlink: (link) => withBusy($, 'unlinking…', () => unlinkFolder($, link)),
        toggleSmallPct: () => {
          distUi.showSmall = !distUi.showSmall
          redraw()
        },
        togglePct: (kind) => {
          if (distUi.shown.has(kind)) distUi.shown.delete(kind)
          else distUi.shown.add(kind)
          redraw()
        },
      },
    )
  })
hooks/view.js lines 25–52 · Pane
export function renderDashboard(E, v, act) {
  const { Box, Text } = E
  const W = Math.max(28, v.width)
  const rule = () => Text({ dimColor: true, wrap: 'truncate-end', children: ['─'.repeat(W)] })

  return Box({
    flexDirection: 'column',
    width: W,
    children: [
      header(E, v, act, W),
      cacheSection(E, v, W),
      rule(),
      activitySection(E, v, act, W),
      rule(),
      processSection(E, v, act, W),
      rule(),
      linkSection(E, v, act, W),
      rule(),
      taskSection(E, v, W, act),
      rule(),
      tokenSection(E, v, W),
      rule(),
      limitSection(E, v, W),
      // Once a turn has ended
      ...(v.snap.dist ? [rule(), distSection(E, v, act, W)] : []),
    ],
  })
}
hooks/view.js lines 54–70 · Pane
function header(E, v, act, W) {
  const { Box, Text, Button } = E
  return Box({
    flexDirection: 'row',
    justifyContent: 'space-between',
    width: W,
    marginBottom: 1,
    children: [
      Text({ bold: true, children: ['SESSION DASHBOARD'] }),
      // One cell (~8px) in from the right edge, clear of the pane's own close X
      Box({
        marginRight: 1,
        children: [Button({ key: 'pane-close', label: 'hide', hotkey: 'q', plain: true, dimColor: true, onPress: act.closePane })],
      }),
    ],
  })
}
hooks/view.js lines 83–130 · Pane
function cacheSection(E, v, W) {
  const { Box, Text } = E
  const c = v.cache
  const color = c.isHot ? COLORS.hot : COLORS.cold
  const word = c.isHot ? 'Hot' : 'Cold'

  let detail
  if (c.isNew) detail = 'no request yet'
  else if (c.isHot) detail = 'expires in ' + fmtDuration(c.remainingMs)
  else detail = 'expired ' + fmtAgo(-c.remainingMs)

  const lines = []
  if (!c.isNew) {
    const hit = c.hitRate === null ? '—' : Math.round(c.hitRate * 100) + '%'
    lines.push(
      Text({
        dimColor: true,
        wrap: 'truncate-end',
        children: ['last request ' + hit + ' cached · TTL ' + Math.round(v.ttlMs / 60000) + 'm' + (v.ttlSource === 'auto' ? ' (auto)' : '')],
      }),
    )
    if (c.lastMiss === 'invalidated') {
      lines.push(Text({ color: COLORS.cold, wrap: 'truncate-end', children: ['↯ last request missed the cache (invalidated)'] }))
    } else if (c.lastMiss === 'expired') {
      lines.push(Text({ color: COLORS.cold, wrap: 'truncate-end', children: ['last request rebuilt an expired cache'] }))
    } else if (v.snap.cache.misses > 0) {
      lines.push(Text({ dimColor: true, wrap: 'truncate-end', children: [v.snap.cache.misses + ' cache miss' + (v.snap.cache.misses === 1 ? '' : 'es') + ' this session'] }))
    }
  }

  return Box({
    flexDirection: 'column',
    children: [
      Box({
        flexDirection: 'row',
        columnGap: 1,
        width: W,
        children: [
          // The colored block: three cells of background color
          Text({ backgroundColor: color, children: ['   '] }),
          Text({ bold: true, children: ['Cache (', Text({ bold: true, color, children: [word] }), ')'] }),
          Box({ flexGrow: 1, justifyContent: 'flex-end', children: [Text({ dimColor: true, wrap: 'truncate-start', children: [detail] })] }),
        ],
      }),
      ...lines,
    ],
  })
}
hooks/view.js lines 134–195 · Pane
function activitySection(E, v, act, W) {
  const { Box, Text, Button } = E
  const s = v.snap
  const half = Math.floor(W / 2)
  const errColor = s.errorCount > 0 ? COLORS.bad : COLORS.ok

  const stat = (label, value, color, sub) =>
    Box({
      flexDirection: 'column',
      width: half,
      children: [
        Text({ dimColor: true, bold: true, children: [label] }),
        Text({ bold: true, color, children: [String(value)] }),
        Text({ dimColor: true, wrap: 'truncate-end', children: [sub] }),
      ],
    })

  const lastErr = s.errors[0]
  const errorRows = v.errorsOpen
    ? s.errors.slice(0, 6).map((err, i) =>
        Box({
          key: 'err-' + i,
          flexDirection: 'row',
          columnGap: 1,
          children: [
            Text({ color: COLORS.bad, children: ['✕'] }),
            Text({
              wrap: 'truncate-end',
              children: [fit(err.kind, 14).trimEnd() + ' · ' + (err.tool ?? '') + (err.message ? ': ' + err.message : '')],
            }),
          ],
        }),
      )
    : []

  return Box({
    flexDirection: 'column',
    children: [
      Box({
        flexDirection: 'row',
        width: W,
        children: [
          stat('TOOL CALLS', s.toolCalls.total, COLORS.accent, 'main ' + s.toolCalls.main + ' · sub ' + s.toolCalls.sub),
          stat('ERRORS', s.errorCount, errColor, lastErr ? lastErr.kind + ' ' + fmtAgo(v.now - lastErr.at) : 'none so far'),
        ],
      }),
      ...(s.errorCount > 0
        ? [
            Button({
              key: 'errors-toggle',
              label: v.errorsOpen ? '▾ hide errors' : '▸ show errors',
              hotkey: 'e',
              plain: true,
              dimColor: true,
              onPress: act.toggleErrors,
            }),
          ]
        : []),
      ...errorRows,
    ],
  })
}
hooks/view.js lines 199–271 · Pane
function processSection(E, v, act, W) {
  const { Box, Text, Button } = E
  const procs = v.snap.procs
  const running = procs.filter((p) => p.status === 'running').length
  const PID = 7
  const PORT = 7
  const ACTIONS = 12
  const CMD = Math.max(8, W - PID - PORT - ACTIONS - 1)

  const title = sectionTitle(
    E,
    'BACKGROUND',
    Text({ dimColor: true, children: [running + ' running' + (procs.length > running ? ' · ' + (procs.length - running) + ' ended' : '')] }),
  )

  if (procs.length === 0) {
    return Box({
      flexDirection: 'column',
      children: [title, Text({ dimColor: true, children: ['No background commands in this session.'] })],
    })
  }

  const headerRow = Box({
    flexDirection: 'row',
    children: [
      Text({ dimColor: true, children: [fit('PID', PID)] }),
      Text({ dimColor: true, children: [fit('PORT', PORT)] }),
      Text({ dimColor: true, children: [fit('COMMAND', CMD)] }),
    ],
  })

  const rows = procs.map((p) => {
    const alive = p.status === 'running'
    const statusColor = alive ? COLORS.ok : p.status === 'failed' ? COLORS.bad : undefined
    const port = p.ports?.length ? p.ports.join(',') : '—'
    return Box({
      key: 'proc-' + p.id,
      flexDirection: 'row',
      width: W,
      children: [
        Text({ color: statusColor, dimColor: !alive, children: [fit(p.pid ? String(p.pid) : alive ? '…' : '—', PID)] }),
        Text({ color: p.ports?.length ? COLORS.cold : undefined, dimColor: !p.ports?.length, children: [fit(port, PORT)] }),
        Box({
          width: CMD,
          flexShrink: 1,
          children: [Text({ dimColor: !alive, wrap: 'truncate-end', children: [p.command + (alive ? '' : ' (' + p.status + ')')] })],
        }),
        Box({
          flexDirection: 'row',
          columnGap: 1,
          marginLeft: 1,
          children: [
            Button({ key: 'refresh-' + p.id, label: '↻', onPress: () => act.refresh(p) }),
            Button({ key: 'close-' + p.id, label: alive ? '✕' : '–', onPress: () => act.close(p) }),
          ],
        }),
      ],
    })
  })

  const footer = Box({
    flexDirection: 'row',
    columnGap: 2,
    children: [
      Button({ key: 'rescan', label: 'rescan', hotkey: 's', plain: true, dimColor: true, onPress: act.rescan }),
      ...(procs.length > running
        ? [Button({ key: 'clear-ended', label: 'clear ended', hotkey: 'x', plain: true, dimColor: true, onPress: act.clearExited })]
        : []),
    ],
  })

  return Box({ flexDirection: 'column', children: [title, headerRow, ...rows, footer] })
}
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 filesdrives 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 cf2218e674c2 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.hooks/register.js
ParsesEvery file parses as TypeScript or JavaScript.3 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).hooks/register.js:732 ps (not on Windows); hooks/register.js:733 lsof (not on Windows); hooks/register.js:949 rm (not on Windows)
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.js:726 powershell (a shell or interpreter); hooks/register.js:784 a program named at run time; hooks/register.js:912 a program named at run time; hooks/register.js:940 powershell (a shell or interpreter); hooks/register.js:948 powershell (a shell or interpreter)
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 netgfx/claude-session-dashboard-mod
/plugin install session-dashboard@claude-session-dashboard-mod

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

Search them from Claude: the MCP connector

Similar designs