modscode JA

modscode / Gallery / pixlings

pixlings

A tiny pixel creature that lives above your Claude Code prompt. It counts down your prompt cache and guards it on model switches, wakes Claude when your usage limit resets, brings a helper for every subagent, makes sound on Windows and Lin…

Code you can checkTerminal + desktopPaneBandToastBoxButtonSvgText

What it does

  • Draws a band above the prompt, a pane
  • Adds /pixling, /buddy
  • Watches tool calls and can refuse them
  • Hooks classic.Notification, classic.PostModelSwitch, classic.PreModelSwitch, classic.StopFailure and 12 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

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 pixlings by cglremrcn (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/cglremrcn-pixlings/
// 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, Svg, Text, Button } = $.ui.resolve(e)
    const toSvg = '…'
    const name = '…'
    const text = '…'
    const level = '…'
    const stars = '…'
    const xpInto = '…'
    const xpNeed = '…'
    const persona = '…'
    const lines = '…'
    const lines2 = '…'
    const lines3 = '…'
    const length = '…'
    const heard = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" alignItems="flex-end">
          <Svg source={`${toSvg}`} alt={`${name} the ${name}`} />
          <Box flexDirection="column" marginLeft={1} flexShrink={1}>
            <Box borderStyle="round" paddingX={1}>
              <Text wrap="wrap">
                {text}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text bold>
                {name}
              </Text>
              <Text dimColor>
                {` Lv ${level} · ${name} ${stars}`}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text>
                ████████░░░░░░░░
              </Text>
              <Text dimColor>
                {` ${xpInto}/${xpNeed}  `}
              </Text>
              <Button label="cancel auto-continue" plain />
            </Box>
            <Box flexDirection="row" flexWrap="wrap">
              <Text>
                {` · ${text}`}
              </Text>
              <Text>
                {` · ${text}`}
              </Text>
              <Text>
                {` · ${text}`}
              </Text>
            </Box>
            <Box position="absolute" bottom={0} left={0} display="none" flexDirection="column" borderStyle="round" backgroundColor="#1a1b26" paddingX={1}>
              <Box flexDirection="column">
                <Text wrap="truncate-end">
                  {persona}
                </Text>
                <Box flexDirection="row">
                  <Box flexDirection="column" marginLeft={1} flexShrink={0}>
                    <Text bold>
                      {lines}
                    </Text>
                    <Text dimColor>
                      {lines2}
                    </Text>
                    <Text dimColor>
                      {lines3}
                    </Text>
                  </Box>
                  <Box flexDirection="row" marginLeft={3} columnGap={1}>
                    0
                    0
                    0
                  </Box>
                  <Box flexDirection="column" marginLeft={1} flexShrink={0}>
                    <Text bold>
                      {`${length}/${length}`}
                    </Text>
                    <Text dimColor>
                      badges
                    </Text>
                  </Box>
                </Box>
                <Text wrap="truncate-end">
                  {heard}
                </Text>
              </Box>
            </Box>
          </Box>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "‹title›" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    return (
      <Box flexDirection="row" alignItems="center" columnGap={2}>
        <Text>
          An egg, hatching
        </Text>
        <Box flexDirection="column" flexShrink={1}>
          <Text bold>
            Hatching…
          </Text>
          <Text dimColor wrap="wrap">
            Any second now.
          </Text>
        </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.

plugins/pixlings/hooks/register.tsx lines 2164–2293 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const v = await read($, view)
    const p = pixling
    if (e.props.hasSurvey || bandMode === 'off' || !v || !p || e.props.maxRows < 1) return next(e)
    // Sent away: nothing of it shows until it is called back.
    if ((await read($, roomAway)) === true) {
      bandId = null
      return next(e)
    }
    const said = await read($, bubbleAtom)
    const napping = await read($, napAtom)
    const pieces = wantsVitals ? await read($, vitalsAtom) : []
    await read($, hatchAtom)
    const persona = personaLine(await read($, roomPersona))
    bandColumns = e.props.bodyColumns
    const s = speciesById(v.speciesId) ?? SPECIES[0]!
    const color = hex(RARITY_COLOR[s.rarity])
    const at = now()
    const text = sayingNow(napping, said, at)
    // Under the pointer the band shows its card: who it is, the streak, the badges, the days
    // together and what it heard. The surface reveals it; no hook runs.
    const card = cardModel(p, persona, at)

    const frame = bandMode === 'full' ? frameAt(at) : null
    const width = frame ? Math.max(16, Math.min(56, e.props.bodyColumns - frame.w - 4)) : 0
    // The card opens past the info rows, over the band's empty right, so its shelf has room.
    const cardWidth = frame ? Math.max(width, Math.min(CARD_MAX, e.props.bodyColumns - frame.w - 4)) : 0
    // The full band is as tall as the sprite or the column beside it; past the rows it may take,
    // it folds into the one-line band.
    const columnRows = 2 + (pieces.length > 0 ? 1 : 0) + (text ? 2 + Math.ceil(text.length / Math.max(1, width - 4)) : 0)
    isCramped = frame !== null && Math.max(rowsFor(frame), columnRows) > e.props.maxRows

    if (!frame || isCramped) {
      bandId = null
      const mood = (await read($, moodAtom)) as Mood
      const face = `${FACES[mood] ?? FACES.idle} `
      // The card's line goes in the room the line leaves, sized to it, so revealing it moves
      // nothing: a row that overflowed would squeeze the name.
      const spare =
        e.props.bodyColumns - 1 - face.length - v.name.length - ` · Lv ${v.level}`.length -
        (pieces[0] ? pieces[0].text.length + 2 : 0) - (text ? text.length + 2 : 0)
      const { Box, Text } = $.ui.resolve(e)
      return (
        <Box key="band" flexDirection="row">
          <Text color={color}>{face}</Text>
          <Text bold>{v.name}</Text>
          <Text dimColor>{` · Lv ${v.level}`}</Text>
          {pieces[0] ? <Text color={TONE_COLOR[pieces[0].tone]} dimColor={pieces[0].tone === 'dim'}>{`  ${pieces[0].text}`}</Text> : null}
          {text ? isCramped ? <Text wrap="truncate-end">{`  ${text}`}</Text> : <Text>{`  ${text}`}</Text> : null}
          {spare >= 12 ? (
            <Box display="none" hover={{ display: 'flex' }} width={spare} flexShrink={0}>
              <Text dimColor wrap="truncate-end">{`  ${briefLine(p, persona, at)}`}</Text>
            </Box>
          ) : null}
        </Box>
      )
    }

    lastFrame = frame
    const stars = `${RARITY_STARS[s.rarity]}${v.isShiny ? ' ✦' : ''}`

    const info = (Box: Kit['Box'], Text: Kit['Text'], Button: Kit['Button'], kit: RoomKit) => (
      <Box flexDirection="column" marginLeft={1} flexShrink={1} width={width}>
        {text ? (
          <Box borderStyle="round" borderColor={color} paddingX={1} width={width}>
            <Text wrap="wrap">{text}</Text>
          </Box>
        ) : null}
        <Box flexDirection="row">
          <Text bold color={color}>
            {v.name}
          </Text>
          <Text dimColor>{` Lv ${v.level} · ${s.name} ${stars}`}</Text>
        </Box>
        <Box flexDirection="row">
          <Text color={color}>{xpBar(v.xpInto, v.xpNeed, 12)}</Text>
          <Text dimColor>{` ${v.xpInto}/${v.xpNeed}  `}</Text>
          {napping?.isAuto ? (
            <Button key="cancel-nap" label="cancel auto-continue" plain onPress={() => void cancelNap()} />
          ) : null}
        </Box>
        {pieces.length > 0 ? (
          <Box flexDirection="row" flexWrap="wrap">
            {pieces.map((piece, i) => (
              <Text color={TONE_COLOR[piece.tone]} dimColor={piece.tone === 'dim'}>
                {`${i > 0 ? ' · ' : ''}${piece.text}`}
              </Text>
            ))}
          </Box>
        ) : null}
        {/* Opaque, with its own ink, so the rows it covers never show through, on a dark terminal or a light one. */}
        <Box
          position="absolute"
          bottom={0}
          left={0}
          width={cardWidth}
          display="none"
          hover={{ display: 'flex' }}
          flexDirection="column"
          borderStyle="round"
          borderColor={color}
          backgroundColor={CARD_FILL}
          paddingX={1}
        >
          {drawCard(kit, card, cardWidth, CARD_FILL_PX, CARD_INK)}
        </Box>
      </Box>
    )

    if (e.surface === 'terminal') {
      const { Box, Text, Button, Raster } = $.ui.resolve(e)
      bandId = e.requestId ?? null
      const raster = rasterOf(frame)
      bandRows = raster.rows
      return (
        <Box key="band" flexDirection="row" alignItems="flex-end">
          <Raster key={RASTER_KEY} columns={raster.columns} rows={raster.rows} cells={raster.cells} />
          {info(Box, Text, Button, { Box, Text, Button, Raster })}
        </Box>
      )
    }
    svgSeenAt = at
    const { Box, Text, Button, Svg } = $.ui.resolve(e)
    return (
      <Box key="band" flexDirection="row" alignItems="flex-end">
        <Svg source={toSvg(frame, 4)} alt={`${v.name} the ${s.name}`} width={frame.w * 4} height={frame.h * 4} />
        {info(Box, Text, Button, { Box, Text, Button, Svg })}
      </Box>
    )
  })
