modscode JA

modscode / Gallery / modsmith

modsmith

A workbench for building Claude Code mods: which mods loaded, a live tape of every event with its real payload, the four ship gates on the mod in progress, and tools so Claude can read payloads and run the gates itself

Code you can checkTerminal + desktopPaneBandBoxButtonMarkdownText

What it does

  • Draws a band above the prompt, a pane
  • Watches tool calls and can refuse them
  • Hooks agent.spawn, plugin.register, prompt.submit, session.append and 8 more
  • Starts processes

Good points

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

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

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

// Drawn like modsmith by Bar Moshe (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/barmoshe-modsmith/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    const parts = '…'
    return (
      <Box flexDirection="column">
        <Text color="#ff4d4f">
          {parts}
        </Text>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "modsmith" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Markdown } = $.ui.resolve(e)
    const banner = '…'
    const length = '…'
    const provenance = '…'
    const version = '…'
    const source = '…'
    const reloads = '…'
    const gateLine = '…'
    const gateLine2 = '…'
    const gateLine3 = '…'
    const n = '…'
    const tail = '…'
    const f = '…'
    const line = '…'
    const event = '…'
    const payload = '…'
    return (
      <Box flexDirection="column" gap={1} paddingX={1}>
        <Text color="#ffb020">
          {banner}
        </Text>
        <Box flexDirection="column">
          <Text bold>
            {`Mods (${length})`}
          </Text>
          <Text dimColor>
            None seen loading yet. /modsmith refreshes the list.
          </Text>
          <Box columnGap={1}>
            <Text color="#2fbf71" wrap="truncate-end">
              {`${provenance} ${version} · ${source} · ${length} hooks · ${length} calls · ↻${reloads}`}
            </Text>
            <Button plain label="target" />
          </Box>
          <Box columnGap={1}>
            <Text color="#2fbf71" wrap="truncate-end">
              {`${provenance} ${version} · ${source} · ${length} hooks · ${length} calls · ↻${reloads}`}
            </Text>
            <Button plain label="target" />
          </Box>
          <Box columnGap={1}>
            <Text color="#2fbf71" wrap="truncate-end">
              {`${provenance} ${version} · ${source} · ${length} hooks · ${length} calls · ↻${reloads}`}
            </Text>
            <Button plain label="target" />
          </Box>
        </Box>
        <Box flexDirection="column">
          <Text bold>
            Gates · no target
          </Text>
          <Text color="#2fbf71">
            {gateLine}
          </Text>
          <Text color="#2fbf71">
            {gateLine2}
          </Text>
          <Text color="#2fbf71">
            {gateLine3}
          </Text>
          <Text>
            ✓ eyes
          </Text>
          <Box flexWrap="wrap" columnGap={1}>
            <Button label="Run all" variant="primary" />
            <Button label="validate" />
            <Button label="types" />
            <Button label="tests" />
          </Box>
          <Box flexWrap="wrap" columnGap={1}>
            <Button plain label="☑ terminal" />
            <Button plain label="☑ desktop" />
            <Button plain label="☑ narrow" />
          </Box>
          <Text color="#ffb020">
            {`! ${n}`}
          </Text>
          <Text color="#ffb020">
            {`! ${n}`}
          </Text>
          <Text color="#ffb020">
            {`! ${n}`}
          </Text>
          <Markdown text={`\`\`\`
${tail}
\`\`\``} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {`Tape (${length}/150) · paused`}
          </Text>
          <Box flexWrap="wrap" columnGap={1}>
            <Button plain label="[all]" />
            <Button plain label={`[${f}]`} />
            <Button plain label={`[${f}]`} />
            <Button plain label={`[${f}]`} />
            <Button label="Resume" />
            <Button label="Clear" />
          </Box>
          <Text dimColor>
            Nothing recorded yet.
          </Text>
          <Button plain label={`${line}`} />
          <Button plain label={`${line}`} />
          <Button plain label={`${line}`} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {`${event} · e`}
          </Text>
          <Markdown text={`\`\`\`json
${payload}
\`\`\``} />
          <Button label="Copy payload" />
        </Box>
      </Box>
    )
  })
}

