modscode JA

modscode / Gallery / mokkan

mokkan

Cross-session reminders: /mokkan toggles a live pane with your TODOs, Reminders and Archived tabs, /mokkan <command> runs push, in, edit, ack, done and the rest at once, and the /mokkan:mokkan skill lets Claude do it for you.

Code you can checkTerminal + desktopPaneToastBoxButtonInputText

What it does

  • Draws a pane, toasts
  • Hooks classic.SessionStart, prompt.edit, session.start, ui.close and 1 more
  • Keeps its own state between turns
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • Handles errors

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like mokkan by Victor Benetatos (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/vicmpen-mokkan/
// 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: "mokkan" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const balance = '…'
    const name = '…'
    const length = '…'
    const glyph = '…'
    const n = '…'
    const time = '…'
    const line = '…'
    const time2 = '…'
    const time3 = '…'
    const label = '…'
    const hint = '…'
    const value = '…'
    const submit = '…'
    const line2 = '…'
    const line3 = '…'
    const url = '…'
    const flow = '…'
    const email = '…'
    const otp = '…'
    const masked = '…'
    const target = '…'
    const hotkey = '…'
    const verb = '…'
    return (
      <Box flexDirection="column">
        <Box>
          <Text bold>
            {" mokkan"}
          </Text>
          <Text color="red">
            {balance}
          </Text>
        </Box>
        <Text bold>
          {" Help"}
        </Text>
        <Text bold>
          {" Privacy policy updated"}
        </Text>
        <Box>
          <Text>
            {" "}
          </Text>
          <Box>
            <Text dimColor>
              {" │ "}
            </Text>
            <Button plain>
              {`${name} ${length}`}
            </Button>
          </Box>
          <Box>
            <Text dimColor>
              {" │ "}
            </Text>
            <Button plain>
              {`${name} ${length}`}
            </Button>
          </Box>
          <Box>
            <Text dimColor>
              {" │ "}
            </Text>
            <Button plain>
              {`${name} ${length}`}
            </Button>
          </Box>
        </Box>
        <Text dimColor>
          ────────
        </Text>
        <Box flexDirection="column">
          <Box flexDirection="column">
            <Text dimColor>
              {" Nothing archived yet."}
            </Text>
            <Text dimColor>
              {" d archives the selected row."}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box>
              <Text>
                {"▸ "}
              </Text>
              <Text>
                {`${glyph} `}
              </Text>
              <Text>
                {"        "}
              </Text>
              <Button plain hotkey={`${n}`} />
              <Text>
                {"        "}
              </Text>
              <Text color="red">
                {time}
              </Text>
            </Box>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box>
              <Text>
                {"▸ "}
              </Text>
              <Text>
                {`${glyph} `}
              </Text>
              <Text>
                {"        "}
              </Text>
              <Button plain hotkey={`${n}`} />
              <Text>
                {"        "}
              </Text>
              <Text color="red">
                {time2}
              </Text>
            </Box>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
          </Box>
          <Box flexDirection="column">
            <Box>
              <Text>
                {"▸ "}
              </Text>
              <Text>
                {`${glyph} `}
              </Text>
              <Text>
                {"        "}
              </Text>
              <Button plain hotkey={`${n}`} />
              <Text>
                {"        "}
              </Text>
              <Text color="red">
                {time3}
              </Text>
            </Box>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
            <Text dimColor>
              {`        ${line}`}
            </Text>
          </Box>
        </Box>
        <Box flexGrow={1} />
        <Box paddingLeft={1}>
          <Text wrap="wrap">
            {" "}
          </Text>
        </Box>
        <Box flexDirection="column" paddingLeft={1}>
          <Input autoFocus label={`${label}`} placeholder={`${hint}`} value={`${value}`} submitLabel={`${submit}`} />
          <Box gap={1}>
            <Button plain>
              cancel
            </Button>
            <Text dimColor>
              (Tab to it, then Enter)
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" paddingLeft={1}>
          <Box flexDirection="column">
            <Text wrap="wrap">
              {line}
            </Text>
            <Text wrap="wrap">
              {line2}
            </Text>
            <Text wrap="wrap">
              {line3}
            </Text>
            <Text wrap="wrap">
              {url}
            </Text>
            <Box>
              <Button hotkey="y" plain>
                continue
              </Button>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey="n" plain>
                cancel
              </Button>
            </Box>
          </Box>
          <Input autoFocus label={`${flow} email`} placeholder="you@example.com" value={`${email}`} submitLabel="next" />
          <Input autoFocus label="one-time code" placeholder={`the code emailed to ${email}`} value={`${otp}`} submitLabel="next" />
          <Input autoFocus label={`password for ${email}`} placeholder="hidden as you type" value={`${masked}`} submitLabel="log in" />
          <Box gap={1}>
            <Button plain>
              cancel
            </Button>
            <Text dimColor>
              (Tab to it, then Enter)
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Text color="yellow">
            {` log out ${target}?`}
          </Text>
          <Box>
            <Text>
              {" "}
            </Text>
            <Button hotkey="y" plain>
              log out
            </Button>
            <Text dimColor>
              {" · "}
            </Text>
            <Button hotkey="n" plain>
              stay
            </Button>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box>
            <Text>
              {" "}
            </Text>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
          </Box>
          <Box>
            <Text>
              {" "}
            </Text>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
          </Box>
          <Box>
            <Text>
              {" "}
            </Text>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
            <Box>
              <Text dimColor>
                {" · "}
              </Text>
              <Button hotkey={`${hotkey}`} plain role="dismiss" />
            </Box>
          </Box>
        </Box>
        <Text color="yellow">
          {` ${verb}`}
        </Text>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const text = '…'
    await $.ui.toast(`mokkan: due · ${text}`)
    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.

claude-plugin/hooks/pane.tsx lines 452–611 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    if (e.surface === 'terminal') {
      const holds = e.props.isFocused !== false
      if (heldKeys && !holds) lostAt = await $.clock.now()
      heldKeys = holds
    }
    const t = $.ui.resolve(e)
    const { Box, Text, Button } = t
    const Input = e.surface !== 'mobile' && 'Input' in t ? t.Input : null // mobile has no Input
    const [v, m, sel, tb, msg, verb, sync, helping, gated, now] = await Promise.all([
      read($, view), read($, mode), read($, selected), read($, tab), read($, message), read($, busy), read($, syncing), read($, help), read($, privacy), $.clock.now(),
    ])
    // The terminal gets the pane's own border, two columns of the body; the remote surfaces draw their own focus.
    const framed = e.surface === 'terminal'
    const width = (e.props.bodyColumns ?? e.viewport?.columns ?? COLUMNS) - (framed ? 2 : 0)
    const docked = e.props.placement === 'dock'
    const bodyRows = e.props.scroll?.bodyRows ?? e.viewport?.rows ?? 24
    const focused = e.surface !== 'terminal' || e.props.isFocused !== false
    const loggedOut = v.failure?.kind === 'loggedOut'
    const offline = v.failure?.kind === 'offline'
    const list = rowsOf(v, tb)
    const current = list.find(r => r.id === sel)

    /** Every key goes through here: dropped while a CLI call runs; it clears the message said before it. */
    const go = <A extends unknown[]>(f: (...a: A) => unknown) => (...a: A) => {
      if (running) return
      const before = said
      void update($, message, was => (was && was.id <= before ? null : was))
      return f(...a)
    }
    const needOne = () => say($, 'select a row first (its number or ↑↓)', 'note')
    const cancel = () => { secret = ''; return update($, mode, () => NORMAL) }
    const switchView = async (to?: MokkanTab) => {
      await update($, tab, was => to ?? after(was))
      await update($, selected, () => null)
    }
    // The ring follows a click or a digit too, so ↑/↓ and ←/→ walk on from the selected row.
    const select = async (r: MokkanReminder) => {
      await update($, selected, () => r.id)
      void reveal($, r.id)
      void $.ui.focus({ requestId: PANE, key: `row-${r.id}` }).catch(() => {})
    }
    const askDone = (r: MokkanReminder) =>
      update($, mode, (): MokkanMode => ({ kind: 'confirm', action: r.state === 'done' ? 'undone' : 'done', target: r.text, targetId: r.id }))
    /** A press on the row already selected (Enter under the focus, a click, its digit) asks to finish it, or reopen it. */
    const press = (r: MokkanReminder) => (r.id === sel ? askDone(r) : select(r))
    /** A digit key selects its row at once; within a second of the one before, the two make rows 10–99. */
    const typed = async (d: number) => {
      const at = await $.clock.now()
      const was = pending
      pending = null
      const two = was && at - was.at < 1000 ? list[was.digit * 10 + d - 1] : undefined
      if (two) return select(two)
      if (d === 0) return say($, 'type 1 then 0 for row 10', 'note')
      const r = list[d - 1]
      if (!r) return
      if (list.length < d * 10) return press(r)
      const mine = pending = { digit: d, at }
      // The selected row's own digit asks only once no second digit follows it.
      if (r.id === sel) $.clock.after(1000, async () => {
        if (pending !== mine || running) return
        pending = null
        const [still, md] = await Promise.all([read($, selected), read($, mode)])
        if (still === r.id && md.kind === 'normal') await askDone(r)
      })
      return select(r)
    }
    const toggleDone = (id: string, text: string, reopen: boolean, first?: () => Promise<unknown>) => reopen
      ? act($, 'reopening…', ['undone', id], `reopened · ${text}`, first)
      : act($, 'archiving…', ['done', id], `archived · ${text}`, first)
    const field = async (purpose: 'push' | 'in' | 'edit' | 'time' | 'feedback') => {
      const needsOne = purpose === 'edit' || purpose === 'time'
      if (needsOne && (!current || current.state === 'done')) return needOne()
      const next: MokkanMode = { kind: 'input', purpose, targetId: current?.id, value: purpose === 'edit' ? current?.text ?? '' : '' }
      await update($, mode, () => next)
      void $.ui.focus({ requestId: PANE, key: 'field' }).catch(() => {})
    }
    const confirm = async (action: 'pop' | 'dequeue' | 'logout') => {
      if (action === 'logout') {
        const r = await work($, 'checking account…', () => run($, ['status']))
        if (r === undefined) return
        const email = r.ok ? json<{ me?: { email?: string } }>(r.out)?.me?.email : undefined
        return update($, mode, (): MokkanMode => ({ kind: 'confirm', action, target: email ?? '' }))
      }
      const takes = v.reminders.filter(r => ACTIVE.has(r.state))
      const target = action === 'pop' ? takes[0] : takes[takes.length - 1]
      if (!target) return say($, 'the stack is empty', 'note')
      return update($, mode, (): MokkanMode => ({ kind: 'confirm', action, target: target.text }))
    }
    // Registration shows the policy's summary first, as `mokkan register` does in a terminal.
    const startAuth = async (flow: 'login' | 'register') => {
      secret = ''
      const p = flow === 'register' ? await work($, 'fetching the privacy policy…', () => policy($)) : null
      if (flow === 'register' && !p) return
      await update($, mode, (): MokkanMode => ({ kind: 'auth', flow, step: p ? 'policy' : 'email', email: '', otp: '', masked: '', policy: p ?? null }))
      if (!p) void $.ui.focus({ requestId: PANE, key: 'auth' }).catch(() => {})
    }
    /** y on the summary: on to the email, or back to the password when a changed policy was shown again after the code. */
    const continueAuth = async () => {
      await update($, mode, (was): MokkanMode => (was.kind === 'auth' ? { ...was, step: was.otp ? 'password' : 'email' } : was))
      void $.ui.focus({ requestId: PANE, key: 'auth' }).catch(() => {})
    }
    const accept = async (p: MokkanPolicy) => {
      const accepted = await work($, 'accepting…', async () => {
        const r = await run($, ['accept', '--yes', '--version', p.version])
        // 4: the policy changed while it was shown; run has shown the new one.
        if (r.code === PRIVACY_REQUIRED) return false
        if (!r.ok) {
          await say($, firstLine(r.out) || 'failed', 'error')
          return false
        }
        await update($, privacy, () => null)
        await say($, 'privacy policy accepted')
        return true
      })
      if (accepted) await refresh($)
    }

    const toggleHelp = () => update($, help, was => !was)
    // As `mokkan ui`'s b: the CLI opens the checkout itself, and only a Stripe address.
    const buy = () => work($, 'opening checkout…', async () => {
      const r = await run($, ['buy'])
      if (r.code === PRIVACY_REQUIRED) return
      if (!r.ok) return say($, firstLine(r.out) || 'failed', 'error')
      await say($, json<{ opened?: boolean }>(r.out)?.opened === true
        ? 'Opened Stripe Checkout in your browser; the balance updates after payment.'
        : 'Could not open a browser here. Run: mokkan buy --no-open (prints the link).')
    })
    const keys: Record<string, Action> = gated
      ? {
          accept: { label: 'accept', hotkey: 'y', run: () => accept(gated) },
          close: { label: 'close', hotkey: 'n', run: () => $.ui.close({ id: PANE }) },
        }
      : helping
      ? {
          help: { label: 'back', hotkey: 'h', run: toggleHelp },
          close: { label: 'close', hotkey: 'q', run: () => $.ui.close({ id: PANE }) },
        }
      : loggedOut
      ? {
          login: { label: 'log in', hotkey: 'l', needsField: true, run: () => startAuth('login') },
          register: { label: 'register', hotkey: 'r', needsField: true, run: () => startAuth('register') },
          refresh: { label: 'sync', hotkey: 's', run: () => refresh($) },
          help: { label: 'help', hotkey: 'h', run: toggleHelp },
          close: { label: 'close', hotkey: 'q', run: () => $.ui.close({ id: PANE }) },
        }
      // Each key is its label's first letter; a line per kind: add, the selected row, the stack, the rest.
      : {
          push: { label: 'todo', hotkey: 't', needsField: true, run: () => field('push') },
          in: { label: 'reminder', hotkey: 'r', needsField: true, run: () => field('in') },
          edit: { label: 'edit', hotkey: 'e', needsField: true, group: true, run: () => field('edit') },
          time: { label: 'when', hotkey: 'w', needsField: true, run: () => field('time') },
          done: { label: tb === 'archived' ? 'reopen' : 'archive', hotkey: 'd', run: () => (current ? toggleDone(current.id, current.text, current.state === 'done') : needOne()) },
          ack: { label: 'ack', hotkey: 'a', run: () => (current && current.state !== 'done' ? act($, 'acking…', ['ack', current.id], `acked · ${current.text}`) : needOne()) },
          // Pop and dequeue are off for now.
          // pop: { label: 'pop top', hotkey: 'p', group: true, run: () => confirm('pop') },
          // dequeue: { label: 'pop oldest', hotkey: 'o', run: () => confirm('dequeue') },
          view: { label: `view ${label(after(tb)).toLowerCase()}`, hotkey: 'v', group: true, run: () => switchView() },
          refresh: { label: 'sync', hotkey: 's', run: () => refresh($) },
          // The checkout opens on the machine running Claude Code: of no use to someone on a phone.
Licence text (MIT)
MIT License

Copyright (c) 2026 Victor Benetatos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

What its code calls

runs programsreads filesremembers

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 2e6914fc76be on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.claude-plugin/hooks/pane.tsx
ParsesEvery file parses as TypeScript or JavaScript.1 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.claude-plugin/hooks/pane.tsx:83 a program named at run time; claude-plugin/hooks/pane.tsx:113 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add vicmpen/mokkan
/plugin install mokkan@mokkan

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

Search them from Claude: the MCP connector

Similar designs