plugins/pixlings/hooks/lib/room.ts lines 236–283 · Band
export const drawCard = (kit: RoomKit, m: CardModel, width: number, fill: number, ink: string): RenderElement => {
  const { Box, Text } = kit
  const lines = [`${m.streak.days}-day streak`, `best ${m.streak.best}`, `${plural(m.days, 'day')} together`]
  const textColumns = Math.max(...lines.map(l => l.length))
  const fits = Math.min(m.earned.length, shelfFits(width, textColumns))
  // Not slice(-0), which is every badge.
  const shown = fits > 0 ? m.earned.slice(-fits) : []
  const icon = (b: Badge, key: string, alt = b.name) => picture(kit, cardIcon(b, fill), ICON_SCALE, key, alt)
  return Box({
    flexDirection: 'column',
    children: [
      Text({ color: ink, wrap: 'truncate-end', children: m.persona }),
      Box({
        flexDirection: 'row',
        children: [
          icon(STREAK_BADGE, 'card-flame', 'Streak'),
          Box({
            flexDirection: 'column',
            marginLeft: 1,
            width: textColumns,
            flexShrink: 0,
            children: [
              Text({ color: ink, bold: true, children: lines[0] }),
              Text({ dimColor: true, children: lines[1] }),
              Text({ dimColor: true, children: lines[2] }),
            ],
          }),
          Box({
            flexDirection: 'row',
            marginLeft: 3,
            columnGap: 1,
            children: shown.map(b => icon(b, `card-badge-${b.id}`)),
          }),
          Box({
            flexDirection: 'column',
            marginLeft: 1,
            flexShrink: 0,
            children: [
              Text({ color: ink, bold: true, children: `${m.earned.length}/${BADGES.length}` }),
              Text({ dimColor: true, children: 'badges' }),
            ],
          }),
        ],
      }),
      Text({ color: ink, wrap: 'truncate-end', children: m.heard }),
    ],
  })
}
plugins/pixlings/hooks/register.tsx lines 2433–2491 · Pane
  on('ui.render', { component: 'Pane', requestId: 'pixling-room' }, async ($, e) => {
    // Each read subscribes the room to a redraw: a new line, a level, a nap, the shelf on show.
    await read($, view)
    const said = await read($, bubbleAtom)
    const napping = await read($, napAtom)
    const pieces = wantsVitals ? await read($, vitalsAtom) : []
    await read($, hatchAtom)
    const room = await read($, roomAtom)
    const persona = personaLine(await read($, roomPersona))
    const isAway = (await read($, roomAway)) === true
    const squad = (await read($, roomSquad)) ?? []
    const isPlanning = (await read($, roomPlanning)) === true
    const effect = (await read($, roomEffect)) ?? null
    const at = now()
    const tab = tabOf(room.tab)
    const frame = roomFrame(at)
    const isEgg = !pixling || isHatching(at)
    const columns = e.props.bodyColumns > 0 ? e.props.bodyColumns : (e.viewport?.columns ?? 40)
    const seat = seatOf(columns, e.surface === 'terminal', frame.w)
    // The pixling moves on the home shelf: the frame clock repaints a terminal's Raster in place
    // (paintRoom) and redraws what drew an SVG lately (tick).
    const isMoving = !isAway && (tab === 'home' || isEgg)
    if (e.surface === 'terminal') {
      const raster = rasterOf(frame)
      const key = isEgg ? ROOM_EGG_KEY : ROOM_SPRITE_KEY
      roomSprite = isMoving ? { key, columns: raster.columns, rows: raster.rows, cells: raster.cells } : null
    } else if (isMoving) svgSeenAt = at
    const model: RoomModel = {
      at,
      pixling,
      frame,
      isHatching: pixling !== null && isHatching(at),
      tab,
      bubble: sayingNow(napping, said, at),
      persona,
      vitals: pieces.map(piece => ({ text: piece.text, color: TONE_COLOR[piece.tone], isDim: piece.tone === 'dim' })),
      squad,
      isPlanning,
      effect,
      isAway,
      isFocused: e.props.isFocused,
    }
    const act: RoomActions = {
      show: tab => {
        void update($, roomAtom, () => ({ tab }))
      },
      pet: () => {
        void pet()
          .then(() => $.ui.invalidate('ui.render'))
          .catch(() => undefined)
      },
    }
    if (e.surface === 'terminal') {
      const { Box, Text, Button, Raster } = $.ui.resolve(e)
      return drawRoom({ Box, Text, Button, Raster }, seat, model, act)
    }
    const { Box, Text, Button, Svg } = $.ui.resolve(e)
    return drawRoom({ Box, Text, Button, Svg }, seat, model, act)
  })
