modscode JA

modscode / Gallery / clawd-bar

clawd-bar

Clawd, Claude Code's crab, lives in a band above your prompt: he acts out the session, shows what's running, your context and usage limits, and races your CI builds. Unofficial fan mod.

Code you can checkTerminal + desktopBandToastBoxSvgText

What it does

  • Draws a band above the prompt, toasts
  • Adds /clawd, /ci
  • Watches Bash, PowerShell, TodoWrite, TaskCreate calls and can refuse them
  • Hooks classic.Elicitation, classic.Notification, classic.PostCompact, classic.PostToolUse and 12 more
  • Keeps its own state between turns

Good points

  • 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 clawd-bar by KaiC5504 (band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/kaic5504-clawd-bar/
// 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 source = '…'
    const label = '…'
    const name = '…'
    const percent = '…'
    const name2 = '…'
    const percent2 = '…'
    const name3 = '…'
    const percent3 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" alignItems="center">
          <Svg source={`${source}`} alt={`${label}`} height={48} isInteractive />
          <Box flexDirection="row" marginLeft={2} flexShrink={0}>
            <Box flexDirection="column" marginRight={2} flexShrink={0}>
              <Text dimColor>
                {name}
              </Text>
              <Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                {" "}
                <Text bold>
                  {percent}
                  %
                </Text>
              </Text>
              <Text dimColor>
                {" "}
              </Text>
            </Box>
            <Box flexDirection="column" marginRight={2} flexShrink={0}>
              <Text dimColor>
                {name2}
              </Text>
              <Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                {" "}
                <Text bold>
                  {percent2}
                  %
                </Text>
              </Text>
              <Text dimColor>
                {" "}
              </Text>
            </Box>
            <Box flexDirection="column" marginRight={2} flexShrink={0}>
              <Text dimColor>
                {name3}
              </Text>
              <Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                <Text>
                  ▊▊▊▊▊▊▊▊
                </Text>
                {" "}
                <Text bold>
                  {percent3}
                  %
                </Text>
              </Text>
              <Text dimColor>
                {" "}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            │
│
│
          </Text>
          <Box flexDirection="column" marginLeft={1} flexGrow={1} flexShrink={1} minWidth={0} />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Clawd on Desk put its per-event hooks back. In Clawd on Desk, open Settings → Agents, turn off "Manage Claude hooks aut…`)
    await $.ui.toast(`clawd-bar can't watch Codemagic without a token: set CODEMAGIC_API_TOKEN or write it to ~/.codemagic-token.`)
    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 771–771 · Band
  on('ui.render', { component: 'AbovePrompt' }, ($, e, next) => drawBand($, e as never, next as never) as never)
hooks/register.tsx lines 650–758 · Band
async function drawBand($: EngineInterface, e: BandEvent, next: (e: BandEvent) => unknown) {
  if (e.props.hasSurvey || !settings.isPetOn || (await read($, isHidden))) {
    stopAnimation()
    return next(e)
  }
  isEngineWorking = e.props.isWorking
  const now = await $.clock.now()
  const isTerminal = e.surface === 'terminal'
  if (isTerminal) await read($, second)
  else await read($, demoStep)
  if (isTerminal) await read($, barFrame)
  const scene = demoStartedAt === null ? null : demoScene(now - demoStartedAt, now)
  const view = scene ? (scene.ci ?? null) : settings.isCiOn ? ((await read($, ciView)) ?? (await loadView(hostFrom($)))) : null
  const ci = scene || settings.isCiOn ? ciShown(view, now) : null
  const shownVisual = await read($, visual)
  const shownPet = await read($, pet)
  const session: SessionShown = scene?.session ?? {
    ...shownVisual,
    activity: await read($, activity),
    subagents: shownPet.subagents.length,
    place: await read($, place),
  }
  const act = ci?.act ?? session.act
  if (act === 'working' && lastAct !== 'working') cabinetSpell++
  lastAct = act
  const work: Work | null = (scene ? scene.work : shownPet.work) ?? null
  const extras: Extras = ci
    ? {}
    : {
        sweat: (scene ? scene.sweat : shownVisual.isSweating) === true,
        planes: session.subagents,
        ...(work ? { work } : {}),
        ...(act === 'working' ? { game: Math.max(0, cabinetSpell) % CABINET_GAMES } : {}),
      }
  const playKey = CALL_ACTS.has(act) && work ? `${act}:${work.id}` : act
  const usage = scene ? null : await $.session.usage().then(u => u, () => null)
  const meterList: Meter[] = scene ? scene.meters : usage ? meters(usage, now) : []
  hasClock = scene !== null || ci !== null || session.activity.turnStartedAt !== null
  // A live race's lanes move every second; on the desktop that's the one redraw a second worth its rebuild.
  if (!isTerminal && ci?.run) await read($, second)

  const columns = e.props.bodyColumns
  const clawdCols = isTerminal ? CLAWD_COLS : DESKTOP_CLAWD_COLS
  const boxCols = isTerminal ? 1 : DESKTOP_BOX_COLS
  const fit = fitBand(columns, clawdCols, meterList, 10, boxCols, !isTerminal)
  const textWidth = Math.max(10, columns - clawdCols - GAP - (fit.gauges ? fit.width + 2 : 0))
  const els = $.ui.resolve(e) as never as { Box: any; Text: any; Client?: any }
  const { Box, Client } = els
  const turnStartedAt = session.activity.turnStartedAt
  const turnClock =
    !isTerminal && Client && turnStartedAt !== null ? (
      <Client key="turn-clock" module="./ticker.tsx" props={{ elapsedMs: now - turnStartedAt }} />
    ) : undefined
  const lines = ci ? ciLines(els, ci, view, now, textWidth) : sessionLines(els, session, now, turnClock)
  // The terminal's bars move when their values change; the desktop's stand still, since a redraw there costs Clawd his frame.
  if (isTerminal) {
    bars.see(meterList, now)
    barsShown = { meters: meterList, boxes: fit.boxes, look: barLook(meterList, fit.boxes, now) }
    if (!barTimer && bars.isMoving(meterList, fit.boxes, now)) barTimer = $.clock.every(BAR_MS, () => void barTick($))
  }
  const paint = isTerminal ? (m: Meter, boxes: number) => bars.paint(m, boxes, now) : undefined
  const right = [
    <Box key="gauges" flexDirection="row" marginLeft={GAP} flexShrink={0}>
      {gaugeColumns(els, meterList, fit, paint)}
    </Box>,
    fit.gauges ? divider(els) : null,
    <Box key="lines" flexDirection="column" marginLeft={1} flexGrow={1} flexShrink={1} minWidth={0}>
      {lines}
    </Box>,
  ]

  if (e.surface === 'terminal') {
    const { Raster } = $.ui.resolve(e as never) as never as { Raster: any }
    // A new label over the same act keeps its place in the loop; a new call starts its scene over.
    if (!animation || animation.key !== playKey || animation.requestId !== e.requestId) {
      stopAnimation()
      animation = { key: playKey, act, startedAt: now, requestId: e.requestId, extras, painted: '' }
      frameTimer = $.clock.every(FRAME_MS, () => void paintFrame($))
    }
    animation.extras = work ? { ...extras, lead: animation.startedAt - work.startedAt } : extras
    animation.painted = cellsAt(animation, now)
    return (
      <Box flexDirection="row">
        <Raster key={RASTER_KEY} columns={CLAWD_COLS} rows={CLAWD_ROWS} cells={animation.painted} />
        {right}
      </Box>
    )
  }

  const { Svg } = $.ui.resolve(e as never) as never as { Svg: any }
  const drawn = CALL_ACTS.has(act) && work ? JSON.stringify({ ...work, id: undefined, startedAt: undefined }) : `${extras.game ?? ''}`
  const svgKey = `${act}:${extras.sweat ? 1 : 0}:${extras.planes ?? 0}:${drawn}`
  const svg = svgs.get(svgKey) ?? svgFor(act, extras)
  // Most recently used last, so the oldest goes first.
  svgs.delete(svgKey)
  svgs.set(svgKey, svg)
  if (svgs.size > SVG_CACHE) svgs.delete(svgs.keys().next().value!)
  if (desktopPlay?.key !== `${svgKey}:${playKey}`) desktopPlay = { key: `${svgKey}:${playKey}`, startedAt: now }
  // Start the rebuilt frame where the loop already is, so a redraw doesn't send him back to the start.
  const loop = svgLoopMs(act, extras)
  const into = isOnce(act) ? Math.min(now - desktopPlay.startedAt, loop) : (now - desktopPlay.startedAt) % loop
  const source = svg.replace('<style>', `<style>*{animation-delay:-${into}ms!important}`)
  return (
    <Box flexDirection="row" alignItems="center">
      <Svg source={source} alt={session.label} width={SVG_HEIGHT * SVG_ASPECT} height={SVG_HEIGHT} isInteractive />
      {right}
    </Box>
  )
}
hooks/band.tsx lines 248–276 · Band
export function gaugeColumns(els: Els, meters: Meter[], fit: Fit, paint: (m: Meter, boxes: number) => BarPaint = stillBar) {
  const { Box, Text } = els
  if (!fit.gauges) return []
  const paints = meters.map(m => paint(m, fit.boxes))
  if (fit.isStacked) {
    const column = (key: string, cell: (m: Meter, i: number) => unknown, marginRight = 1) => (
      <Box key={key} flexDirection="column" marginRight={marginRight} flexShrink={0}>
        {meters.map(cell)}
      </Box>
    )
    return [
      column('names', (m, i) => <Text key={i} dimColor>{m.name}</Text>),
      fit.boxes > 0 ? column('bars', (_, i) => <Text key={i}>{bar(els, paints[i]!)}</Text>) : null,
      column('percents', (m, i) => <Box key={i} justifyContent="flex-end">{percent(els, m, paints[i]!.isFlashing)}</Box>, meters.some(m => m.resetIn) ? 2 : GAP),
      meters.some(m => m.resetIn) ? column('resets', (m, i) => <Text key={i} dimColor>{reset(m) || ' '}</Text>, GAP) : null,
    ]
  }
  return meters.map((m, i) => (
    <Box key={`g${i}`} flexDirection="column" marginRight={GAP} flexShrink={0}>
      <Text dimColor>{m.name}</Text>
      <Text>
        {fit.boxes > 0 ? bar(els, paints[i]!) : ''}
        {fit.boxes > 0 ? ' ' : ''}
        {percent(els, m, paints[i]!.isFlashing)}
      </Text>
      <Text dimColor>{reset(m) || ' '}</Text>
    </Box>
  ))
}
hooks/band.tsx lines 226–238 · Band
function bar({ Text }: Els, paint: BarPaint) {
  const runs: { box: Paint; n: number }[] = []
  for (const box of paint.boxes) {
    const last = runs.at(-1)
    if (last && last.box.color === box.color && last.box.isDim === box.isDim) last.n++
    else runs.push({ box, n: 1 })
  }
  return runs.map(({ box, n }, i) => (
    <Text key={i} color={box.color} dimColor={box.isDim}>
      {BOX.repeat(n)}
    </Text>
  ))
}
hooks/band.tsx lines 240–244 · Band
const percent = ({ Text }: Els, m: Meter, isFlashing = false) => (
  <Text bold inverse={isFlashing} color={m.percent >= 80 ? m.color : undefined}>
    {m.percent}%
  </Text>
)
hooks/band.tsx lines 278–282 · Band
export const divider = ({ Text }: Els) => (
  <Text key="divider" dimColor>
    {'│\n│\n│'}
  </Text>
)
Licence text (MIT)
MIT License

Copyright (c) 2026 KaiC5504

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 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 136c09b8e54a 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.25 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.hooks/register.tsx:268 fetch(url); hooks/register.tsx:395 fetch(`http://127.0.0.1:${s.port}/health`)
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.hooks/register.tsx:150 a program named at run time; hooks/register.tsx:209 a program named at run time; hooks/register.tsx:269 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files 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 KaiC5504/clawd-bar
/plugin install clawd-bar@clawd-bar

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

Search them from Claude: the MCP connector

Similar designs