The mod's own code

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

modsmith/hooks/register.tsx lines 415–433 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const r = await read($, lastReload)
    if (r === null || e.props.hasSurvey) return next(e)
    const g = await read($, gates)
    const isTarget = (await read($, target)) === r.root
    const parts = [`↻ ${r.name} reloaded`, `${r.hooks} hooks`]
    if (r.validate !== 'idle') parts.push(`validate ${markOf(r.validate)}`)
    if (isTarget && g.types.status !== 'idle') parts.push(`types ${markOf(g.types.status)}`)
    if (isTarget && g.tests.status !== 'idle') parts.push(`tests ${markOf(g.tests.status)}`)
    const { Box, Text } = $.ui.resolve(e)
    const mine = <Text color={r.validate === 'fail' ? '#ff4d4f' : '#2fbf71'}>{parts.join(' · ')}</Text>
    const below = await next(e)
    return (
      <Box flexDirection="column">
        {mine}
        {below}
      </Box>
    )
  })
modsmith/hooks/register.tsx lines 435–574 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const list = await read($, tape)
    const pick = await read($, selected)
    const only = await read($, filter)
    const isPaused = await read($, paused)
    const roster = await read($, mods)
    const dir = await read($, target)
    const g = await read($, gates)
    const seen = await read($, eyes)
    const v = await read($, versions)
    const notes = await read($, ship)
    const cols = e.props.bodyColumns
    const isNarrow = cols < 50
    const rows = list.filter(x => only === 'all' || x.family === only)
    const chosen = rows.find(x => x.id === pick) ?? null
    const present = FAMILIES.filter(f => list.some(x => x.family === f))
    const devs = roster.filter(m => isDev(m.provenance) && m.root)

    const runAll = () => {
      if (dir) runGates($, dir, GATE_NAMES).catch(() => undefined)
    }
    const runOne = (name: GateName) => () => {
      if (dir) runGates($, dir, [name]).catch(() => undefined)
    }
    const flip = (k: 'terminal' | 'desktop' | 'narrow') => () => update($, eyes, was => ({ ...was, [k]: !was[k] }))
    const line = (x: Entry) => `${clockTime(x.at)}  ${x.event}  ${x.summary}${x.outcome ? ` · ${x.outcome}` : ''}`
    const gateLine = (name: GateName) => {
      const it = g[name]
      const time = it.ms === undefined ? '' : ` ${(it.ms / 1000).toFixed(1)}s`
      return `${markOf(it.status)} ${name}${time}${it.note ? `: ${it.note}` : ''}`
    }
    const failing = GATE_NAMES.find(n => g[n].status === 'fail' && g[n].tail)
    const banner = v
      ? `CLI ${v.cli} · engine ${v.engine}${v.isCliOlder ? ' · CLI is older than the engine: validate may fail correct code' : ''}`
      : 'Versions unchecked'

    const { Box, Text, Button, Markdown } = $.ui.resolve(e)

    const gatesSection = (
      <Box flexDirection="column">
        <Text bold>{`Gates · ${dir ? baseName(dir) : 'no target'}`}</Text>
        {GATE_NAMES.map(n => (
          <Text color={g[n].status === 'pass' ? '#2fbf71' : g[n].status === 'fail' ? '#ff4d4f' : undefined}>{gateLine(n)}</Text>
        ))}
        <Text>{`${seen.terminal && seen.desktop && seen.narrow ? '✓' : '·'} eyes`}</Text>
        <Box flexWrap="wrap" columnGap={1}>
          <Button key="run-all" label="Run all" variant="primary" onPress={runAll} />
          <Button key="run-validate" label="validate" onPress={runOne('validate')} />
          <Button key="run-types" label="types" onPress={runOne('types')} />
          <Button key="run-tests" label="tests" onPress={runOne('tests')} />
        </Box>
        <Box flexWrap="wrap" columnGap={1}>
          <Button key="eye-terminal" plain label={`${seen.terminal ? '☑' : '☐'} terminal`} onPress={flip('terminal')} />
          <Button key="eye-desktop" plain label={`${seen.desktop ? '☑' : '☐'} desktop`} onPress={flip('desktop')} />
          <Button key="eye-narrow" plain label={`${seen.narrow ? '☑' : '☐'} narrow`} onPress={flip('narrow')} />
        </Box>
        {notes.map(n => (
          <Text color="#ffb020">{`! ${n}`}</Text>
        ))}
        {failing && <Markdown key="gate-tail" text={`\`\`\`\n${g[failing].tail}\n\`\`\``} />}
      </Box>
    )

    if (isNarrow) {
      return (
        <Box flexDirection="column" gap={1}>
          {gatesSection}
          <Box flexDirection="column">
            {rows.slice(-8).map(x => (
              <Text color={FAMILY_COLOR[x.family]} wrap="truncate-end">{line(x)}</Text>
            ))}
          </Box>
        </Box>
      )
    }

    return (
      <Box flexDirection="column" gap={1} paddingX={1}>
        <Text dimColor={!v?.isCliOlder} color={v?.isCliOlder ? '#ffb020' : undefined}>{banner}</Text>

        <Box flexDirection="column">
          <Text bold>{`Mods (${roster.length})`}</Text>
          {roster.length === 0 && <Text dimColor>None seen loading yet. /modsmith refreshes the list.</Text>}
          {roster.slice(0, 12).map((m, i) => (
            <Box columnGap={1}>
              <Text color={m.source === 'seen' ? '#2fbf71' : undefined} dimColor={m.source !== 'seen'} wrap="truncate-end">
                {`${m.provenance}${m.version ? ` ${m.version}` : ''} · ${m.source}${m.source === 'seen' ? ` · ${m.events.length} hooks · ${m.calls.length} calls · ↻${m.reloads}` : ''}`}
              </Text>
              {m.root && m.root !== dir && (isDev(m.provenance) || devs.length === 0) && (
                <Button key={`target-${i}`} plain label="target" onPress={() => update($, target, () => m.root)} />
              )}
            </Box>
          ))}
        </Box>

        {gatesSection}

        <Box flexDirection="column">
          <Text bold>{`Tape (${list.length}/${TAPE_SIZE})${isPaused ? ' · paused' : ''}`}</Text>
          <Box flexWrap="wrap" columnGap={1}>
            <Button key="filter-all" plain label={only === 'all' ? '[all]' : 'all'} onPress={() => update($, filter, () => 'all')} />
            {present.map(f => (
              <Button key={`filter-${f}`} plain label={only === f ? `[${f}]` : f} onPress={() => update($, filter, () => f)} />
            ))}
            <Button key="pause" label={isPaused ? 'Resume' : 'Pause'} onPress={() => update($, paused, was => !was)} />
            <Button
              key="clear"
              label="Clear"
              onPress={async () => {
                await update($, tape, () => [])
                await update($, selected, () => null)
              }}
            />
          </Box>
          {rows.length === 0 && <Text dimColor>Nothing recorded yet.</Text>}
          {rows.slice(-30).map(x => (
            <Button
              key={`row-${x.id}`}
              plain
              label={line(x)}
              dimColor={x.id !== pick}
              onPress={() => update($, selected, was => (was === x.id ? null : x.id))}
            />
          ))}
        </Box>

        {chosen && (
          <Box flexDirection="column">
            <Text bold>{`${chosen.event} · e`}</Text>
            <Markdown key="payload" text={`\`\`\`json\n${chosen.payload}\n\`\`\``} />
            <Button
              key="copy"
              label="Copy payload"
              onPress={press => $.ui.copy({ text: chosen.payload, surface: press.surface })}
            />
          </Box>
        )}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Bar Moshe

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 programsreads filesenv varstool calls

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 6dfc1a31dd4f 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.modsmith/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.modsmith/hooks/register.tsx:75 a program named at run time
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 barmoshe/bar-mods
/plugin install modsmith@bar-mods

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

Search them from Claude: the MCP connector

Similar designs