Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / refs

refs

Tracks the reference codes (F1, D2, A3) Claude defines: a /refs pane, and cited codes resolved for the model

Code you can checkTerminal + desktopPaneToastBoxButtonInputMarkdownText
drives Claude, draws

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

A starter ModsCode writes from the drawing it read, and the mod's own lines that draw, where there are any.

Starter (register.tsx)

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/claude-mods/mods/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.

How to build this: Pane (panel), Rewrite the prompt

What its code calls

drives Claude

What its code shows

Read from the source at commit efacb19a1582 on 2026-10-11. 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/refs/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 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 something of yours (files, environment variables, the transcript, settings) and reaches outside (the network, an MCP server, another session, telemetry).reads the prompt box, the transcript, but reaches nothing outside
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
Settings hooksHooks declared in hooks/hooks.json or plugin.json beside the module: a command (a shell when it has no args), an HTTP request, an MCP tool or a model prompt at an event. They run outside $.no settings hooks: its function hooks alone
Servers it shipsMCP servers (a program, or a URL; a headersHelper is a shell command; a .mcpb bundle is unpacked at run time), LSP servers, monitors (a shell command for the whole session) and bin/ (on the PATH of the Bash tool).ships no MCP or LSP server, no monitor, no bin/
Skills, commands, agentsWhat its Markdown declares beyond text: allowed-tools granted for the turn, hooks added when a skill is invoked, a command run before Claude reads the skill.no skills, commands, agents or workflows
Tools and MCPWhether every tool it calls through $.tool.call and $.mcp.call is named in the code, and none is a shell (Bash through the tool runs a shell without $.process).calls no tool, MCP server or command
Asks of the modelCompletions it runs ($.model.complete, fork, classify), subagents it spawns, prompts it submits as you, and the tools, commands and agents it adds.model.fork (sends its own transcript), model.complete, adds command refs
Events it hooksBy what a hook there can do: gates (refuse a tool call, a prompt, a setting, another plugin), shapes (what the model reads: the system prompt, tool descriptions, each request), reads (your input, the events of the settings hooks, every event with *), and the rest.gates: prompt.submit, command.run (refs) · reads: prompt.edit · also: session.start, turn.complete, session.end, ui.render (AssistantMessage, Pane) · timers: clock.after, clock.every
Reads, by nameThe environment variables and files it names, and whether it reads the transcript, settings.json, the prompt box or the mouse selection.the prompt box; the transcript
Writes, by nameThe files and environment variables it names, and whether it changes settings, the prompt box, the clipboard, the conversation (a row the model reads) or another session.the prompt box

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 its code (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

From its marketplace

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-mods
/reload-plugins

This installs the marketplace's latest commit, which may not be the one read here (efacb19a1582). Compare them before you install. /reload-plugins loads it into a session that is already open.

Try the commit ModsCode read

No marketplace needed. In a terminal, clone the repository, check out the commit read, validate the mod, and load it for one session:

git clone https://github.com/RafeSymonds/claude-mods
git -C claude-mods checkout efacb19a1582827a0cc1618f1f31237b8d0619db
claude plugin validate claude-mods/plugins/refs
claude --plugin-dir claude-mods/plugins/refs

The validate line lists the events the mod hooks and what it asks Claude Code to do, without running it. The last line loads the mod for this session only and writes nothing to your settings. If the author has rewritten history, the commit may no longer exist.

Ask Claude about it

With the ModsCode connector added, Claude can read this mod's code and what it reaches, and build on them. Ask it like this:

Read the ModsCode mod "rafesymonds-refs" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More from this repository

Badge for your README

If this is your mod, paste this into your README. It links to this page.

README.md
[![ModsCode](https://modscode.com/badge/rafesymonds-refs.svg)](https://modscode.com/claude-mods/mods/rafesymonds-refs/)