plugins/pixlings/hooks/lib/room.ts lines 353–369 · Pane
export const drawRoom = (kit: RoomKit, seat: Seat, m: RoomModel, act: RoomActions): RenderElement => {
  const p = m.pixling
  if (m.isAway) return away(kit, p)
  if (!p || m.isHatching) return egg(kit, seat, m, p)
  const body = m.tab === 'garden' ? garden(kit, seat, p) : m.tab === 'badges' ? shelf(kit, seat, p) : home(kit, seat, m, p, act)
  return kit.Box({
    flexDirection: 'column',
    width: seat.columns,
    children: [
      tabRow(kit, seat, m.tab, act),
      body,
      m.isFocused && seat.isTerminal
        ? kit.Text({ dimColor: true, children: `h home · g garden · b badges${m.tab === 'home' ? ' · p pet' : ''}` })
        : null,
    ],
  })
}
plugins/pixlings/hooks/lib/room.ts lines 371–379 · Pane
const away = (kit: RoomKit, p: Pixling | null): RenderElement =>
  kit.Box({
    key: 'room-away',
    flexDirection: 'column',
    children: [
      kit.Text({ children: `💤 ${p ? p.name : 'Your pixling'} is away.` }),
      kit.Text({ dimColor: true, wrap: 'wrap', children: 'Type /pixling on to bring it back.' }),
    ],
  })
