modscode JA

modscode / Gallery / basepaint

basepaint

Live BasePaint canvas and activity feed while Claude works

Code you can checkTerminal + desktopPaneToastBoxText

What it does

  • Draws a pane, toasts
  • Adds /basepaint
  • Hooks session.start, turn.abort, turn.complete, turn.start and 1 more
  • Keeps its own state between turns
  • Calls the network

Good points

  • 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 basepaint by zherring (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/zherring-basepaint/
// 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: "BasePaint" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const formatStatsLine = '…'
    const by = '…'
    const artists = '…'
    const i = '…'
    const label = '…'
    const formatPainted = '…'
    const formatShare = '…'
    const i2 = '…'
    const label2 = '…'
    const formatPainted2 = '…'
    const formatShare2 = '…'
    const i3 = '…'
    const label3 = '…'
    const formatPainted3 = '…'
    const formatShare3 = '…'
    const err = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="column" paddingX={1} paddingY={1}>
          <Text dimColor wrap="truncate">
            {formatStatsLine}
          </Text>
          <Text wrap="truncate">
            {"Theme: "}
            <Text bold>
              untitled
            </Text>
            {`, proposed by ${by}`}
          </Text>
          <Box flexWrap="wrap" gap={1} marginTop={1}>
            <Text>
              {"  "}
            </Text>
            <Text>
              {"  "}
            </Text>
            <Text>
              {"  "}
            </Text>
          </Box>
        </Box>
        <Box marginBottom={1}>
          <Box paddingX={1}>
            <Text dimColor>
              canvas offline
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" paddingX={1}>
          <Text dimColor>
            canvas offline
          </Text>
          <Box flexDirection="column">
            <Text color="green" bold>
              {`● TOP PAINTERS · ${artists} ARTISTS`}
            </Text>
            <Box>
              <Box width={3}>
                <Text bold color="cyan">
                  {i}
                </Text>
              </Box>
              <Box width={18}>
                <Text bold color="cyan" wrap="truncate">
                  {label}
                </Text>
              </Box>
              <Box flexGrow={1}>
                <Text wrap="truncate">
                  {formatPainted}
                </Text>
              </Box>
              <Text dimColor>
                {formatShare}
              </Text>
            </Box>
            <Box>
              <Box width={3}>
                <Text bold color="cyan">
                  {i2}
                </Text>
              </Box>
              <Box width={18}>
                <Text bold color="cyan" wrap="truncate">
                  {label2}
                </Text>
              </Box>
              <Box flexGrow={1}>
                <Text wrap="truncate">
                  {formatPainted2}
                </Text>
              </Box>
              <Text dimColor>
                {formatShare2}
              </Text>
            </Box>
            <Box>
              <Box width={3}>
                <Text bold color="cyan">
                  {i3}
                </Text>
              </Box>
              <Box width={18}>
                <Text bold color="cyan" wrap="truncate">
                  {label3}
                </Text>
              </Box>
              <Box flexGrow={1}>
                <Text wrap="truncate">
                  {formatPainted3}
                </Text>
              </Box>
              <Text dimColor>
                {formatShare3}
              </Text>
            </Box>
            <Text dimColor>
              leaderboard unavailable
            </Text>
          </Box>
          <Text dimColor wrap="truncate">
            {`last error: ${err}`}
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`BasePaint mod loaded · /basepaint to open the pane`)
    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.

