modscode JA

modscode / Gallery / familiar

familiar

A pixel-art companion above the prompt that reacts to your session, levels up, and can be redrawn by hand

Code you can checkTerminal + desktopPaneBandToastBoxButtonClientText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /familiar
  • Watches tool calls and can refuse them
  • Hooks session.measure, session.start, turn.complete, turn.start and 1 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Has a desktop-specific branch

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 familiar by Nafees S (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/lucenity0-familiar/
// 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 glyph = '…'
    const glyph2 = '…'
    const glyph3 = '…'
    const glyph4 = '…'
    const glyph5 = '…'
    const glyph6 = '…'
    const glyph7 = '…'
    const glyph8 = '…'
    const glyph9 = '…'
    const footer = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" columnGap={2} paddingLeft={1} marginTop={1}>
          <Box flexDirection="column">
            <Text>
              <Text>
                {glyph}
              </Text>
              <Text>
                {glyph2}
              </Text>
              <Text>
                {glyph3}
              </Text>
            </Text>
            <Text>
              <Text>
                {glyph4}
              </Text>
              <Text>
                {glyph5}
              </Text>
              <Text>
                {glyph6}
              </Text>
            </Text>
            <Text>
              <Text>
                {glyph7}
              </Text>
              <Text>
                {glyph8}
              </Text>
              <Text>
                {glyph9}
              </Text>
            </Text>
          </Box>
          <Box flexDirection="column" justifyContent="center">
            <Text>
              {" "}
            </Text>
            <Text dimColor>
              {footer}
            </Text>
          </Box>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Pick a look for ‹name›" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const glyph = '…'
    const glyph2 = '…'
    const glyph3 = '…'
    const glyph4 = '…'
    const glyph5 = '…'
    const glyph6 = '…'
    const glyph7 = '…'
    const glyph8 = '…'
    const glyph9 = '…'
    const i = '…'
    const glyph10 = '…'
    const glyph11 = '…'
    const glyph12 = '…'
    const glyph13 = '…'
    const glyph14 = '…'
    const glyph15 = '…'
    const glyph16 = '…'
    const glyph17 = '…'
    const glyph18 = '…'
    const glyph19 = '…'
    const glyph20 = '…'
    const glyph21 = '…'
    const glyph22 = '…'
    const glyph23 = '…'
    const glyph24 = '…'
    const glyph25 = '…'
    const glyph26 = '…'
    const glyph27 = '…'
    return (
      <Box flexDirection="column" rowGap={1}>
        <Box flexDirection="row" flexWrap="wrap" columnGap={3} rowGap={1}>
          <Box flexDirection="column" alignItems="center" rowGap={1}>
            <Box flexDirection="column">
              <Text>
                <Text>
                  {glyph}
                </Text>
                <Text>
                  {glyph2}
                </Text>
                <Text>
                  {glyph3}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph4}
                </Text>
                <Text>
                  {glyph5}
                </Text>
                <Text>
                  {glyph6}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph7}
                </Text>
                <Text>
                  {glyph8}
                </Text>
                <Text>
                  {glyph9}
                </Text>
              </Text>
            </Box>
            <Button label="clawd" hotkey={`${i}`} />
          </Box>
          <Box flexDirection="column" alignItems="center" rowGap={1}>
            <Box flexDirection="column">
              <Text>
                <Text>
                  {glyph10}
                </Text>
                <Text>
                  {glyph11}
                </Text>
                <Text>
                  {glyph12}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph13}
                </Text>
                <Text>
                  {glyph14}
                </Text>
                <Text>
                  {glyph15}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph16}
                </Text>
                <Text>
                  {glyph17}
                </Text>
                <Text>
                  {glyph18}
                </Text>
              </Text>
            </Box>
            <Button label="clawd" hotkey={`${i}`} />
          </Box>
          <Box flexDirection="column" alignItems="center" rowGap={1}>
            <Box flexDirection="column">
              <Text>
                <Text>
                  {glyph19}
                </Text>
                <Text>
                  {glyph20}
                </Text>
                <Text>
                  {glyph21}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph22}
                </Text>
                <Text>
                  {glyph23}
                </Text>
                <Text>
                  {glyph24}
                </Text>
              </Text>
              <Text>
                <Text>
                  {glyph25}
                </Text>
                <Text>
                  {glyph26}
                </Text>
                <Text>
                  {glyph27}
                </Text>
              </Text>
            </Box>
            <Button label="clawd" hotkey={`${i}`} />
          </Box>
        </Box>
        <Text dimColor>
          {"draw your own with /familiar draw. "}
          esc closes
        </Text>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const sprite = '…'
    await $.ui.toast(`Could not save: ${sprite}`)
    await $.ui.toast(`Saved. /familiar export prints it to share.`)
    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 348–391 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const p = await read($, profile)
    if (p === null || e.props.hasSurvey || (await read($, isHidden))) return next(e)

    const { view } = await read($, mind)
    const level = levelFor(p.xp)
    const footer = `${p.name} · ${view.mood} · lvl ${level}`
    const { Box, Text } = $.ui.resolve(e)

    const sprite = spriteOf(p)
    const { top, bottom } = bandRows(sprite)
    const age = Math.max(0, Math.floor(((await $.clock.now()) - view.since) / FRAME_MS))
    const pixels = frame(sprite, view.mood, await read($, tick), level, age)
    // Full size while you read or type; half size while Claude's output streams or the window is short.
    const isRoomy = !e.props.isWorking && (e.viewport?.rows ?? TALL_ROWS) >= TALL_ROWS
    const wanted: SpriteSize = size === 'auto' ? (isRoomy ? 'full' : 'compact') : size
    const fits = (cells: Cell[][]) => e.props.bodyColumns >= (cells[0]?.length ?? 0) + 24 && e.props.maxRows >= cells.length + 1
    const full = wanted === 'full' ? fullCells(pixels, top, bottom) : null
    const cells = full !== null && fits(full) ? full : compactCells(pixels, top, bottom)
    if (!fits(cells)) {
      return (
        <Box marginTop={1} paddingLeft={1}>
          <Text>
            {FACES[view.mood]} <Text dimColor>{p.name}</Text>
            {view.line === '' ? '' : `  ${view.line}`}
          </Text>
        </Box>
      )
    }

    const words = (
      <Box flexDirection="column" justifyContent="center">
        <Text>{view.line === '' ? ' ' : view.line}</Text>
        <Text dimColor>{footer}</Text>
      </Box>
    )

    return (
      <Box flexDirection="row" columnGap={2} paddingLeft={1} marginTop={1}>
        {picture($, e, 'sprite', cells)}
        {words}
      </Box>
    )
  })
