modscode / Gallery / runner-avatar
runner-avatar
A small Claude avatar that runs back and forth above the prompt
What it does
- Draws a band above the prompt
- Adds /avatar
- Watches tool calls and can refuse them
- Hooks prompt.submit, session.start, turn.complete, turn.start and 1 more
- Keeps its own state between turns
Good points
- No network calls
- Starts no processes
- 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)
import type { Register } from 'claude-code'
// Drawn like runner-avatar by MarkMerk (band), as modscode read it from the mod's code:
// https://modscode.com/gallery/markmerk-runner-avatar/
// 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 } = $.ui.resolve(e)
const text = '…'
const row = '…'
const row2 = '…'
const row3 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Svg alt="Claude avatar" />
<Box flexDirection="column" alignItems="flex-start">
<Box>
<Text>
{text}
</Text>
</Box>
<Box flexDirection="column">
<Text>
{row}
</Text>
<Text>
{row2}
</Text>
<Text>
{row3}
</Text>
</Box>
</Box>
</Box>
<Box>
<Text dimColor>
▔▔▔▔▔
</Text>
</Box>
{await next(e)}
</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/runner-avatar/hooks/register.js lines 493–651 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
// Leave the band to a survey, and to a terminal too small for the avatar
if (isHidden || e.props.hasSurvey || e.props.maxRows < 3 || e.props.bodyColumns < WIDTH) return next(e)
columns = e.props.bodyColumns
isWorking = e.props.isWorking
const { Box, Text, Client, Svg } = $.ui.resolve(e)
// The desktop app gets drawings, the terminal block characters
const isDrawn = e.surface === 'desktop'
const spriteColor = contextPercent !== null && contextPercent >= HOT_PERCENT ? HOT_COLOR : COLOR
// A game of tennis: a court as wide as the band allows, a net in the middle, a player at each
// baseline. Drawn as a grid of cells, each row then cut into runs of one style.
const scene = sceneWidth()
if (mood === 'tennis' && scene > 0) {
const grid = [0, 1, 2].map(() => Array.from({ length: scene }, () => null))
const put = (row, col, text, style) => {
for (const [i, char] of [...text].entries()) {
if (char !== ' ' && col + i >= 0 && col + i < scene) grid[row][col + i] = { char, ...style }
}
}
const net = Math.floor(scene / 2)
const player = { color: spriteColor }
const rival = { color: RIVAL_COLOR }
const line = { dimColor: true }
const rivalLeft = scene - WIDTH - rivalAt
// The court's surface, the net, and the score over it
put(2, 0, '▁'.repeat(scene), { color: 'green', dimColor: true })
put(1, net, '╻', line)
put(2, net, '┃', line)
const board = banner !== '' ? banner : POINTS[score[0]] + ' : ' + POINTS[score[1]]
for (const [i, char] of [...board].entries()) grid[0][net - Math.floor(board.length / 2) + i] = { char, ...line }
// The players, each with a racket held toward the net
put(0, playerAt + OFFSETS[0], BODY[0], player)
put(1, playerAt + OFFSETS[1], BODY[1], player)
put(2, playerAt + OFFSETS[2], LEGS[playerLegs], player)
put(1, playerAt + WIDTH, '─o', line)
put(0, rivalLeft + OFFSETS[0], BODY[0], rival)
put(1, rivalLeft + OFFSETS[1], BODY[1], rival)
put(2, rivalLeft + OFFSETS[2], LEGS[rivalLegs], rival)
put(1, rivalLeft - 2, 'o─', line)
put(ballRow(), ball, '●', { color: 'yellow' })
// Cut a row into runs of cells that share a style: one Text each, and a Box for a gap
const runs = (cells) => {
const children = []
let from = 0
while (from < cells.length) {
const first = cells[from]
let to = from + 1
while (
to < cells.length &&
(cells[to] === null) === (first === null) &&
cells[to]?.color === first?.color &&
cells[to]?.dimColor === first?.dimColor
) {
to += 1
}
children.push(
first === null
? Box({ width: to - from, flexShrink: 0, children: [] })
: Text({
color: first.color,
dimColor: first.dimColor === true,
children: [cells.slice(from, to).map((cell) => cell.char).join('')],
}),
)
from = to
}
return Box({ flexDirection: 'row', children })
}
if (isDrawn) {
return Box({
key: 'tennis',
marginLeft: Math.floor((columns - scene) / 2),
children: [Svg({ ...drawingOf(grid, scene), alt: 'A game of tennis, ' + board })],
})
}
return Box({
key: 'tennis',
flexDirection: 'column',
marginLeft: Math.floor((columns - scene) / 2),
children: grid.map(runs),
})
}
const left = Math.max(0, Math.min(x, columns - WIDTH))
const rows = [...BODY, LEGS[frame]]
// The avatar is drawn by sprite.js in a region of its own, which reports clicks;
// on the desktop it is a drawing, which doesn't
const sprite = isDrawn
? Svg({
...drawingOf(
rows.map((row, i) => cellsOf(row, OFFSETS[i], { color: spriteColor, dimColor: mood === 'asleep' })),
WIDTH,
),
alt: 'Claude avatar',
})
: Client({
key: 'avatar',
module: './sprite.js',
width: WIDTH,
height: 3,
props: {
rows,
offsets: OFFSETS,
color: spriteColor,
isDim: mood === 'asleep',
},
})
// In the air the avatar is a row higher, over its shadow
const lift = (tree) =>
jump > 0 && e.props.maxRows >= 4
? Box({
flexDirection: 'column',
children: [
tree,
Box({ key: 'shadow', marginLeft: left + 2, children: [Text({ dimColor: true, children: ['▔▔▔▔▔'] })] }),
],
})
: tree
const { text, color, dim } = bubble()
// The subagents' small avatars run beside the big one, at ground level
const count = Math.min(agents.size, MINI_MAX)
const minis = [MINI_HEAD, MINI_LEGS[frame]].map((row) => Array.from({ length: count }, () => row).join(' '))
const sideWidth = Math.max(text.length, minis[0].length)
if (sideWidth === 0) return lift(Box({ marginLeft: left, children: [sprite] }))
// The bubble goes to the right of the avatar, or to its left near the right edge
const roomRight = columns - (left + WIDTH + 1)
const isOnRight = sideWidth <= roomRight || left < sideWidth + 1
const cut = (line) => (isOnRight ? line.slice(0, Math.max(0, roomRight)) : line)
const blank = Text({ children: [' '] })
const side = Box({
flexDirection: 'column',
alignItems: isOnRight ? 'flex-start' : 'flex-end',
children: [
text === ''
? blank
: Box({ key: 'bubble', children: [Text({ color, dimColor: dim === true, children: [cut(text)] })] }),
count === 0
? Box({ flexDirection: 'column', children: [blank, blank] })
: Box({
key: 'minis',
flexDirection: 'column',
children: minis.map((row) => Text({ color: spriteColor, children: [cut(row)] })),
}),
],
})
return lift(
Box({
flexDirection: 'row',
columnGap: 1,
marginLeft: isOnRight ? left : left - sideWidth - 1,
children: isOnRight ? [sprite, side] : [side, sprite],
}),
)
})Licence text (MIT)
MIT License Copyright (c) 2026 MarkMerk 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
tool callsremembers
What its code shows
Read from the source at commit 7d4eb293cd7b 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 read | Every module hooks/hooks.json names was read.plugins/runner-avatar/hooks/register.js |
| Parses | Every file parses as TypeScript or JavaScript.2 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No 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 open | Network 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 draws | The 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, with its own branch for the desktop |
| Install line | Whether 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 Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.no network |
| Programs | Whether 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 sends | Whether it both reads files or environment variables and reaches the network.reaches no network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An 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 MarkMerk/markmerk-mods/plugin install runner-avatar@markmerk-modsThis installs the marketplace's latest commit, which may not be the one read here (7d4eb293cd7b). 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 "markmerk-runner-avatar" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
5h▰▰▰▰▰▰▰▰▱▱▱▱▱▱▱▱3%Winding downWinding downWinding down7d▰▰▰▰▰▰▰▰▱▱▱▱▱▱▱▱3%Winding downWinding downWinding downctx3 / 3Winding downWinding downWinding downWinding downWinding downWinding down./click-probe.tsx●RetryingRefreshing…Long run ✓Winding downWinding downWinding downAsk Claude…
-
Ask Claude…Timer● MonAprNo timer runningStopResume last CollapseFri week./meter.tsxUnbilled Wed h$1.24 · expenses MarMayToday, Oct 6This week
-
Ask Claude…Notes⚠ A team of Never uses your Claude usage much faster.Showing:buildbuildbuildHide completed:buildbuildbuildSet team size:DefaultDefaultDefaultSet model:NotesNotesNotesWorkflowYour next prompt can hand work to Never Notes helpers.● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m
-
Ask Claude…Historyf ◂ expand⚙ settingsFix loginbuildRemindAuto Remind ConcisebuildRemindAuto Remind ConcisebuildRemindAuto Remind Concise$1.24 this session · auto-compact at 3wrap-up 5h Remind · 7d Remind · /compact Learningwrap-up in 2h 10m CancelFix loginauto 2h 10m ■ Stop stotal 2h 10m · think 2h 10m0 · write 2h 10m0 · tools 2h 10m03 out · 12.4 tok/s◌ build 2h 10m◌ build 2h 10m◌ build 2h 10mFix login● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stopped● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stopped● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stoppedFix loginbuild 3 · Remind%build 3 · Remind%build 3 · Remind%
-
Ask Claude…Helm⋯buildhead.readingbuildbuild────────✗ English
-
What it does
- Draws a band above the prompt
- Adds /trivia
- Hooks session.start, ui.message
- Keeps its own state between turns