refs
Tracks the reference codes (F1, D2, A3) Claude defines: a /refs pane, and cited codes resolved for the model
What it does
- Draws a pane, toasts
- Adds /refs
- Hooks prompt.edit, prompt.submit, session.end, session.start and 1 more
Good points
- No network calls
- Starts no processes
- 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)
import type { Register } from 'claude-code'
// Drawn like refs by Rafe Symonds (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/rafesymonds-refs/
// 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: "Refs" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Input, Button, Text } = $.ui.resolve(e)
const key = '…'
const label = '…'
const length = '…'
const stagedCount = '…'
const sentCount = '…'
const searched = '…'
const name = '…'
const inUse = '…'
const code = '…'
const text = '…'
const marker = '…'
const word = '…'
const marker2 = '…'
const marker3 = '…'
const typed = '…'
const question = '…'
const text2 = '…'
const marker4 = '…'
const marker5 = '…'
const marker6 = '…'
const typed2 = '…'
const code2 = '…'
const question2 = '…'
const text3 = '…'
const marker7 = '…'
const marker8 = '…'
const marker9 = '…'
const typed3 = '…'
const code3 = '…'
const question3 = '…'
const name2 = '…'
const inUse2 = '…'
const text4 = '…'
const marker10 = '…'
const marker11 = '…'
const marker12 = '…'
const typed4 = '…'
const code4 = '…'
const question4 = '…'
const text5 = '…'
const marker13 = '…'
const marker14 = '…'
const marker15 = '…'
const typed5 = '…'
const code5 = '…'
const question5 = '…'
const text6 = '…'
const marker16 = '…'
const marker17 = '…'
const marker18 = '…'
const typed6 = '…'
const code6 = '…'
const question6 = '…'
const name3 = '…'
const inUse3 = '…'
const text7 = '…'
const marker19 = '…'
const marker20 = '…'
const marker21 = '…'
const typed7 = '…'
const code7 = '…'
const question7 = '…'
const text8 = '…'
const marker22 = '…'
const marker23 = '…'
const marker24 = '…'
const typed8 = '…'
const code8 = '…'
const question8 = '…'
const text9 = '…'
const marker25 = '…'
const marker26 = '…'
const marker27 = '…'
const typed9 = '…'
const code9 = '…'
const question9 = '…'
return (
<Box flexDirection="column" gap={1} paddingX={1} paddingY={1}>
<Input label="⌕ " placeholder="Search codes, text or a group (findings, actions)" submitLabel="first match" />
<Box flexDirection="row" flexWrap="wrap" columnGap={2}>
<Button hotkey={`${key}`} label={`${label}`} plain dimColor />
<Button hotkey={`${key}`} label={`${label}`} plain dimColor />
<Button hotkey={`${key}`} label={`${label}`} plain dimColor />
</Box>
<Box flexDirection="row" gap={1}>
<Text bold>
{`${length} codes`}
</Text>
<Text color="cyan">
{"· "}
{stagedCount}
{" in your draft"}
</Text>
<Text dimColor>
{"· "}
{sentCount}
{" answered"}
</Text>
</Box>
<Text dimColor>
No codes match "
{searched}
".
</Text>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Box flexDirection="row" gap={1}>
<Button label="▸" plain />
<Text bold>
{name}
</Text>
<Text dimColor>
{inUse}
</Text>
<Text>
❮
</Text>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker2}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker3}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code}
{" · "}
<Text italic>
{question}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text2}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker4}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker5}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker6}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed2}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code2}
{" · "}
<Text italic>
{question2}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text3}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker7}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker8}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker9}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed3}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code3}
{" · "}
<Text italic>
{question3}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Box flexDirection="row" gap={1}>
<Button label="▸" plain />
<Text bold>
{name2}
</Text>
<Text dimColor>
{inUse2}
</Text>
<Text>
❮
</Text>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text4}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker10}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker11}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker12}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed4}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code4}
{" · "}
<Text italic>
{question4}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text5}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker13}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker14}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker15}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed5}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code5}
{" · "}
<Text italic>
{question5}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text6}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker16}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker17}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker18}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed6}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code6}
{" · "}
<Text italic>
{question6}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1}>
<Box flexDirection="row" gap={1}>
<Button label="▸" plain />
<Text bold>
{name3}
</Text>
<Text dimColor>
{inUse3}
</Text>
<Text>
❮
</Text>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text7}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker19}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker20}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker21}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed7}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code7}
{" · "}
<Text italic>
{question7}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text8}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker22}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker23}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker24}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed8}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code8}
{" · "}
<Text italic>
{question8}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} paddingY={0}>
<Box flexDirection="row" gap={1}>
<Text>
❯
</Text>
<Text>
•
</Text>
<Button label={`${code}`} plain />
<Box flexGrow={1} flexShrink={1}>
<Text wrap="wrap">
{text9}
</Text>
</Box>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Box flexDirection="row">
<Text>
{marker25}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker26}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text>
{marker27}
</Text>
<Button label={`${word}`} plain />
</Box>
<Box flexDirection="row">
<Text color="yellow" dimColor>
○
{" "}
</Text>
<Button label="defer" plain dimColor />
</Box>
<Box flexDirection="row">
<Text color="blue">
{"○ "}
</Text>
<Button label="type" plain />
</Box>
<Box flexDirection="row">
<Text color="magenta">
{"○ "}
</Text>
<Button label="btw" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} marginTop={1}>
<Text color="blue">
✎
</Text>
<Box flexShrink={1}>
<Text wrap="wrap" color="blue">
{typed9}
</Text>
</Box>
<Button label="edit" plain dimColor />
<Button label="remove" plain dimColor />
</Box>
<Box marginTop={1}>
<Input label="✎ " placeholder={`Your answer to ${code}; Enter adds it to your prompt`} value="" autoFocus submitLabel="add" />
</Box>
<Box marginTop={1}>
<Input autoFocus label="btw " placeholder={`Ask about ${code}; Enter on empty asks for more depth`} submitLabel="ask" />
</Box>
<Box flexDirection="column" marginTop={1} paddingX={1} borderStyle="round" borderColor="magenta">
<Text color="magenta" bold>
{"btw · "}
{code9}
{" · "}
<Text italic>
{question9}
</Text>
</Text>
<Text dimColor>
Asking…
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="yellow" borderDimColor paddingX={1} />
</Box>
)
})
on('session.start', async ($, e, next) => {
const code = '…'
const reason = '…'
await $.ui.toast(`${code} deferred: Claude records it in the repo's docs when you send`)
await $.ui.toast(`Can't jump to ${code}: ${reason}`)
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/refs/hooks/register.tsx lines 488–647 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const elements = $.ui.resolve(e)
const { Box, Button, Markdown, Text } = elements
// Mobile draws no Input: no search or typed answers there.
const Input = 'Input' in elements ? elements.Input : undefined
const list = await read($, codes)
const inDraft = await read($, staged)
const answered = await read($, sent)
const open = await read($, asides)
const searched = await read($, query)
const typingCode = await read($, typing)
const askingCode = await read($, asking)
if (list.length === 0) {
return <Text dimColor>No reference codes yet. They appear here as Claude defines them.</Text>
}
const away = await read($, parked)
const isDeferredOpen = await read($, showDeferred)
const turnNow = await read($, turn)
const matches = search(list, searched, prefix => nameOf(prefix, list))
const shownRefs = matches.filter(ref => !away.includes(ref.code))
const deferredRefs = matches.filter(ref => away.includes(ref.code))
const foldedNow = await read($, folded)
const order = walkOrder(group(shownRefs), foldedNow)
const selectedNow = await read($, selected)
const selectedRef = order.find(ref => ref.code === selectedNow) ?? order[0]
const selectedCode = selectedRef?.code
const stagedCount = Object.keys(inDraft).length
const sentCount = Object.keys(answered).length
const setQuery = (value: string) => update($, query, () => value)
// The keyboard: each key is a plain Button whose hotkey works while the pane
// holds the keys. Drawn as `j: down`, so the row is its own legend.
const onSelected = (act: (code: string) => Promise<void>) => async () => {
if (selectedCode !== undefined) await act(selectedCode)
}
const hasInput = Input !== undefined
const KEYS: { key: string; label: string; run: () => Promise<void> }[] = [
{ key: 'j', label: 'down', run: () => move($, 'next') },
{ key: 'k', label: 'up', run: () => move($, 'previous') },
{ key: 'g', label: 'top/end', run: () => move($, 'ends') },
...(['y', 'n'] as const).flatMap((key, at) => {
const verb = selectedRef === undefined ? undefined : verbsFor(selectedRef.prefix, kinds)[at]
if (verb === undefined) return []
const [slot, word] = verb
return [{ key, label: word, run: onSelected(async () => answerRef($, selectedRef as Ref, slot)) }]
}),
{ key: 'd', label: 'defer', run: onSelected(async () => park($, selectedRef as Ref)) },
...(hasInput ? [{ key: 'i', label: 'type', run: onSelected(code => typeAnswer($, code)) }] : []),
{ key: 'x', label: 'clear', run: onSelected(code => setAnswer($, code, '')) },
{
key: 'b',
label: 'btw',
run: onSelected(async code => {
const ref = order.find(one => one.code === code)
if (ref !== undefined) await toggleAside($, ref, hasInput)
}),
},
{ key: 'p', label: 'put code', run: onSelected(code => putCode($, code)) },
{
key: 'z',
label: 'fold',
run: onSelected(async code => {
const ref = order.find(one => one.code === code)
if (ref !== undefined) await toggleFold($, ref.prefix)
}),
},
{ key: 'o', label: 'open', run: onSelected(code => jumpTo($, code)) },
...(hasInput
? [{ key: 's', label: 'search', run: async () => void (await focusOn($, 'search')) }]
: []),
{ key: 'q', label: 'close', run: () => $.ui.close({ id: PANE }) },
]
return (
<Box flexDirection="column" gap={1} paddingX={1} paddingY={1}>
{Input !== undefined && (
<Input
key="search"
label="⌕ "
placeholder="Search codes, text or a group (findings, actions)"
submitLabel="first match"
onInput={setQuery}
onSubmit={async value => {
await setQuery(value)
const first = (await shownOrder($))[0]
if (first !== undefined) {
await update($, selected, () => first.code)
await focusOn($, `code:${first.code}`)
}
}}
/>
)}
{hasVimKeys && (
<Box flexDirection="row" flexWrap="wrap" columnGap={2}>
{KEYS.map(({ key, label, run }) => (
<Button key={`key:${key}`} hotkey={key} label={label} plain dimColor onPress={() => void run()} />
))}
</Box>
)}
<Box flexDirection="row" gap={1}>
<Text bold>
{searched.trim() === ''
? `${shownRefs.length} codes`
: `${shownRefs.length} of ${list.length - away.length} codes`}
</Text>
{stagedCount > 0 && <Text color="cyan">· {stagedCount} in your draft</Text>}
{sentCount > 0 && <Text dimColor>· {sentCount} answered</Text>}
</Box>
{shownRefs.length === 0 && <Text dimColor>No codes match "{searched}".</Text>}
{group(shownRefs).map(({ prefix, refs }) => {
const style = { name: nameOf(prefix, list), color: colorOf(prefix) }
const isFolded = foldedNow.includes(prefix)
const holdsSelection = refs.some(ref => ref.code === selectedCode)
const verbs = verbsFor(prefix, kinds)
return (
<Box
flexDirection="column"
borderStyle="round"
borderColor={style.color}
borderDimColor={!holdsSelection}
paddingX={1}
>
<Box key={`group:${prefix}`} flexDirection="row" gap={1}>
<Button
key={`fold:${prefix}`}
label={isFolded ? '▸' : '▾'}
plain
hover={{ color: style.color }}
onPress={() => toggleFold($, prefix)}
/>
<Text bold color={style.color}>
{style.name}
</Text>
<Text dimColor>{inUse(refs)}</Text>
{isFolded && holdsSelection && <Text color={style.color}>❮</Text>}
</Box>
{/* Each code: a pointer when selected, its mark (a draft answer bright,
a sent one dim, else a bullet), the code, and its text wrapping
under itself. Under the text: its answers, the typed answer with
edit and remove, any open field, and any btw answer. */}
{(isFolded ? [] : refs).map(ref => {
const draftAnswer = inDraft[ref.code]
const sentAnswer = answered[ref.code]
const shown = draftAnswer ?? sentAnswer
const mark = shown === undefined ? undefined : markFor(prefix, shown)
const isSelected = ref.code === selectedCode
const aside = open.find(one => one.code === ref.code)
const typed =
draftAnswer !== undefined && slotOf(prefix, draftAnswer, kinds) === undefined ? draftAnswer : undefined
const isFieldOpen = Input !== undefined && typingCode === ref.code
// Everything under a code lines up with its text.
const indent = ref.code.length + 5
const age = ref.turn === undefined ? AGE_BACKGROUND.length : turnNow - ref.turn
const background = AGE_BACKGROUND[age]Licence text (MIT)
MIT License Copyright (c) 2026 Rafe Symonds 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 Claude
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 efacb19a1582 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/refs/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.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 RafeSymonds/claude-mods/plugin install refs@claude-modsThis installs the marketplace's latest commit, which may not be the one read here (efacb19a1582). 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 "rafesymonds-refs" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Ask Claude…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts
-
Ask Claude…Desktop Markdown ReaderDesktop Markdown ReaderMarkdown file README.md applyChoose a Markdown file.No document loaded.Copy Markdown sourceRefresh
-
Ask Claude…envbuildbuildbuild+ .env.localsrc/app.ts is not in .gitignoreWriteNo .env files in the project root yet.K = paste the value, Enter saves saveNew key: NAME, Enter to continuegenerate randomcancelMissing compared with Write:KKK
-
Ask Claude…⏺ src/ WriteUpdated·0·0·0search: Edit nextUpdated1/3── Updated ────────› Edit› Edit› Edit⎿Updated> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎⋯> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎
-
Ask Claude…Tasks for you● Open (3)● Completed (3)Auto: on---Let Claude use this pane on its own?Claude would post anything only you can do here, and check tasks off when you confirm them in chat.Nothing for you to do right now.Yes, automaticallyOnly when I ask---#a1b2c3d Fix login31. CopyCopy
npm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send---#a1b2c3d Fix login31. CopyCopynpm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send---#a1b2c3d Fix login31. CopyCopynpm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send