modscode JA

modscode / Gallery / cockpit

cockpit

Progress bars from your todo list at zero extra tokens, a router where you pick the model and effort for quick, normal and hard prompts, and a prompt-cache meter that can keep the cache warm

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputSelectSvgText

What it does

  • Draws a pane, a band above the prompt, toasts
  • Adds /progress, /progress-demo, /progress-clear, /progress-sounds
  • Watches TodoWrite, TaskCreate, TaskUpdate, AskUserQuestion calls and can refuse them
  • Hooks classic.PostModelSwitch, classic.SessionStart, classic.Stop, plugin.register and 7 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • 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 cockpit by Syed Muhammad Hassaan (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/brxerq-cockpit/
// 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: "Model router" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const title = '…'
    const routeShort = '…'
    const shortModel = '…'
    const modelWord = '…'
    const TASK_INFO = '…'
    const label = '…'
    const words = '…'
    const words2 = '…'
    const routeShort2 = '…'
    const words3 = '…'
    const routeShort3 = '…'
    const hint = '…'
    return (
      <Box flexDirection="column" gap={1} paddingX={1}>
        <Box flexDirection="row" alignItems="flex-start" gap={1}>
          <Box flexDirection="column" flexGrow={1} flexShrink={1}>
            <Text wrap="wrap">
              {`Last reply: ${title} → ${routeShort}`}
            </Text>
            <Text dimColor wrap="wrap">
              {`Kept off ${shortModel} to save the cache. Start a prompt with @${modelWord} to force it.`}
            </Text>
          </Box>
          <Button label="On" variant="primary" />
          <Button label="Off" variant="primary" />
        </Box>
        <Box flexDirection="column" gap={1}>
          <Text>
            <Text bold>
              Routes
            </Text>
            <Text dimColor>
              {"  model and effort for each kind of prompt"}
            </Text>
          </Text>
          <Box flexDirection="column">
            <Text wrap="wrap">
              <Text bold>
                0
              </Text>
              <Text dimColor>
                {`  ${TASK_INFO}`}
              </Text>
            </Text>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Text wrap="wrap">
              <Text bold>
                0
              </Text>
              <Text dimColor>
                {`  ${TASK_INFO}`}
              </Text>
            </Text>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Text wrap="wrap">
              <Text bold>
                0
              </Text>
              <Text dimColor>
                {`  ${TASK_INFO}`}
              </Text>
            </Text>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" gap={1}>
          <Text>
            <Text bold>
              Your rules
            </Text>
            <Text dimColor>
              {"  checked first"}
            </Text>
          </Text>
          <Text dimColor wrap="wrap">
            No rules yet. Pick a model and effort, type the words, press Add rule.
          </Text>
          <Box flexDirection="row" alignItems="flex-start" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">
                {words}
              </Text>
            </Box>
            <Text bold>
              {routeShort}
            </Text>
            <Button plain dimColor label="✕" />
          </Box>
          <Box flexDirection="row" alignItems="flex-start" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">
                {words2}
              </Text>
            </Box>
            <Text bold>
              {routeShort2}
            </Text>
            <Button plain dimColor label="✕" />
          </Box>
          <Box flexDirection="row" alignItems="flex-start" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">
                {words3}
              </Text>
            </Box>
            <Text bold>
              {routeShort3}
            </Text>
            <Button plain dimColor label="✕" />
          </Box>
          <Box flexDirection="column" gap={1}>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
                <Button label={`${label}`} variant="primary" />
              </Box>
            </Box>
            <Input placeholder="words, for example landing page, redesign" submitLabel="Add rule" />
          </Box>
        </Box>
        <Box flexDirection="column" gap={1}>
          <Text>
            <Text bold>
              Options
            </Text>
            <Text dimColor>
              {`  ${hint}`}
            </Text>
          </Text>
          <Box flexDirection="row" flexWrap="wrap" alignItems="center" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">
                When still broken after xhigh, move to
              </Text>
            </Box>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Button label={`${label}`} variant="primary" />
              <Button label={`${label}`} variant="primary" />
              <Button label={`${label}`} variant="primary" />
            </Box>
          </Box>
          <Box flexDirection="row" flexWrap="wrap" alignItems="center" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">
                Cache saver: skip one-off model switches in long chats
              </Text>
            </Box>
            <Box flexDirection="row" flexWrap="wrap" gap={1}>
              <Button label={`${label}`} variant="primary" />
              <Button label={`${label}`} variant="primary" />
              <Button label={`${label}`} variant="primary" />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="row" alignItems="center" gap={1}>
          <Box flexGrow={1} flexShrink={1}>
            <Text dimColor wrap="wrap">
              One prompt only: start it with @opus, @max or @hard
            </Text>
          </Box>
          <Button label="Reset" dimColor />
        </Box>
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const STATE_GLYPH = '…'
    const title = '…'
    const bar = '…'
    const bar2 = '…'
    const stageName = '…'
    const step = '…'
    const stageSize = '…'
    const pct = '…'
    const STATE_GLYPH2 = '…'
    const title2 = '…'
    const bar3 = '…'
    const bar4 = '…'
    const STATE_GLYPH3 = '…'
    const title3 = '…'
    const bar5 = '…'
    const bar6 = '…'
    const STATE_GLYPH4 = '…'
    const meterTitle = '…'
    const timeLeft = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" alignItems="center" gap={1}>
          <Text>
            {STATE_GLYPH}
          </Text>
          <Text wrap="truncate">
            {title}
          </Text>
          <Box flexGrow={1} />
          <Text>
            <Text>
              {bar}
            </Text>
            <Text dimColor>
              {bar2}
            </Text>
            <Text>
              {` ${stageName} ${step}/${stageSize}`}
            </Text>
          </Text>
          <Text dimColor>
            {`${pct}%`}
          </Text>
          <Button plain dimColor label="✕" />
        </Box>
        <Box flexDirection="row" alignItems="center" gap={1}>
          <Text>
            {STATE_GLYPH2}
          </Text>
          <Text wrap="truncate">
            {title2}
          </Text>
          <Box flexGrow={1} />
          <Text>
            <Text>
              {bar3}
            </Text>
            <Text dimColor>
              {bar4}
            </Text>
            <Text>
              {` ${stageName} ${step}/${stageSize}`}
            </Text>
          </Text>
          <Text dimColor>
            {`${pct}%`}
          </Text>
          <Button plain dimColor label="✕" />
        </Box>
        <Box flexDirection="row" alignItems="center" gap={1}>
          <Text>
            {STATE_GLYPH3}
          </Text>
          <Text wrap="truncate">
            {title3}
          </Text>
          <Box flexGrow={1} />
          <Text>
            <Text>
              {bar5}
            </Text>
            <Text dimColor>
              {bar6}
            </Text>
            <Text>
              {` ${stageName} ${step}/${stageSize}`}
            </Text>
          </Text>
          <Text dimColor>
            {`${pct}%`}
          </Text>
          <Button plain dimColor label="✕" />
        </Box>
        <Box flexDirection="row" alignItems="center" gap={1}>
          <Text>
            {STATE_GLYPH4}
          </Text>
          <Text wrap="truncate">
            {meterTitle}
          </Text>
          <Button label="Keep warm" />
          <Box flexGrow={1} />
          <Text>
            <Text>
              ━━━━━━━━
            </Text>
            <Text dimColor>
              ────────
            </Text>
            <Text>
              {` ${timeLeft}`}
            </Text>
          </Text>
          <Text dimColor>
            {`${pct}%`}
          </Text>
          <Button plain dimColor label="✕" />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const path = '…'
    const leftLabel = '…'
    const k = '…'
    await $.ui.toast(`${path} is not valid JSON, so nothing was saved. Fix or delete it.`)
    await $.ui.toast(`Cache expires in ${leftLabel}. After that the next prompt re-reads ${k} tokens at full price. /cache warm keeps it.`)
    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.

plugins/cockpit/hooks/register.tsx lines 828–947 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const t = $.ui.resolve(e)
    const { Box, Button, Text } = t
    const Select = 'Select' in t ? t.Select : null
    const Input = 'Input' in t ? t.Input : null
    const r = await read($, router)
    const isOn = r.mode !== 'off'
    const last = r.current
    const draft = await read($, ruleDraft)
    const modelValue = (id: string | null) => modelWord(id) ?? 'keep'
    const modelOptions = MODEL_CHOICES.map(([label, id]) => ({ value: modelWord(id) ?? 'keep', label: id ? `${label} ${shortModel(id).split(' ')[1] ?? ''}`.trim() : 'Keep yours' }))
    const effortOptions = EFFORT_CHOICES.map(([label, id]) => ({ value: id ?? 'keep', label: id ? label : 'Keep yours' }))
    const section = (label: string, hint?: string) => (
      <Text>
        <Text bold>{label}</Text>
        {hint ? <Text dimColor>{`  ${hint}`}</Text> : null}
      </Text>
    )
    // one picker: a dropdown where the surface has one, else a row of buttons
    const picker = (key: string, options: { value: string; label: string }[], value: string, onPick: (v: string) => unknown) =>
      Select ? (
        <Select key={key} options={options} value={value} onSelect={v => void onPick(v)} />
      ) : (
        <Box key={key} flexDirection="row" flexWrap="wrap" gap={1}>
          {options.map(o => (
            <Button key={`${key}-${o.value}`} label={o.label} variant={o.value === value ? 'primary' : undefined} dimColor={o.value !== value} onPress={() => onPick(o.value)} />
          ))}
        </Box>
      )

    return (
      <Box flexDirection="column" gap={1} paddingX={1}>
        <Box flexDirection="row" alignItems="flex-start" gap={1}>
          <Box flexDirection="column" flexGrow={1} flexShrink={1}>
            <Text wrap="wrap">{last ? `Last reply: ${title(last.task)} → ${routeShort(last)}` : 'No reply routed yet.'}</Text>
            {last?.held.includes('model') ? <Text dimColor wrap="wrap">{`Kept off ${shortModel(last.wanted.model)} to save the cache. Start a prompt with @${modelWord(last.wanted.model) ?? 'opus'} to force it.`}</Text> : null}
          </Box>
          <Button key="router-on" label="On" variant={isOn ? 'primary' : undefined} dimColor={!isOn} onPress={() => update($, router, x => ({ ...x, mode: 'auto' }))} />
          <Button key="router-off" label="Off" variant={isOn ? undefined : 'primary'} dimColor={isOn} onPress={() => update($, router, x => ({ ...x, mode: 'off' }))} />
        </Box>

        <Box flexDirection="column" gap={1}>
          {section('Routes', 'model and effort for each kind of prompt')}
          {TASKS.map((k: string) => {
            const x = r.routes[k] ?? { model: null, effort: null }
            return (
              <Box key={`route-${k}`} flexDirection="column">
                <Text wrap="wrap">
                  <Text bold>{title(k)}</Text>
                  <Text dimColor>{`  ${(TASK_INFO as Record<string, string>)[k]}`}</Text>
                </Text>
                <Box flexDirection="row" flexWrap="wrap" gap={1}>
                  {picker(`${k}-model`, modelOptions, modelValue(x.model), v => setRoute($, k, { model: v === 'keep' ? null : ((MODELS as Record<string, string>)[v] ?? null) }))}
                  {x.model && !takesEffort(x.model) ? <Text dimColor>No effort setting</Text> : picker(`${k}-effort`, effortOptions, x.effort ?? 'keep', v => setRoute($, k, { effort: v === 'keep' ? null : v }))}
                </Box>
              </Box>
            )
          })}
        </Box>

        <Box flexDirection="column" gap={1}>
          {section('Your rules', 'checked first')}
          {r.rules.length === 0 ? <Text dimColor wrap="wrap">No rules yet. Pick a model and effort, type the words, press Add rule.</Text> : null}
          {r.rules.map(rule => (
            <Box key={`rule-${rule.words[0]}`} flexDirection="row" alignItems="flex-start" gap={1}>
              <Box flexGrow={1} flexShrink={1}>
                <Text wrap="wrap">{rule.words.join(', ')}</Text>
              </Box>
              <Text bold color={MODEL_COLOR[modelWord(rule.route.model) ?? 'keep']}>{routeShort(rule.route)}</Text>
              <Button key={`rule-x-${rule.words[0]}`} plain dimColor label="✕" onPress={() => removeRule($, rule.words[0] ?? '')} />
            </Box>
          ))}
          {Input ? (
            <Box flexDirection="column" gap={1}>
              <Box flexDirection="row" flexWrap="wrap" gap={1}>
                {picker('rule-model', modelOptions, draft.model, v => update($, ruleDraft, x => ({ ...x, model: v })))}
                {draft.model !== 'keep' && !takesEffort((MODELS as Record<string, string>)[draft.model] ?? '') ? <Text dimColor>No effort setting</Text> : picker('rule-effort', effortOptions, draft.effort, v => update($, ruleDraft, x => ({ ...x, effort: v })))}
              </Box>
              <Input
                key="rule-add"
                placeholder="words, for example landing page, redesign"
                submitLabel="Add rule"
                onSubmit={v => {
                  // "words = model effort" typed in full still works; otherwise the dropdowns give the route
                  const rule = v.includes('=') ? parseRule(v) : parseRule(`${v} = ${draft.model} ${draft.effort}`)
                  if (rule) void addRule($, rule)
                  else $.ui.toast('Type the words that should trigger the rule, for example landing page, then pick a model and effort above.')
                }}
              />
            </Box>
          ) : (
            <Text dimColor wrap="wrap">Add one with /route rule landing page = sonnet max</Text>
          )}
        </Box>

        <Box flexDirection="column" gap={1}>
          {section('Options')}
          <Box flexDirection="row" flexWrap="wrap" alignItems="center" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">When still broken after xhigh, move to</Text>
            </Box>
            {picker('stuck', [{ value: 'max', label: 'Max, same model' }, { value: 'sonnet', label: 'Sonnet 5.5' }, { value: 'opus', label: 'Opus 5.5' }, { value: 'fable', label: 'Fable 5.1' }], modelWord(r.top) ?? 'max', v => setOption($, { top: v === 'max' ? null : v }))}
          </Box>
          <Box flexDirection="row" flexWrap="wrap" alignItems="center" gap={1}>
            <Box flexGrow={1} flexShrink={1}>
              <Text wrap="wrap">Cache saver: skip one-off model switches in long chats</Text>
            </Box>
            {picker('saver', [{ value: 'on', label: 'On' }, { value: 'off', label: 'Off' }], r.saver ? 'on' : 'off', v => setOption($, { saver: v === 'on' }))}
          </Box>
        </Box>

        <Box flexDirection="row" alignItems="center" gap={1}>
          <Box flexGrow={1} flexShrink={1}>
            <Text dimColor wrap="wrap">One prompt only: start it with @opus, @max or @hard</Text>
          </Box>
          <Button key="router-reset" label="Reset" dimColor onPress={() => clearRoutes($)} />
        </Box>
      </Box>
    )
  })
