Ranking|Claude Code Mods

ModsCode / Claude Code Mods / Ranking / ledger

ledger

The record of orchestrated work: runs of units and tasks, the subagents spawned for them, each gate's verdict and the findings reviewers report, summed up in the status line while there is something to say. It can follow a superpowers plan…

Code you can checkTerminal + desktopPaneStatus lineToastBoxButtonText
writes files, drives Claude, draws

What it does

  • Draws a pane, toasts
  • Adds /ledger
  • Watches Write, Edit calls and can refuse them
  • Hooks agent.spawn, prompt.compose, session.start, turn.complete and 1 more
  • Keeps its own state between turns

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 ledger by Kuang Tar Lim (pane, status, toast), as ModsCode read it from the mod's code:
// https://modscode.com/claude-mods/mods/buddylim-ledger/
// 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: "Ledger" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const id = '…'
    const done = '…'
    const tasks = '…'
    const tokensText = '…'
    const path = '…'
    const name = '…'
    const mark = '…'
    const done2 = '…'
    const tasks2 = '…'
    const name2 = '…'
    const done3 = '…'
    const tasks3 = '…'
    const name3 = '…'
    const done4 = '…'
    const tasks4 = '…'
    const name4 = '…'
    const length = '…'
    const length2 = '…'
    const about = '…'
    const title = '…'
    const note = '…'
    const spawnMeta = '…'
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const outcome = '…'
    const note2 = '…'
    const filter = '…'
    const mark2 = '…'
    const id2 = '…'
    const title2 = '…'
    const note3 = '…'
    const spawnMeta2 = '…'
    const text4 = '…'
    const text5 = '…'
    const text6 = '…'
    const outcome2 = '…'
    const note4 = '…'
    const filter2 = '…'
    const mark3 = '…'
    const id3 = '…'
    const title3 = '…'
    const note5 = '…'
    const spawnMeta3 = '…'
    const text7 = '…'
    const text8 = '…'
    const text9 = '…'
    const outcome3 = '…'
    const note6 = '…'
    const filter3 = '…'
    const name5 = '…'
    const done5 = '…'
    const tasks5 = '…'
    const name6 = '…'
    const done6 = '…'
    const tasks6 = '…'
    const name7 = '…'
    const done7 = '…'
    const tasks7 = '…'
    const name8 = '…'
    const length3 = '…'
    const length4 = '…'
    const about2 = '…'
    const mark4 = '…'
    const id4 = '…'
    const title4 = '…'
    const note7 = '…'
    const spawnMeta4 = '…'
    const text10 = '…'
    const text11 = '…'
    const text12 = '…'
    const outcome4 = '…'
    const note8 = '…'
    const filter4 = '…'
    const mark5 = '…'
    const id5 = '…'
    const title5 = '…'
    const note9 = '…'
    const spawnMeta5 = '…'
    const text13 = '…'
    const text14 = '…'
    const text15 = '…'
    const outcome5 = '…'
    const note10 = '…'
    const filter5 = '…'
    const mark6 = '…'
    const id6 = '…'
    const title6 = '…'
    const note11 = '…'
    const spawnMeta6 = '…'
    const text16 = '…'
    const text17 = '…'
    const text18 = '…'
    const outcome6 = '…'
    const note12 = '…'
    const filter6 = '…'
    const name9 = '…'
    const done8 = '…'
    const tasks8 = '…'
    const name10 = '…'
    const done9 = '…'
    const tasks9 = '…'
    const name11 = '…'
    const done10 = '…'
    const tasks10 = '…'
    const name12 = '…'
    const length5 = '…'
    const length6 = '…'
    const about3 = '…'
    const mark7 = '…'
    const id7 = '…'
    const title7 = '…'
    const note13 = '…'
    const spawnMeta7 = '…'
    const text19 = '…'
    const text20 = '…'
    const text21 = '…'
    const outcome7 = '…'
    const note14 = '…'
    const filter7 = '…'
    const mark8 = '…'
    const id8 = '…'
    const title8 = '…'
    const note15 = '…'
    const spawnMeta8 = '…'
    const text22 = '…'
    const text23 = '…'
    const text24 = '…'
    const outcome8 = '…'
    const note16 = '…'
    const filter8 = '…'
    const mark9 = '…'
    const id9 = '…'
    const title9 = '…'
    const note17 = '…'
    const spawnMeta9 = '…'
    const text25 = '…'
    const text26 = '…'
    const text27 = '…'
    const outcome9 = '…'
    const note18 = '…'
    const filter9 = '…'
    const mark10 = '…'
    const description = '…'
    const spawnMeta10 = '…'
    const mark11 = '…'
    const description2 = '…'
    const spawnMeta11 = '…'
    const mark12 = '…'
    const description3 = '…'
    const spawnMeta12 = '…'
    const length7 = '…'
    const length8 = '…'
    const glyph = '…'
    const placeOf = '…'
    const summary = '…'
    const summary2 = '…'
    const glyph2 = '…'
    const summary3 = '…'
    const summary4 = '…'
    const glyph3 = '…'
    const summary5 = '…'
    const summary6 = '…'
    return (
      <Box flexDirection="column" paddingX={2}>
        <Box justifyContent="space-between">
          <Text bold wrap="truncate-end">
            <Text color="cyan">
              
              {" "}
            </Text>
            {`Run ${id}`}
          </Text>
          <Text dimColor>
            {" "}
            {done}
            /
            {tasks}
            {` · ${tokensText}`}
          </Text>
        </Box>
        <Text dimColor wrap="truncate-start">
          {path}
        </Text>
        <Text dimColor>
          ────────
        </Text>
        <Box flexDirection="column" paddingLeft={0}>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done2}
              /
              {tasks2}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name2}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done3}
              /
              {tasks3}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name3}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done4}
              /
              {tasks4}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold wrap="truncate-end">
              {name4}
            </Text>
            <Text dimColor>
              {" "}
              {length}
              /
              {length2}
            </Text>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap" dimColor>
              {about}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark}
                  {" "}
                </Text>
                <Text bold>
                  {id}
                </Text>
                {" "}
                {title}
                <Text color="error">
                  {"  "}
                  {note}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text2}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text3}
              </Text>
              <Text wrap="wrap">
                {outcome}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note2}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark2}
                  {" "}
                </Text>
                <Text bold>
                  {id2}
                </Text>
                {" "}
                {title2}
                <Text color="error">
                  {"  "}
                  {note3}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta2}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text4}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text5}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text6}
              </Text>
              <Text wrap="wrap">
                {outcome2}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note4}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark3}
                  {" "}
                </Text>
                <Text bold>
                  {id3}
                </Text>
                {" "}
                {title3}
                <Text color="error">
                  {"  "}
                  {note5}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta3}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text7}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text8}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text9}
              </Text>
              <Text wrap="wrap">
                {outcome3}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note6}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter3}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" paddingLeft={0}>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name5}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done5}
              /
              {tasks5}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name6}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done6}
              /
              {tasks6}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name7}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done7}
              /
              {tasks7}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold wrap="truncate-end">
              {name8}
            </Text>
            <Text dimColor>
              {" "}
              {length3}
              /
              {length4}
            </Text>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap" dimColor>
              {about2}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark4}
                  {" "}
                </Text>
                <Text bold>
                  {id4}
                </Text>
                {" "}
                {title4}
                <Text color="error">
                  {"  "}
                  {note7}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta4}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text10}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text11}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text12}
              </Text>
              <Text wrap="wrap">
                {outcome4}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note8}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter4}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark5}
                  {" "}
                </Text>
                <Text bold>
                  {id5}
                </Text>
                {" "}
                {title5}
                <Text color="error">
                  {"  "}
                  {note9}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta5}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text13}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text14}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text15}
              </Text>
              <Text wrap="wrap">
                {outcome5}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note10}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter5}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark6}
                  {" "}
                </Text>
                <Text bold>
                  {id6}
                </Text>
                {" "}
                {title6}
                <Text color="error">
                  {"  "}
                  {note11}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta6}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text16}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text17}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text18}
              </Text>
              <Text wrap="wrap">
                {outcome6}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note12}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter6}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column" paddingLeft={0}>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name9}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done8}
              /
              {tasks8}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name10}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done9}
              /
              {tasks9}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold color="cyan" wrap="truncate-end">
              {name11}
              {` ${mark}`}
              <Text color="error">
                {" "}
                
              </Text>
            </Text>
            <Text dimColor>
              {" "}
              {done10}
              /
              {tasks10}
            </Text>
          </Box>
          <Box justifyContent="space-between">
            <Text bold wrap="truncate-end">
              {name12}
            </Text>
            <Text dimColor>
              {" "}
              {length5}
              /
              {length6}
            </Text>
          </Box>
          <Box paddingLeft={2}>
            <Text wrap="wrap" dimColor>
              {about3}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark7}
                  {" "}
                </Text>
                <Text bold>
                  {id7}
                </Text>
                {" "}
                {title7}
                <Text color="error">
                  {"  "}
                  {note13}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta7}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text19}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text20}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text21}
              </Text>
              <Text wrap="wrap">
                {outcome7}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note14}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter7}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark8}
                  {" "}
                </Text>
                <Text bold>
                  {id8}
                </Text>
                {" "}
                {title8}
                <Text color="error">
                  {"  "}
                  {note15}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta8}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text22}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text23}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text24}
              </Text>
              <Text wrap="wrap">
                {outcome8}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note16}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter8}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Box justifyContent="space-between">
              <Text wrap="truncate-end">
                <Text color="cyan">
                  {"  "}
                  {mark9}
                  {" "}
                </Text>
                <Text bold>
                  {id9}
                </Text>
                {" "}
                {title9}
                <Text color="error">
                  {"  "}
                  {note17}
                </Text>
              </Text>
              <Text dimColor>
                {" "}
                {spawnMeta9}
              </Text>
            </Box>
            <Box flexDirection="column" paddingLeft={6}>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text25}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text26}
              </Text>
              <Text wrap="truncate-end">
                <Text color="success">
                  
                  {" "}
                </Text>
                {text27}
              </Text>
              <Text wrap="wrap">
                {outcome9}
              </Text>
              <Text wrap="wrap" dimColor>
                {"gate: "}
                {note18}
              </Text>
              <Text dimColor wrap="truncate-end">
                {filter9}
              </Text>
            </Box>
          </Box>
        </Box>
        <Text dimColor>
          other agents
        </Text>
        <Box justifyContent="space-between">
          <Text wrap="truncate-end">
            <Text color="cyan">
              {"  "}
              {mark10}
              {" "}
            </Text>
            {description}
          </Text>
          <Text dimColor>
            {" "}
            {spawnMeta10}
          </Text>
        </Box>
        <Box justifyContent="space-between">
          <Text wrap="truncate-end">
            <Text color="cyan">
              {"  "}
              {mark11}
              {" "}
            </Text>
            {description2}
          </Text>
          <Text dimColor>
            {" "}
            {spawnMeta11}
          </Text>
        </Box>
        <Box justifyContent="space-between">
          <Text wrap="truncate-end">
            <Text color="cyan">
              {"  "}
              {mark12}
              {" "}
            </Text>
            {description3}
          </Text>
          <Text dimColor>
            {" "}
            {spawnMeta12}
          </Text>
        </Box>
        <Box marginTop={1}>
          <Text bold>
            <Text color="error">
              
              {" "}
            </Text>
            {length7}
            {" open"}
          </Text>
          <Text dimColor>
            {" · "}
            {length8}
            {" fixed"}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text color="success">
              {"  "}
              
              {" "}
            </Text>
            <Text>
              {glyph}
              {" "}
            </Text>
            <Button plain label={`${placeOf}`} />
            <Text wrap="truncate-end">
              {"  "}
              {summary}
            </Text>
          </Box>
          <Box paddingLeft={6}>
            <Text wrap="wrap">
              {summary2}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text color="success">
              {"  "}
              
              {" "}
            </Text>
            <Text>
              {glyph2}
              {" "}
            </Text>
            <Button plain label={`${placeOf}`} />
            <Text wrap="truncate-end">
              {"  "}
              {summary3}
            </Text>
          </Box>
          <Box paddingLeft={6}>
            <Text wrap="wrap">
              {summary4}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text color="success">
              {"  "}
              
              {" "}
            </Text>
            <Text>
              {glyph3}
              {" "}
            </Text>
            <Button plain label={`${placeOf}`} />
            <Text wrap="truncate-end">
              {"  "}
              {summary5}
            </Text>
          </Box>
          <Box paddingLeft={6}>
            <Text wrap="wrap">
              {summary6}
            </Text>
          </Box>
        </Box>
        <Text dimColor>
          ────────
        </Text>
        <Box columnGap={2}>
          <Button plain dimColor hotkey="b" label="list" />
          <Button plain dimColor hotkey="e" label="less" />
          <Button plain dimColor hotkey="g" label="open" />
          <Text dimColor>
            1-9 to prompt
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Ledger: added to the prompt.`)
    await $.ui.toast(`The ledger could not be loaded.`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

hooks/register.tsx lines 1012–1171 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    // What is drawn is narrower than the pane by the padding at each side.
    const columns = Math.max(30, (e.props.bodyColumns ?? e.viewport?.columns ?? 60) - 2 * PAD)
    const rule = '─'.repeat(columns)
    const all = await read($, runs)
    const openId = await read($, shown)
    const now = all.find(one => one.id === openId)
    const at = await $.clock.now()
    const current = (await read($, run))?.id ?? 0
    const isLive = (one: LedgerRun) =>
      one.doneAt === undefined && one.spawns.some(spawn => spawn.endedAt === undefined)
    // Reading the frame subscribes the drawing only while a subagent runs, so
    // an idle pane stays still.
    const mark = all.some(isLive) ? ([...SPINNER][(await read($, spin)) % SPINNER.length] ?? '') : ''

    // The list: every run of the project, those not done first.
    if (now === undefined) {
      const withDone = await read($, isAll)
      const rows = listed({ nextId: 0, current, runs: all }, withDone)
      const doneCount = all.filter(one => one.doneAt !== undefined).length
      const focused = await read($, cursor)
      const here = rows.some(one => one.id === focused) ? focused : (rows[0]?.id ?? 0)
      const picked = rows.find(one => one.id === here)
      const asking = await read($, confirming)

      return (
        <Box flexDirection="column" paddingX={PAD}>
          <Box justifyContent="space-between">
            <Text bold>
              <Text color="cyan">{ICON.tasks} </Text>Ledger
            </Text>
            <Text dimColor>
              {all.length - doneCount} open · {doneCount} done
            </Text>
          </Box>
          <Text dimColor>{rule}</Text>
          {rows.length === 0 && (
            <Text dimColor>{all.length === 0 ? 'Nothing planned yet.' : 'Every run is done.'}</Text>
          )}
          {rows.map((one, index) => {
            const isOver = one.doneAt !== undefined
            const failed = countsOf(one).failed
            const tone = isOver ? 'success' : failed > 0 ? 'error' : 'cyan'
            const glyph = isOver ? ICON.done : isLive(one) ? mark : failed > 0 ? ICON.failed : ICON.todo

            return (
              <Box justifyContent="space-between">
                <Box>
                  <Text color="cyan">{one.id === here ? '▸' : ' '}</Text>
                  <Text color={tone} dimColor={isOver}>
                    {glyph}{' '}
                  </Text>
                  <Button
                    key={`run-${one.id}`}
                    plain
                    {...(index < 9 ? { hotkey: String(index + 1) } : {})}
                    {...(one.id === here ? { autoFocus: true as const } : {})}
                    dimColor={isOver}
                    label={cut(one.goal === '' ? `Run ${one.id}` : one.goal, Math.max(10, columns - 34))}
                    onPress={async () => {
                      await update($, confirming, () => 0)
                      await update($, shown, () => one.id)
                    }}
                  />
                  {one.id === current ? <Text color="cyan"> ●</Text> : null}
                </Box>
                <Text dimColor>
                  {' '}
                  {runMarks(one)} · {ageOf(one.doneAt ?? one.startedAt, at)}
                </Text>
              </Box>
            )
          })}
          <Text dimColor>{rule}</Text>
          {asking !== 0 ? (
            <Box columnGap={2}>
              <Text color="warning">Clear run {asking} for good?</Text>
              <Button
                key="yes"
                plain
                hotkey="y"
                label="yes"
                onPress={async () => {
                  await changeBook($, book => cleared(book, asking))
                  await update($, confirming, () => 0)
                }}
              />
              <Button key="no" plain hotkey="n" label="no" onPress={() => update($, confirming, () => 0)} />
            </Box>
          ) : picked === undefined ? (
            <Button
              key="all"
              plain
              dimColor
              hotkey="a"
              label={withDone ? 'open only' : 'all'}
              onPress={() => update($, isAll, value => !value)}
            />
          ) : (
            <Box columnGap={2}>
              <Button
                key="done"
                plain
                dimColor
                hotkey="d"
                label={picked.isClosed === true ? 'reopen' : 'done'}
                onPress={async () => {
                  await changeBook($, (book, when) => closed(book, picked.id, picked.isClosed !== true, when))
                }}
              />
              <Button key="clear" plain dimColor hotkey="x" label="clear" onPress={() => update($, confirming, () => picked.id)} />
              <Button
                key="all"
                plain
                dimColor
                hotkey="a"
                label={withDone ? 'open only' : 'all'}
                onPress={() => update($, isAll, value => !value)}
              />
            </Box>
          )}
        </Box>
      )
    }

    // One run. Each task is a line: marks and numbers say how it stands, and
    // words are kept for what is wrong. Details add what each part is for,
    // what was done, and what is finished or fixed.
    const detailed = await read($, isDetailed)
    const counts = countsOf(now)
    const openFindings = now.findings.filter(one => one.status === 'open')
    const fixedFindings = now.findings.filter(one => one.status === 'fixed')
    const findings = [...openFindings, ...(detailed ? fixedFindings : [])]
    const lanes = lanesOf(now)
    // The finding "open" shows in lens: the one the focus is on, else the first.
    const focusedFinding = await read($, pointed)
    const target = findings.find(one => one.id === focusedFinding) ?? findings[0]
    const loose = now.spawns.filter(one => one.task === undefined && (detailed || one.endedAt === undefined))

    return (
      <Box flexDirection="column" paddingX={PAD}>
        <Box justifyContent="space-between">
          <Text bold wrap="truncate-end">
            <Text color="cyan">{ICON.tasks} </Text>
            {now.goal === '' ? `Run ${now.id}` : now.goal}
          </Text>
          <Text dimColor>
            {' '}
            {counts.done}/{counts.tasks}
            {counts.tokens > 0 ? ` · ${tokensText(counts.tokens)}` : ''}
          </Text>
        </Box>
        {now.doc === undefined ? null : (
          <Text dimColor wrap="truncate-start">
            {now.doc.path}
          </Text>
        )}
        <Text dimColor>{rule}</Text>
        {unitsOf(now).map((unit, index, units) => (
Licence text (MIT)
MIT License

Copyright (c) 2026 Kuang Tar Lim

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), Deny a tool call

What its code calls

writes filesdrives Claudetool callsremembers

What its code shows

Read from the source at commit 9ced3c149462 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.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.6 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.its repository's .claude-plugin/marketplace.json does not list it: no marketplace line to give; the page shows how to try the commit read
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 files, the prompt box, 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.adds command ledger, adds tool plan, adds tool task, adds tool finding, adds tool fixed, adds tool report
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: tool.call (Write, Edit), command.run (ledger) · shapes: prompt.compose · also: session.start, agent.spawn, turn.complete, ui.focus (+1) · timers: 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.files: a path computed at run time; the prompt box
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.files: a path computed at run time; 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.

Its repository's .claude-plugin/marketplace.json does not list it, so there is no marketplace line to give.

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/BuddyLim/claude-code-mod-ledger
git -C claude-code-mod-ledger checkout 9ced3c1494626d2b28af8f1c3e9a721e51c460b2
claude plugin validate claude-code-mod-ledger
claude --plugin-dir claude-code-mod-ledger

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 "buddylim-ledger" with its code and make me one like it

Search them from Claude: the MCP connector

Similar mods

More by Kuang Tar Lim

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/buddylim-ledger.svg)](https://modscode.com/claude-mods/mods/buddylim-ledger/)