plugins/pixlings/hooks/lib/room.ts lines 381–402 · Pane
const egg = (kit: RoomKit, seat: Seat, m: RoomModel, p: Pixling | null): RenderElement => {
  const isHatching = p !== null
  const note = kit.Box({
    flexDirection: 'column',
    flexShrink: 1,
    children: [
      kit.Text({ bold: true, children: isHatching ? 'Hatching…' : 'An egg, not hatched yet.' }),
      kit.Text({
        dimColor: true,
        wrap: 'wrap',
        children: isHatching ? 'Any second now.' : 'It hatches when a session starts where you can see it.',
      }),
    ],
  })
  return kit.Box({
    key: 'room-egg',
    flexDirection: seat.isSideBySide ? 'row' : 'column',
    alignItems: seat.isSideBySide ? 'center' : 'flex-start',
    columnGap: 2,
    children: [picture(kit, m.frame, seat.scale, ROOM_EGG_KEY, isHatching ? 'An egg, hatching' : 'An egg'), note],
  })
}
Licence text (MIT)
MIT License

Copyright (c) 2026 cglremrcn

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 varsdrives 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 f650facd675b 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.plugins/pixlings/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.21 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.plugins/pixlings/hooks/register.tsx:1274 a program named at run time; plugins/pixlings/hooks/register.tsx:1299 a program named at run time; plugins/pixlings/hooks/register.tsx:2025 a program named at run time; plugins/pixlings/hooks/register.tsx:2035 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 cglremrcn/pixlings
/plugin install pixlings@pixlings

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

Search them from Claude: the MCP connector

Similar designs