basepaint/hooks/register.tsx lines 455–581 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const ui = $.ui.resolve(e)
    const { Box, Text } = ui
    const Image = 'Image' in ui ? ui.Image : undefined

    // A hot reload drops the timers while the pane stays up: re-arm them.
    try {
      if (!polling) startPolling($)
    } catch {
      // polling resumes on the next open
    }

    const [view, st, dayN, endsAt, themeName, by, colors, img, rows, nameMap, usd, count, err, top, topFail] =
      await Promise.all([
        read($, viewDay),
        read($, stats),
        read($, day),
        read($, dayEnd),
        read($, theme),
        read($, proposer),
        read($, palette),
        read($, image),
        read($, feed),
        read($, names),
        read($, ethUsd),
        read($, online),
        read($, lastError),
        read($, topPainters),
        read($, topFailed),
      ])
    const now = Math.floor((await $.clock.now()) / 1000)
    const width = Math.max(20, e.props.bodyColumns)
    const roomRows = e.viewport?.rows ?? 40
    // Terminal cells are about twice as tall as wide, so a square picture of
    // N columns needs N / 2 rows. Leave ~16 rows for the text around it.
    const imgRows = Math.max(6, Math.min(Math.floor(width / 2), roomRows - 16, 127))
    const imgCols = Math.min(width, imgRows * 2)

    const label = (row: { address: string }) =>
      nameMap[row.address.toLowerCase()] ?? shortAddress(row.address)

    return (
      <Box flexDirection="column">
        <Box flexDirection="column" paddingX={1} paddingY={1}>
          <Text dimColor wrap="truncate">
            {view > 0
              ? formatStatsLine(view, st)
              : dayN > 0
                ? `day ${dayN} · ${formatTimeLeft(endsAt - now)}`
                : 'loading…'}
          </Text>
          <Text wrap="truncate">
            {'Theme: '}
            <Text bold>{themeName ?? (view > 0 ? 'untitled' : 'TBD')}</Text>
            {view > 0 ? (by ? `, proposed by ${by}` : '') : `, proposed by ${by ?? 'unknown'}`}
          </Text>
          <Box flexWrap="wrap" gap={1} marginTop={1}>
            {colors.map(hex => (
              <Text key={hex} backgroundColor={hex}>{'  '}</Text>
            ))}
          </Box>
        </Box>
        <Box marginBottom={1}>
          {Image && img.path ? (
            <Image
              key="canvas"
              source={{ file: img.path, format: 'png', generation: img.generation }}
              columns={imgCols}
              rows={imgRows}
              alt="BasePaint canvas"
            />
          ) : (
            <Box paddingX={1}>
              <Text dimColor>{img.isOffline ? 'canvas offline' : 'loading canvas…'}</Text>
            </Box>
          )}
        </Box>
        <Box flexDirection="column" paddingX={1}>
          {img.path && img.isOffline && <Text dimColor>canvas offline</Text>}
          {view > 0 ? (
            <Box flexDirection="column">
              <Text color="green" bold>
                {`● TOP PAINTERS${st ? ` · ${st.artists.toLocaleString('en-US')} ARTISTS` : ''}`}
              </Text>
              {top.map((p, i) => (
                <Box key={p.address}>
                  <Box width={3}>
                    <Text bold color="cyan">{String(i + 1)}</Text>
                  </Box>
                  <Box width={18}>
                    <Text bold color="cyan" wrap="truncate">
                      {label(p)}
                    </Text>
                  </Box>
                  <Box flexGrow={1}>
                    <Text wrap="truncate">{formatPainted(p.pixels)}</Text>
                  </Box>
                  <Text dimColor>{formatShare(p.pixels, st?.pixels)}</Text>
                </Box>
              ))}
              {top.length === 0 && topFail && <Text dimColor>leaderboard unavailable</Text>}
            </Box>
          ) : (
            <Box flexDirection="column">
              <Text color="green" bold>
                {`● ${count ?? '?'} USERS ONLINE`}
              </Text>
              {rows.map(row => (
                <Box key={row.id}>
                  <Box width={18}>
                    <Text bold color="cyan" wrap="truncate">
                      {label(row)}
                    </Text>
                  </Box>
                  <Box flexGrow={1}>
                    <Text wrap="truncate">{rowText(row, usd)}</Text>
                  </Box>
                  <Text dimColor>{relativeTime(now, row.timestamp)}</Text>
                </Box>
              ))}
            </Box>
          )}
          {err && <Text dimColor wrap="truncate">{`last error: ${err}`}</Text>}
        </Box>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 zherring

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

networkruns programsenv varsremembers

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 2e9462293fb7 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.basepaint/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).basepaint/hooks/register.tsx:137 mkdir (not on Windows); basepaint/hooks/register.tsx:144 mv (not on Windows)
NetworkWhether every fetch names its https host in the code.basepaint/hooks/register.tsx:100 fetch(url); basepaint/hooks/register.tsx:230 fetch(resolveNameUrl(row.address))
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.basepaint/hooks/register.tsx:139 curl (reaches the network)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables 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 zherring/basepaint-claude-mod
/plugin install basepaint@basepaint-claude-mod

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

Search them from Claude: the MCP connector

Similar designs