plugins/cockpit/hooks/register.tsx lines 976–1082 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const list = (await read($, isOpen)) ? await read($, plans) : []
    const c = await read($, cache)
    const now = await $.clock.now()
    const state = phase(c, now) as 'none' | MeterLook
    // under FREE_BELOW tokens a lapsed cache costs too little to take a row
    const hasMeter = c.show && !c.hidden && state !== 'none' && c.tokens >= FREE_BELOW
    if ((list.length === 0 && !hasMeter) || e.props.hasSurvey) return next(e)
    const meterTitle = state === 'cold' ? `Cache expired · next prompt re-reads ${k(c.tokens)}` : `Prompt cache · ${k(c.tokens)}${c.why && state !== 'live' ? ` · missed: ${c.why}` : ''}`
    const t = $.ui.resolve(e)
    const { Box, Button, Text } = t
    const Svg = 'Svg' in t ? t.Svg : null
    const total = Math.max(320, (e.props.bodyColumns || 100) * 8)
    // every bar has the same width and is pinned to the right edge (fixed-width percent, close button),
    // so rows line up whatever their titles; the slack goes into the gap after the title.
    // Desktop reports ~8 CSS px per column; glyph, gaps, percent and the close button take ~126 px.
    const titleWidth = Math.min(Math.round(total * 0.3), Math.max(...[...list.map(p => p.title), ...(hasMeter ? [meterTitle] : [])].map(s => Math.round(textWidth(s, 6.4)))))
    // the cache row shares every width with the bars, so the tracks line up; the Keep warm button takes ~96 px of the title's side
    const trackW = Math.max(120, Math.min(1400, total - titleWidth - 140 - (hasMeter ? 96 : 0)))

    // the cache row is a bar like the others: glyph, title, a pill track whose fill drains by itself, the time left,
    // a close button. Its drawing starts from the time left now, so nothing is redrawn each second
    const meter = () => {
      const left = leftMs(c, now)
      const life = TTL_MS[c.life]
      const color = METER_COLOR[state as MeterLook]
      const canWarm = state === 'low' || state === 'soon'
      const filled = state === 'live' ? 25 : Math.round(Math.min(1, left / life) * 25)
      const pct = state === 'live' ? 100 : Math.round(Math.min(1, left / life) * 100)
      const timeLeft = state === 'live' ? 'live' : leftLabel(left)

      return (
        <Box key="cache-row" flexDirection="row" alignItems="center" gap={1}>
          <Text color={color}>{STATE_GLYPH[METER_STATE[state as MeterLook]]}</Text>
          <Text wrap="truncate">{meterTitle}</Text>
          {canWarm ? <Button key="cache-warm" label="Keep warm" onPress={async () => $.ui.toast(await keepWarm($))} /> : null}
          <Box flexGrow={1} />
          {Svg ? (
            <Box key="cache-track" flexShrink={0}>
              <Svg source={meterSvg(trackW, state as MeterLook, left, life)} alt={`Prompt cache: ${state === 'live' ? 'in use' : state === 'cold' ? 'expired' : `${timeLeft} left, ${pct}%`}`} width={trackW} height={TRACK_H} />
            </Box>
          ) : (
            <Text>
              <Text color={color}>{'━'.repeat(filled)}</Text>
              <Text dimColor>{'─'.repeat(25 - filled)}</Text>
              <Text color={color}>{` ${timeLeft}`}</Text>
            </Text>
          )}
          <Text dimColor>{`${String(pct).padStart(3, FIGURE_SPACE)}%`}</Text>
          <Button
            key="cache-close"
            plain
            dimColor
            label="✕"
            onPress={async () => {
              await update($, cache, x => ({ ...x, hidden: true }))
              $.ui.toast('Cache row hidden for this session. /cache on brings it back.')
            }}
          />
        </Box>
      )
    }

    return (
      <Box flexDirection="column" gap={1}>
        {list.map(p => {
          const track = trackSvg(p, trackW)
          // the hover layer is rebuilt on every redraw anyway, so its clock is set from now each time
          const hover = track.overlay.replace(/\{\{T:(\d+)\}\}/g, (_, t: string) => Math.max(0, (now - Number(t)) / 1000).toFixed(1))
          const w = where(p)
          const pct = p.state === 'done' ? 100 : Math.round((Math.min(w.pos, w.total) / Math.max(1, w.total)) * 100)
          const color = STATE_COLOR[p.state]
          const stageName = p.stages[w.stage]?.name ?? ''
          const alt =
            p.state === 'done'
              ? `${p.title}: done, ${plural(w.total, 'step')}${p.endedAt ? ` in ${elapsed(p.endedAt - p.startedAt)}` : ''}`
              : `${p.title}: ${stageName}, step ${w.step} of ${w.stageSize}, ${pct}%${p.note ? ` — ${p.note}` : ''}`
          const bar = `${'━'.repeat(Math.round(pct / 4))}${'─'.repeat(25 - Math.round(pct / 4))}`

          return (
            <Box key={`bar-${p.id}`} flexDirection="row" alignItems="center" gap={1}>
              <Text color={color}>{STATE_GLYPH[p.state]}</Text>
              <Text wrap="truncate">{p.title}</Text>
              <Box flexGrow={1} />
              {Svg ? (
                <Box key={`track-${p.id}`} flexShrink={0}>
                  <Svg source={track.base} alt={alt} width={trackW} height={TRACK_H} />
                  <Box position="absolute" top={0} left={0}>
                    <Svg source={hover} alt={`${p.title}: hover for times`} width={trackW} height={TRACK_H} isInteractive />
                  </Box>
                </Box>
              ) : (
                <Text>
                  <Text color={color}>{bar.replace(/─/g, '')}</Text>
                  <Text dimColor>{bar.replace(/━/g, '')}</Text>
                  <Text color={color}>{` ${stageName} ${w.step}/${w.stageSize}`}</Text>
                </Text>
              )}
              <Text dimColor>{`${String(pct).padStart(3, FIGURE_SPACE)}%`}</Text>
              <Button key={`close-${p.id}`} plain dimColor label="✕" onPress={() => dropPlan($, p.id)} />
            </Box>
          )
        })}
        {hasMeter ? meter() : null}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Syed Muhammad Hassaan

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 3bf352137716 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/cockpit/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.5 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 Brxerq/claude-cockpit
/plugin install cockpit@claude-cockpit

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

Search them from Claude: the MCP connector

Similar designs