modscode JA

modscode / Gallery / spawn-pane

spawn-pane

Lets a planner session open a new terminal tab in any folder and hand a briefed Claude agent the work there.

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /workers, /standup
  • Watches tool calls and can refuse them
  • Hooks prompt.submit, session.start
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • 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 spawn-pane by Eddy Ogutu (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/eddyficial-spawn-pane/
// 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: "Workers" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const length = '…'
    const working = '…'
    const needsYou = '…'
    const sum = '…'
    const costUsd = '…'
    const name = '…'
    const model = '…'
    const STATUS_TEXT = '…'
    const age = '…'
    const money = '…'
    const note = '…'
    const c = '…'
    const name2 = '…'
    const model2 = '…'
    const STATUS_TEXT2 = '…'
    const age2 = '…'
    const money2 = '…'
    const note2 = '…'
    const name3 = '…'
    const model3 = '…'
    const STATUS_TEXT3 = '…'
    const age3 = '…'
    const money3 = '…'
    const note3 = '…'
    return (
      <Box flexDirection="column" paddingX={1}>
        <Box justifyContent="space-between">
          <Text>
            <Text bold>
              {length}
              {" open"}
            </Text>
            <Text color="#F59E0B">
              {" · "}
              {working}
              {" working"}
            </Text>
            <Text bold>
              {" · "}
              {needsYou}
              {" need you"}
            </Text>
          </Text>
          <Text bold color="green">
            {`${sum}${costUsd}`}
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box justifyContent="space-between" gap={1}>
            <Text wrap="truncate-end">
              <Text bold>
                ▌
              </Text>
              <Text bold>
                {" "}
                {name}
              </Text>
              <Text>
                {" "}
                {model}
              </Text>
              <Text dimColor>
                {" read-only"}
              </Text>
              <Text>
                {"  "}
                {"● "}
                {STATUS_TEXT}
              </Text>
            </Text>
            <Box gap={1} flexShrink={0}>
              <Text dimColor>
                {age}
                {" · "}
                {money}
              </Text>
              <Button label="■ stop" variant="primary" />
              <Button label="close" dimColor />
            </Box>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap">
              {note}
            </Text>
          </Box>
          <Box paddingLeft={2} gap={1}>
            <Button label="✓ approve" variant="primary" />
            <Button label="✕ deny" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label="▶ continue" variant="primary" />
            <Button label="close" dimColor />
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box justifyContent="space-between" gap={1}>
            <Text wrap="truncate-end">
              <Text bold>
                ▌
              </Text>
              <Text bold>
                {" "}
                {name2}
              </Text>
              <Text>
                {" "}
                {model2}
              </Text>
              <Text dimColor>
                {" read-only"}
              </Text>
              <Text>
                {"  "}
                {"● "}
                {STATUS_TEXT2}
              </Text>
            </Text>
            <Box gap={1} flexShrink={0}>
              <Text dimColor>
                {age2}
                {" · "}
                {money2}
              </Text>
              <Button label="■ stop" variant="primary" />
              <Button label="close" dimColor />
            </Box>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap">
              {note2}
            </Text>
          </Box>
          <Box paddingLeft={2} gap={1}>
            <Button label="✓ approve" variant="primary" />
            <Button label="✕ deny" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label="▶ continue" variant="primary" />
            <Button label="close" dimColor />
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box justifyContent="space-between" gap={1}>
            <Text wrap="truncate-end">
              <Text bold>
                ▌
              </Text>
              <Text bold>
                {" "}
                {name3}
              </Text>
              <Text>
                {" "}
                {model3}
              </Text>
              <Text dimColor>
                {" read-only"}
              </Text>
              <Text>
                {"  "}
                {"● "}
                {STATUS_TEXT3}
              </Text>
            </Text>
            <Box gap={1} flexShrink={0}>
              <Text dimColor>
                {age3}
                {" · "}
                {money3}
              </Text>
              <Button label="■ stop" variant="primary" />
              <Button label="close" dimColor />
            </Box>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap">
              {note3}
            </Text>
          </Box>
          <Box paddingLeft={2} gap={1}>
            <Button label="✓ approve" variant="primary" />
            <Button label="✕ deny" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label={`${c}…`} variant="primary" />
            <Button label="▶ continue" variant="primary" />
            <Button label="close" dimColor />
          </Box>
        </Box>
        <Box marginTop={1}>
          <Text dimColor italic>
            costs are API-equivalent estimates
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const model = '…'
    const name = '…'
    await $.ui.toast(`Opened ${model} worker in ${name}`)
    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 929–1028 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const list = await read($, workers)
    const now = Date.now()
    const open = list.filter(w => w.status !== 'closed')
    const total = open.reduce((sum, w) => sum + w.costUsd, 0)
    const working = open.filter(w => w.status === 'working').length
    const needsYou = open.filter(w => w.status === 'needs-you').length
    // Blinking rows show their color on the "on" beats and go grey between.
    const shade = (w: Worker) => (BLINKS.has(w.status) && !blinkOn ? 'gray' : STATUS_COLORS[w.status])
    const act = (w: Worker, run: () => Promise<string>) => () => void run().then(msg => $.ui.toast(msg)).catch(() => undefined)

    if (open.length === 0)
      return (
        <Box flexDirection="column" paddingX={1} paddingY={1}>
          <Text dimColor>No workers open.</Text>
          <Text dimColor italic>Ask the planner, e.g. "check the api project".</Text>
        </Box>
      )

    // One row per worker, so many fit; a second, dim row for what it's waiting
    // on, or its summary (else the last line of its latest reply). A Button's
    // label must be plain text: a styled child makes the whole pane fail to draw.
    return (
      <Box flexDirection="column" paddingX={1}>
        <Box justifyContent="space-between">
          <Text>
            <Text bold>{open.length} open</Text>
            {working > 0 && <Text color={STATUS_COLORS.working}> · {working} working</Text>}
            {needsYou > 0 && <Text bold color={STATUS_COLORS['needs-you']}> · {needsYou} need you</Text>}
          </Text>
          <Text bold color="green">{money(total)}</Text>
        </Box>

        {open.map(w => {
          // What it needs from the user: a permission prompt, or a question it ended on.
          const asking = w.status === 'needs-you' && w.pending !== undefined
          const boxed = w.status === 'needs-you' && !asking && w.box === true
          const questioning = w.status === 'needs-you' && !asking && !boxed && w.question !== undefined
          const urgent = asking || questioning || boxed
          const running = w.background?.length ?? 0
          const latest = w.summary ?? w.lastLine
          const note = asking
            ? `waiting: ${w.pending}`
            : questioning || boxed
              ? `asks: ${w.question}${boxed && !w.choices ? ' (answer it in its tab)' : ''}`
              : running > 0 && w.last === 'turn-end'
                ? `${running} background task${running === 1 ? '' : 's'} still running${latest ? ` · ${latest}` : ''}`
                : latest
          return (
            <Box key={`card-${w.id}`} flexDirection="column" marginTop={1}>
              <Box justifyContent="space-between" gap={1}>
                <Text wrap="truncate-end">
                  <Text color={shade(w)} bold>▌</Text>
                  <Text bold> {w.name}</Text>
                  <Text color={MODEL_COLORS[w.model]}> {w.model}</Text>
                  {w.readOnly && <Text dimColor> read-only</Text>}
                  <Text color={shade(w)} bold={w.status === 'needs-you'} dimColor={w.status === 'starting'}>
                    {'  '}● {STATUS_TEXT[w.status]}
                  </Text>
                </Text>
                <Box gap={1} flexShrink={0}>
                  <Text dimColor>
                    {age(w.startedAt, now)} · {money(w.costUsd)}
                  </Text>
                  {BLINKS.has(w.status) && !urgent && <Button key={`stop-${w.id}`} label="■ stop" variant="primary" onPress={act(w, () => stopWorker($, w))} />}
                  {!BLINKS.has(w.status) && <Button key={`close-${w.id}`} label="close" dimColor onPress={act(w, () => closeAll($, [w]).then(l => l.join('; ')))} />}
                </Box>
              </Box>
              {/* Wrapped, not cut off: a question or a request must be readable here. */}
              {note && (
                <Box paddingLeft={2}>
                  <Text color={urgent ? STATUS_COLORS['needs-you'] : undefined} dimColor={!urgent} italic={!urgent} wrap="wrap">
                    {note}
                  </Text>
                </Box>
              )}
              {/* The answers sit under what they answer, keeping the top row readable. */}
              {urgent && (
                <Box paddingLeft={2} gap={1}>
                  {asking && <Button key={`approve-${w.id}`} label="✓ approve" variant="primary" onPress={act(w, () => answerWorker($, w, 'approve'))} />}
                  {asking && <Button key={`deny-${w.id}`} label="✕ deny" onPress={act(w, () => answerWorker($, w, 'deny'))} />}
                  {boxed &&
                    w.choices?.map((c, i) => (
                      <Button key={`choice-${w.id}-${i}`} label={c.length > 24 ? `${c.slice(0, 23)}…` : c} variant={i === 0 ? 'primary' : undefined} onPress={act(w, () => answerBox($, w, String(i + 1)))} />
                    ))}
                  {questioning && <Button key={`continue-${w.id}`} label="▶ continue" variant="primary" onPress={act(w, () => replyToWorker($, w, 'continue'))} />}
                  {questioning && <Button key={`close-${w.id}`} label="close" dimColor onPress={act(w, () => closeAll($, [w]).then(l => l.join('; ')))} />}
                </Box>
              )}
            </Box>
          )
        })}

        <Box marginTop={1}>
          <Text dimColor italic>costs are API-equivalent estimates</Text>
        </Box>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Eddy Ogutu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

runs programswrites filesenv varstool 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 97f3b3ac2e0f 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.tsx
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).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:155 a program named at run time; hooks/register.tsx:183 a program named at run time; hooks/register.tsx:192 a program named at run time; hooks/register.tsx:596 a program named at run time; hooks/register.tsx:616 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the 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 eddyficial/spawn-pane
/plugin install spawn-pane@spawn-pane

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

Search them from Claude: the MCP connector

Similar designs