hooks/register.tsx lines 90–113 · Band
function picture($: EngineInterface, e: ResolveInput, key: string, cells: Cell[][]) {
  if (e.surface === 'terminal') {
    const { Raster } = $.ui.resolve(e)
    return <Raster key={key} columns={cells[0]?.length ?? 0} rows={cells.length} cells={rasterCells(cells)} />
  }
  const { Box, Text } = $.ui.resolve(e)
  return (
    <Box key={key} flexDirection="column">
      {cells.map(row => (
        <Text>
          {row.map(cell =>
            cell.bg === null ? (
              <Text {...(cell.fg === null ? {} : { color: cell.fg })}>{cell.glyph}</Text>
            ) : (
              <Text color={cell.fg ?? '#000000'} backgroundColor={cell.bg}>
                {cell.glyph}
              </Text>
            ),
          )}
        </Text>
      ))}
    </Box>
  )
}
hooks/register.tsx lines 393–434 · Pane
  on('ui.render', { component: 'Pane', requestId: PICK_PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const p = await read($, profile)
    if (p === null) return <Text dimColor>No familiar yet.</Text>

    const looks: { species: Species; sprite: Sprite }[] = [
      ...BUILT_IN.map(species => ({ species, sprite: SPECIES[species] })),
      ...(p.custom === null ? [] : [{ species: 'custom' as const, sprite: p.custom }]),
    ]
    // Full size has no seams in any terminal; the lineup drops to half size only when it would not fit.
    const perRow = Math.max(1, Math.floor((e.props.bodyColumns + 3) / (WIDTH * 2 + 3)))
    const tallest = Math.max(...looks.map(look => usedRows(look.sprite).bottom - usedRows(look.sprite).top + 1))
    const needed = Math.ceil(looks.length / perRow) * (tallest + 3) + 1
    const size: SpriteSize = needed <= e.props.scroll.bodyRows ? 'full' : 'compact'
    const choose = async (species: Species) => {
      await saveProfile($, current => ({ ...current, species }))
      await $.ui.close({ id: PICK_PANE })
      await say($, 'happy', 'how do i look?')
    }

    return (
      <Box flexDirection="column" rowGap={1}>
        <Box flexDirection="row" flexWrap="wrap" columnGap={3} rowGap={1}>
          {looks.map(({ species, sprite }, i) => (
            <Box key={species} flexDirection="column" alignItems="center" rowGap={1}>
              {picture($, e, `look-${species}`, preview(sprite, size))}
              <Button
                key={`pick-${species}`}
                label={species}
                hotkey={String(i + 1)}
                {...(species === p.species ? { variant: 'primary' as const } : { dimColor: true })}
                onPress={() => choose(species)}
              />
            </Box>
          ))}
        </Box>
        <Text dimColor>
          {p.custom === null ? 'draw your own with /familiar draw. ' : ''}esc closes
        </Text>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Nafees S

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

drives 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 77930064d562 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.4 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.starts no programs
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 lucenity0/claude-familiar
/plugin install familiar@claude-familiar

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

Search them from Claude: the MCP connector

Similar designs