modscode / Gallery / cactus-pane
cactus-pane
A live cactus inbox pane for the session's project, answerable in place
What it does
- Draws a pane, toasts
- Adds /cactus-pane
- Watches Bash calls and can refuse them
- Hooks prompt.compose, session.start, ui.focus, ui.message and 1 more
- Starts processes
Good points
- No network calls
- Written in TypeScript
- Writes no files
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 cactus-pane by Sean Canton (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/eighteyes-cactus-pane/
// 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: "cactus" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Client, Input } = $.ui.resolve(e)
const failed = '…'
const stack = '…'
const value = '…'
const key = '…'
const act = '…'
const word = '…'
const firstLine = '…'
const reflow = '…'
const filter = '…'
const para = '…'
const para2 = '…'
const para3 = '…'
const label = '…'
const confirmKey = '…'
const lines = '…'
const firstLine2 = '…'
const l = '…'
const l2 = '…'
const l3 = '…'
const lines2 = '…'
const firstLine3 = '…'
const l4 = '…'
const l5 = '…'
const l6 = '…'
const lines3 = '…'
const firstLine4 = '…'
const l7 = '…'
const l8 = '…'
const l9 = '…'
const rec = '…'
const recommend_why = '…'
const text = '…'
const n = '…'
const look_at = '…'
const run_cmd = '…'
const pass_when = '…'
const fail_when = '…'
const then_do = '…'
const exit = '…'
const l10 = '…'
const l11 = '…'
const l12 = '…'
const f = '…'
const shown = '…'
const f2 = '…'
const shown2 = '…'
const f3 = '…'
const shown3 = '…'
const verdict = '…'
const verdict2 = '…'
const verdict3 = '…'
const drafted = '…'
const length = '…'
const act2 = '…'
const firstLine5 = '…'
const reflow2 = '…'
const filter2 = '…'
const para4 = '…'
const para5 = '…'
const para6 = '…'
const lines4 = '…'
const firstLine6 = '…'
const l13 = '…'
const l14 = '…'
const l15 = '…'
const lines5 = '…'
const firstLine7 = '…'
const l16 = '…'
const l17 = '…'
const l18 = '…'
const lines6 = '…'
const firstLine8 = '…'
const l19 = '…'
const l20 = '…'
const l21 = '…'
const rec2 = '…'
const look_at2 = '…'
const run_cmd2 = '…'
const pass_when2 = '…'
const fail_when2 = '…'
const then_do2 = '…'
const exit2 = '…'
const l22 = '…'
const l23 = '…'
const l24 = '…'
const f4 = '…'
const shown4 = '…'
const f5 = '…'
const shown5 = '…'
const f6 = '…'
const shown6 = '…'
const verdict4 = '…'
const verdict5 = '…'
const verdict6 = '…'
const drafted2 = '…'
const act3 = '…'
const firstLine9 = '…'
const reflow3 = '…'
const filter3 = '…'
const para7 = '…'
const para8 = '…'
const para9 = '…'
const lines7 = '…'
const firstLine10 = '…'
const l25 = '…'
const l26 = '…'
const l27 = '…'
const lines8 = '…'
const firstLine11 = '…'
const l28 = '…'
const l29 = '…'
const l30 = '…'
const lines9 = '…'
const firstLine12 = '…'
const l31 = '…'
const l32 = '…'
const l33 = '…'
const rec3 = '…'
const look_at3 = '…'
const run_cmd3 = '…'
const pass_when3 = '…'
const fail_when3 = '…'
const then_do3 = '…'
const exit3 = '…'
const l34 = '…'
const l35 = '…'
const l36 = '…'
const f7 = '…'
const shown7 = '…'
const f8 = '…'
const shown8 = '…'
const f9 = '…'
const shown9 = '…'
const verdict7 = '…'
const verdict8 = '…'
const verdict9 = '…'
const drafted3 = '…'
return (
<Box flexDirection="column">
<Text color="red">
{failed}
</Text>
<Box flexDirection="row" columnGap={2}>
<Button label={`undo ${stack}`} hotkey={`${value}`} plain />
</Box>
<Text dimColor>
Inbox empty.
</Text>
<Box flexDirection="row" columnGap={2}>
<Button label="up" hotkey="k" plain />
<Button label="down" hotkey="j" plain />
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`▸ ${key}`} plain />
<Text color="white">
{act}
</Text>
<Text wrap="truncate-end">
{`${word} `}
{firstLine}
</Text>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Text bold wrap="wrap">
{reflow}
</Text>
<Text dimColor>
{filter}
</Text>
<Box marginTop={1} flexDirection="column">
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para2}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para3}
</Text>
</Box>
</Box>
<Text color="yellow">
waiting on a rewrite
{`: ${firstLine}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine2}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l2}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l3}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines2}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine3}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l4}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l5}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l6}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines3}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine4}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l7}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l8}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l9}
</Text>
</Box>
</Box>
<Text color="yellow">
{"recommend "}
{rec}
{" "}
{" "}
{` — ${recommend_why}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{"look at "}
<Text dimColor>
{look_at}
</Text>
</Text>
<Text>
{"run "}
<Text color="cyan">
{run_cmd}
</Text>
</Text>
<Text>
{"pass "}
<Text color="green">
{pass_when}
</Text>
</Text>
<Text>
{"fail "}
<Text color="red">
{fail_when}
</Text>
</Text>
<Text>
{"then "}
<Text dimColor>
{then_do}
</Text>
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="green">
{"exit "}
{exit}
</Text>
<Text dimColor>
{l10}
</Text>
<Text dimColor>
{l11}
</Text>
<Text dimColor>
{l12}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f}
</Text>
</Box>
<Text dimColor>
{shown}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f2}
</Text>
</Box>
<Text dimColor>
{shown2}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f3}
</Text>
</Box>
<Text dimColor>
{shown3}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
{"→ "}
{verdict}
</Text>
<Text dimColor>
{"→ "}
{verdict2}
</Text>
<Text dimColor>
{"→ "}
{verdict3}
</Text>
</Box>
<Box marginTop={1}>
<Client module="./editor.tsx" />
</Box>
<Box borderStyle="single" paddingX={1} marginTop={1}>
<Text wrap="wrap">
{drafted}
</Text>
</Box>
<Input label="line" placeholder="i to type · enter adds the line · enter on an empty line sends" submitLabel="add" />
<Box flexDirection="row" columnGap={2} marginTop={1}>
<Button label="single choice" hotkey="m" plain />
<Button label={`send ${length} picked (or enter)`} hotkey="g" plain />
<Button label="type" hotkey="i" plain />
<Button label="dismiss" hotkey="d" plain />
<Button label="run" hotkey="r" plain />
<Button label="cancel" hotkey="e" plain />
<Button label="break up" hotkey="b" plain />
<Button label="close" hotkey="x" plain />
<Button label="poke" hotkey="p" plain />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`▸ ${key}`} plain />
<Text color="white">
{act2}
</Text>
<Text wrap="truncate-end">
{`${word} `}
{firstLine5}
</Text>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Text bold wrap="wrap">
{reflow2}
</Text>
<Text dimColor>
{filter2}
</Text>
<Box marginTop={1} flexDirection="column">
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para4}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para5}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para6}
</Text>
</Box>
</Box>
<Text color="yellow">
waiting on a rewrite
{`: ${firstLine}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines4}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine6}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l13}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l14}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l15}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines5}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine7}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l16}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l17}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l18}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines6}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine8}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l19}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l20}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l21}
</Text>
</Box>
</Box>
<Text color="yellow">
{"recommend "}
{rec2}
{" "}
{" "}
{` — ${recommend_why}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{"look at "}
<Text dimColor>
{look_at2}
</Text>
</Text>
<Text>
{"run "}
<Text color="cyan">
{run_cmd2}
</Text>
</Text>
<Text>
{"pass "}
<Text color="green">
{pass_when2}
</Text>
</Text>
<Text>
{"fail "}
<Text color="red">
{fail_when2}
</Text>
</Text>
<Text>
{"then "}
<Text dimColor>
{then_do2}
</Text>
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="green">
{"exit "}
{exit2}
</Text>
<Text dimColor>
{l22}
</Text>
<Text dimColor>
{l23}
</Text>
<Text dimColor>
{l24}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f4}
</Text>
</Box>
<Text dimColor>
{shown4}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f5}
</Text>
</Box>
<Text dimColor>
{shown5}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f6}
</Text>
</Box>
<Text dimColor>
{shown6}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
{"→ "}
{verdict4}
</Text>
<Text dimColor>
{"→ "}
{verdict5}
</Text>
<Text dimColor>
{"→ "}
{verdict6}
</Text>
</Box>
<Box marginTop={1}>
<Client module="./editor.tsx" />
</Box>
<Box borderStyle="single" paddingX={1} marginTop={1}>
<Text wrap="wrap">
{drafted2}
</Text>
</Box>
<Input label="line" placeholder="i to type · enter adds the line · enter on an empty line sends" submitLabel="add" />
<Box flexDirection="row" columnGap={2} marginTop={1}>
<Button label="single choice" hotkey="m" plain />
<Button label={`send ${length} picked (or enter)`} hotkey="g" plain />
<Button label="type" hotkey="i" plain />
<Button label="dismiss" hotkey="d" plain />
<Button label="run" hotkey="r" plain />
<Button label="cancel" hotkey="e" plain />
<Button label="break up" hotkey="b" plain />
<Button label="close" hotkey="x" plain />
<Button label="poke" hotkey="p" plain />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`▸ ${key}`} plain />
<Text color="white">
{act3}
</Text>
<Text wrap="truncate-end">
{`${word} `}
{firstLine9}
</Text>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Text bold wrap="wrap">
{reflow3}
</Text>
<Text dimColor>
{filter3}
</Text>
<Box marginTop={1} flexDirection="column">
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para7}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para8}
</Text>
</Box>
<Box marginTop={0}>
<Text dimColor wrap="wrap">
{para9}
</Text>
</Box>
</Box>
<Text color="yellow">
waiting on a rewrite
{`: ${firstLine}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines7}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine10}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l25}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l26}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l27}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines8}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine11}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l28}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l29}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l30}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label={`✓ ${label}`} hotkey={`${confirmKey}`} plain variant="primary" />
<Text color="yellow">
recommended
</Text>
<Text color="blue">
chosen
</Text>
<Text dimColor wrap="wrap">
{lines9}
</Text>
</Box>
<Text dimColor>
{" "}
{firstLine12}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l31}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l32}
</Text>
<Text color="green" wrap="wrap">
{" ✓ "}
{l33}
</Text>
</Box>
</Box>
<Text color="yellow">
{"recommend "}
{rec3}
{" "}
{" "}
{` — ${recommend_why}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
<Button label={`[x] ${text}`} hotkey={`${n}`} plain />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{"look at "}
<Text dimColor>
{look_at3}
</Text>
</Text>
<Text>
{"run "}
<Text color="cyan">
{run_cmd3}
</Text>
</Text>
<Text>
{"pass "}
<Text color="green">
{pass_when3}
</Text>
</Text>
<Text>
{"fail "}
<Text color="red">
{fail_when3}
</Text>
</Text>
<Text>
{"then "}
<Text dimColor>
{then_do3}
</Text>
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="green">
{"exit "}
{exit3}
</Text>
<Text dimColor>
{l34}
</Text>
<Text dimColor>
{l35}
</Text>
<Text dimColor>
{l36}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f7}
</Text>
</Box>
<Text dimColor>
{shown7}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f8}
</Text>
</Box>
<Text dimColor>
{shown8}
</Text>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button label="view" hotkey="f" plain />
<Button label="hide" hotkey="o" plain />
<Text dimColor>
{f9}
</Text>
</Box>
<Text dimColor>
{shown9}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text dimColor>
{"→ "}
{verdict7}
</Text>
<Text dimColor>
{"→ "}
{verdict8}
</Text>
<Text dimColor>
{"→ "}
{verdict9}
</Text>
</Box>
<Box marginTop={1}>
<Client module="./editor.tsx" />
</Box>
<Box borderStyle="single" paddingX={1} marginTop={1}>
<Text wrap="wrap">
{drafted3}
</Text>
</Box>
<Input label="line" placeholder="i to type · enter adds the line · enter on an empty line sends" submitLabel="add" />
<Box flexDirection="row" columnGap={2} marginTop={1}>
<Button label="single choice" hotkey="m" plain />
<Button label={`send ${length} picked (or enter)`} hotkey="g" plain />
<Button label="type" hotkey="i" plain />
<Button label="dismiss" hotkey="d" plain />
<Button label="run" hotkey="r" plain />
<Button label="cancel" hotkey="e" plain />
<Button label="break up" hotkey="b" plain />
<Button label="close" hotkey="x" plain />
<Button label="poke" hotkey="p" plain />
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const key = '…'
const firstLine = '…'
await $.ui.toast(`cactus ${key}: ${firstLine}`)
await $.ui.toast(`cactus ${key}: answer withdrawn`)
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.
mods/cactus-pane/hooks/register.tsx lines 523–682 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const els = $.ui.resolve(e)
const { Box, Text, Button } = els
const Input = 'Input' in els ? els.Input : undefined
const Client = 'Client' in els ? els.Client : undefined
const list = await read($, rows)
const picked = await read($, picks)
const failed = await read($, error)
const shown = await read($, previews)
const wanted = await read($, selected)
const stack = await read($, undo)
const modeOf = await read($, modes)
const flipped = await read($, flips)
const editingKey = await read($, editing)
const drafted = await read($, drafts)
const current = list.find(r => r.key === wanted) ?? list[0]
const card = (row: Row) => {
// m turns a single-choice row into pick-several for this one answer.
const canFlip = row.kind === 'choice' && row.act !== 'data' && row.act !== 'run' && row.choices.length > 1
const isFlipped = canFlip && flipped[row.key] === true
const isMulti = row.kind === 'multi' || isFlipped
const isConfirm = row.kind === 'confirm'
const isData = row.act === 'data'
const isPlan = row.act === 'plan'
const isRunAct = row.act === 'run'
const isElaborate = row.status === 'elaborate'
const isHinting = modeOf[row.key] === 'elaborate'
const canRun = isRunAct || Boolean(row.review?.run_cmd)
const hasInput =
Input !== undefined && (row.allow_free || isMulti || PERSISTENT.has(row.act) || isHinting) && !isData
const rec = row.recommend ?? []
// A multi row starts with its recommended set ticked, as the TUI does.
const mine = picked[row.key] ?? (isMulti ? rec : [])
const inputLabel = isHinting ? 'hint' : isMulti ? 'note' : PERSISTENT.has(row.act) ? 'verdict' : 'answer'
const owner = row.agent ? ['--agent', row.agent] : []
const pick = (label: string, surface: typeof e.surface) => {
if (isData) {
const body = row.choices.find(c => c.label === label)?.description ?? ''
void $.ui.copy({ text: body, surface })
void answerRow($, row.key, ['-s', label])
} else if (isMulti) {
// Park the ring on send so the next Enter submits the picks.
void toggle($, row.key, label, rec).then(() =>
$.ui.focus({ requestId: PANE, key: `${row.key}:send` }).catch(() => undefined),
)
} else if (isRunAct && label === 'approve') {
void runRow($, row.key, true)
} else {
void answerRow($, row.key, ['-s', label])
}
}
const confirmKey = (i: number) => (i === 0 ? 'y' : 'n')
return (
<Box key={`${row.key}:card`} flexDirection="column" borderStyle="round" paddingX={1}>
<Text bold wrap="wrap">{reflow(row.text)}</Text>
<Text dimColor>
{[
row.thread ? `thread ${row.thread}` : null,
row.agent ? `agent ${row.agent.slice(0, 8)}` : null,
row.blocked ? 'blocking' : null,
row.status === 'open' ? null : row.status,
row.files.length > 0 ? `${row.files.length} file(s)` : null,
]
.filter(Boolean)
.join(' · ')}
</Text>
{row.context && (
<Box marginTop={1} flexDirection="column">
{reflow(row.context).split('\n\n').map((para, j) => (
<Box key={String(j)} marginTop={j === 0 ? 0 : 1}>
<Text dimColor wrap="wrap">{para}</Text>
</Box>
))}
</Box>
)}
{isElaborate && (
<Text color="yellow">
waiting on a rewrite{row.elaborate ? `: ${firstLine(row.elaborate)}` : ''}
</Text>
)}
{row.choices.length > 0 && (
<Box flexDirection="column" marginTop={1}>
{row.choices.map((c, i) => {
const lines = (isData ? c.description ?? '' : reflow(c.description)).split('\n')
const isPicked = mine.includes(c.label)
return (
<Box key={`${row.key}:c${i}`} flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Button
key={`${row.key}:${c.label}`}
label={`${isPicked ? '✓ ' : ''}${c.label}`}
hotkey={isConfirm && i < 2 ? confirmKey(i) : i < 9 ? String(i + 1) : undefined}
plain
variant={rec.includes(c.label) ? 'primary' : undefined}
onPress={press => pick(c.label, press.surface)}
/>
{rec.includes(c.label) && <Text color="yellow">recommended</Text>}
{row.chosen === c.label && <Text color="blue">chosen</Text>}
{!isData && lines[0] && <Text dimColor wrap="wrap">{lines[0]}</Text>}
</Box>
{isData && <Text dimColor> {firstLine(c.description)}</Text>}
{!isData &&
lines.slice(1).map((l, j) =>
l.startsWith('+ ') ? (
<Text key={String(j)} color="green" wrap="wrap"> ✓ {l.slice(2)}</Text>
) : l.startsWith('- ') ? (
<Text key={String(j)} color="red" wrap="wrap"> ✗ {l.slice(2)}</Text>
) : (
<Text key={String(j)} dimColor wrap="wrap"> {l}</Text>
),
)}
</Box>
)
})}
</Box>
)}
{rec.length > 0 && (
<Text color="yellow">
recommend {rec.join(', ')} {CONFIDENCE[row.confidence ?? ''] ?? ''} {row.confidence ?? ''}
{row.recommend_why ? ` — ${row.recommend_why}` : ''}
</Text>
)}
{isPlan && row.steps.length > 0 && (
<Box flexDirection="column" marginTop={1}>
{row.steps.map(s => (
<Button
key={`${row.key}:step${s.n}`}
label={`[${s.done ? 'x' : ' '}] ${s.text}`}
hotkey={s.n <= 9 ? String(s.n) : undefined}
plain
onPress={() =>
void cactus($, row.key, ['plan', row.key, s.done ? '--undone' : '--done', String(s.n)])
}
/>
))}
</Box>
)}
{row.review && (
<Box flexDirection="column" marginTop={1}>
{row.review.look_at && <Text>look at <Text dimColor>{row.review.look_at}</Text></Text>}
{row.review.run_cmd && <Text>run <Text color="cyan">{row.review.run_cmd}</Text></Text>}
{row.review.pass_when && <Text>pass <Text color="green">{row.review.pass_when}</Text></Text>}
{row.review.fail_when && <Text>fail <Text color="red">{row.review.fail_when}</Text></Text>}
{row.review.then_do && <Text>then <Text dimColor>{row.review.then_do}</Text></Text>}
</Box>
)}
{row.result && (
<Box flexDirection="column" marginTop={1}>
<Text color={row.result.exit === 0 ? 'green' : 'red'}>exit {String(row.result.exit)}</Text>
{row.result.tail.slice(-8).map((l, j) => (
<Text key={String(j)} dimColor>{l}</Text>
))}
</Box>Licence text (MIT)
MIT License Copyright (c) 2026 eighteyes 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 programsdrives Claudetool calls
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 d8c80e0fd3f2 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.mods/cactus-pane/hooks/register.tsx |
| 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, the same in both |
| 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.its repository's .claude-plugin/marketplace.json does not list it: no install line to give |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).mods/cactus-pane/hooks/register.tsx:429 head (not on Windows); mods/cactus-pane/hooks/register.tsx:695 open (not on Windows) |
| 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.cactus, git (reaches the network), head, open (reaches the network) |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reaches the network, but reads no files and no environment variables |
| 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's .claude-plugin/marketplace.json does not list it, so there is no install line to give. Read it as code, or follow its author's README.
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 "eighteyes-cactus-pane" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Ask Claude…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd
-
Ask Claude…Fix loginRead↑⌂↻◉Σ⊟⊘± no git repo · git status starts after git init⑂ build ↑Darwin ↓LibraryEdit+Edit -EditBashBashBash clean/ Bash jump×./rows.tsxselected: Read● build… a1b2c3d
-
Ask Claude…FilesEXPLORER‹ BackForward ›↑ Up Enter⏎⌫buildbuildbuild💾■ build ⎇ main · chosen(not loaded) · dockedbuildbuildbuildbuildbuildbuildbuildbuildbuildbuildbuildbuild↑ k↓ j← h→ l⏎ oFind files1–Find files3 of 3 · Invalid changed
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
Ask Claude…Trajectorytrajectory · OFF · Opus · every Trajectory steps · sees chat 2 · Template covered ·nowbackfillclearsettingsclosebackfill · rebuild the phases with Opus, every Trajectory steps (both in settings)whole conversationlast 40 stepslast 100 stepscancel#3steps Template–Settings · 14:32 · amended 14:32 · Opus · 3 dec · 3 btw✕▾ Fix loginSettingsdecisions• Template ↳ Settings• Template ↳ Settings• Template ↳ Settingsstepsbtw#3steps Template–Settings · 14:32 · amended 14:32 · Opus · 3 dec · 3 btw✕▾ Fix loginSettingsdecisions• Template ↳ Settings• Template ↳ Settings• Template ↳ Settingsstepsbtw#3steps Template–Settings · 14:32 · amended 14:32 · Opus · 3 dec · 3 btw✕▾ Fix loginSettingsdecisions• Template ↳ Settings• Template ↳ Settings• Template ↳ Settingsstepsbtw