modscode JA

modscode / Gallery / korus-inbox

korus-inbox

Gathers what only the owner can act on across sessions: open questions, refusals that hand the act to the person, and owner_action signals, each with its recommended action, in an /inbox pane and an inbox N band

Code you can checkTerminal + desktopPaneBandStatus lineToastBoxButtonText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Watches tool calls and can refuse them
  • Hooks classic.PreToolUse, classic.SessionStart, classic.UserPromptSubmit, session.end and 1 more
  • Keeps its own state between turns
  • Starts processes

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors

Code to start from

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

Starter (register.tsx)

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

// Drawn like korus-inbox by MEFORORG (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/mefororg-korus-inbox/
// 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 band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Button } = $.ui.resolve(e)
    const count = '…'
    return (
      <Box flexDirection="column">
        <Button label={`inbox ${count}`} hotkey="i" />
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Owner inbox" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const count = '…'
    const moreRemote = '…'
    const length = '…'
    const note = '…'
    const headOf = '…'
    const how = '…'
    const how2 = '…'
    const how3 = '…'
    return (
      <Box flexDirection="column">
        <Text bold>
          {`${count} waiting on the owner`}
        </Text>
        <Text dimColor wrap="wrap">
          {`${moreRemote} more waiting from other sessions are not shown. /inbox shows the newest ${length}.`}
        </Text>
        <Text color="yellow">
          {note}
        </Text>
        <Text dimColor>
          Nothing waits on the owner.
        </Text>
        <Box flexDirection="column" marginTop={1}>
          <Button label={`Hide done (${length})`} />
          <Box flexDirection="column" marginTop={1}>
            <Text dimColor wrap="wrap">
              {`Done: ${headOf}`}
            </Text>
            <Text dimColor wrap="wrap">
              {how}
            </Text>
            <Box>
              <Button label="Dismiss" />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Text dimColor wrap="wrap">
              {`Done: ${headOf}`}
            </Text>
            <Text dimColor wrap="wrap">
              {how2}
            </Text>
            <Box>
              <Button label="Dismiss" />
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Text dimColor wrap="wrap">
              {`Done: ${headOf}`}
            </Text>
            <Text dimColor wrap="wrap">
              {how3}
            </Text>
            <Box>
              <Button label="Dismiss" />
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Go to session: that session has gone quiet, so its app window may be closed.`)
    await $.ui.toast(`Go to session: that session names no app instance on this machine.`)
    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/korus-inbox/hooks/register.tsx lines 1731–1755 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const below = await next(e)
    const { count } = await waiting($)
    if (count === 0 || e.props.hasSurvey) return below
    const { Box, Button } = $.ui.resolve(e)
    const band = (
      <Button
        key="korus-inbox:open"
        label={`inbox ${count}`}
        hotkey="i"
        onPress={() => {
          void openInbox($).catch(() => $.ui.toast('Owner inbox did not open.'))
        }}
      />
    )
    // The engine draws nothing of its own here, so an engine element means
    // no other hook drew a band.
    if (below.type === 'engine') return band
    return (
      <Box flexDirection="column">
        {band}
        {below}
      </Box>
    )
  })
plugins/korus-inbox/hooks/register.tsx lines 1919–2078 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const now = await $.clock.now()
    const mine = await read($, own)
    const theirs = await read($, remote)
    const note = await read($, folderNote)
    const opened = new Set(await read($, expanded))
    const myLabel = await shownName($)
    const list = waitingOf(mine, theirs)
    const done = mine.filter(isDone)

    // Rows the card draws itself, each cut at the edge and never wrapped, so
    // a row starts only where these rows say it does.
    const drawRows = (prefix: string, lines: readonly string[]) =>
      lines.map((line, index) => (
        <Text key={`${prefix}:${index}`} wrap="truncate-end">
          {line}
        </Text>
      ))

    const copyButton = (key: string, text: string | undefined) =>
      text !== undefined && text !== '' ? (
        <Button
          key={key}
          label="Copy"
          onPress={async press => {
            const copied = await $.ui.copy({ text, surface: press.surface })
            $.ui.toast(copied.isCopied ? 'Copied.' : `Not copied: ${copied.reason}`)
          }}
        />
      ) : null

    // The lines every card shares, in order: Do this, Needs you for, Why, For
    // you, From, Folder. The headline is drawn by the caller.
    const commonLines = (card: Card, from: string, where: string, folderText: string | undefined, keyBase: string) => {
      const needs = needsOf(card)
      const why = whyLineOf(card)
      return (
        <Box key={`${keyBase}:common`} flexDirection="column">
          <Text color="cyan" wrap="wrap">{`Do this: ${doThisOf(card, where)}`}</Text>
          <Text dimColor wrap="wrap">{`Needs you for: ${needs.needs} | confidence: ${needs.confidence}`}</Text>
          {why !== undefined && why !== '' && <Text wrap="wrap">{`Why: ${why}`}</Text>}
          {card.kind === 'refused' && card.ask !== undefined && <Text wrap="wrap">{`For you: ${card.ask}`}</Text>}
          {card.kind === 'question' && <Text wrap="wrap">{questionText(card.questions)}</Text>}
          <Text dimColor wrap="wrap">{`From: ${from}`}</Text>
          {folderText !== undefined && <Text dimColor wrap="wrap">{`Folder: ${folderText}`}</Text>}
        </Box>
      )
    }

    const detailsLines = (card: Card, keyBase: string) => (
      <Box key={`${keyBase}:details`} flexDirection="column">
        {card.command !== undefined && <Text dimColor>Full command:</Text>}
        {card.command !== undefined && <Text wrap="wrap">{clean(card.command, MAX_COMMAND)}</Text>}
        {card.kind === 'refused' && <Text dimColor>Full refusal:</Text>}
        {card.kind === 'refused' && <Text wrap="wrap">{card.detail ?? card.refusal ?? ''}</Text>}
        <Text dimColor wrap="wrap">{`Review: ${needsOf(card).review}`}</Text>
      </Box>
    )

    const partNote = (card: Card, canRun: boolean) => {
      if (card.kind !== 'refused' || card.command === undefined) return null
      const part = card.part?.part
      if (part === undefined) {
        return <Text dimColor wrap="wrap">Copy takes the whole command, not the blocked part alone.</Text>
      }
      if (part === card.command) return null
      return (
        <Text dimColor wrap="wrap">
          {canRun
            ? 'Copy and Run use only the blocked part above, not the whole line.'
            : 'Copy takes only the blocked part above, not the whole line.'}
        </Text>
      )
    }

    // Every Button key names its entry, never its row: a row that moves
    // between the draw and the press cannot carry a press to another entry.
    // Own keys are minted UUIDs; remote keys are checked to a safe alphabet.
    const ownCard = (entry: InboxEntry) => {
      const card = cardOf(entry)
      const where = entry.cwd !== undefined && entry.cwd !== '' ? entry.cwd : '(unknown)'
      const from = `${entry.agentId !== undefined ? 'a subagent of this session' : 'this session'}, ${age(now - entry.createdAt)} ago`
      const run = entry.run
      const isArmed = entry.armedAt !== undefined && now - entry.armedAt < ARM_MS
      const text = runText(entry, card.part)
      const textBlock = entry.kind === 'question' ? undefined : runBlock(entry, card.part)
      // A pane too narrow for a whole row would cut it short, so it offers
      // Copy only; the claim needs a drawn Run now, so it cannot run there.
      const block =
        entry.kind !== 'question' && textBlock === undefined && e.props.bodyColumns < RUN_COLUMNS
          ? `Copy only here: the pane is ${e.props.bodyColumns} columns wide, and Run needs ${RUN_COLUMNS} so that no row is cut short.`
          : textBlock
      const canRun = entry.kind !== 'question' && block === undefined && text !== undefined && run?.status !== 'running'
      const tailHead = run?.status === 'failed' ? 'error: ' : 'out: '
      const isOpen = opened.has(`details:${entry.id}`)
      return (
        <Box key={`own:${entry.id}`} flexDirection="column" marginTop={1}>
          {entry.kind === 'refused' && canRun && text !== undefined ? (
            <Box flexDirection="column">{drawRows(`head:${entry.id}`, labelledRows('Blocked: ', text))}</Box>
          ) : (
            <Text bold wrap="wrap">
              {headOf(card)}
            </Text>
          )}
          {commonLines(card, from, entry.kind === 'question' ? `${myLabel} (this session)` : 'this session', entry.kind === 'question' ? undefined : where, `own:${entry.id}`)}
          {entry.kind === 'signal' && entry.command !== undefined && canRun && (
            <Box flexDirection="column">{drawRows(`cmd:${entry.id}`, labelledRows('Command: ', entry.command))}</Box>
          )}
          {entry.kind === 'signal' && entry.command === undefined && entry.withheld !== undefined && (
            <Text dimColor wrap="wrap">{`(${entry.withheld})`}</Text>
          )}
          {partNote(card, canRun)}
          {run !== undefined && (
            <Box flexDirection="column">
              <Text wrap="wrap">
                {run.status === 'running'
                  ? 'running:'
                  : run.status === 'done'
                    ? `ran, exit ${run.exitCode ?? '?'}:`
                    : 'could not run:'}
              </Text>
              {run.argv !== undefined ? (
                <Box flexDirection="column">
                  {drawRows(`rfolder:${entry.id}`, labelledRows('folder: ', where))}
                  {drawRows(`rargv:${entry.id}`, argvRows(run.argv))}
                </Box>
              ) : (
                <Text dimColor>argv: none, nothing ran</Text>
              )}
              {/* The command writes its own output, so every line of it is
                  marked and cut, and none can draw a row of the views. */}
              {run.tail !== undefined && run.tail !== '' && (
                <Box flexDirection="column">
                  {run.tail.split('\n').map((line, index) => (
                    <Text key={`tail:${entry.id}:${index}`} dimColor wrap="truncate-end">
                      {`${tailHead}${line}`}
                    </Text>
                  ))}
                </Box>
              )}
            </Box>
          )}
          {isArmed && canRun && (
            <Box flexDirection="column">
              <Text color="yellow" wrap="wrap">
                {entry.armedArgv !== undefined
                  ? 'Run now runs this:'
                  : `Run now runs nothing: ${entry.armedError ?? 'no shell was found'}`}
              </Text>
              {entry.armedArgv !== undefined && (
                <Box flexDirection="column">
                  {drawRows(`folder:${entry.id}`, labelledRows('folder: ', where))}
                  {drawRows(`argv:${entry.id}`, argvRows(entry.armedArgv))}
                </Box>
              )}
              <Text dimColor wrap="wrap">
                {`Run now ignores a press within ${ARM_GAP_MS} ms of the last press, so one double press cannot run it.`}
              </Text>
            </Box>
Licence text (MIT)
MIT License

Copyright (c) 2026 KORUS contributors

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 programswrites filesenv varstool callsremembers

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 6d1275193839 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.plugins/korus-inbox/hooks/register.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.plugins/korus-inbox/hooks/register.tsx:600 a program named at run time; plugins/korus-inbox/hooks/register.tsx:650 a program named at run time; plugins/korus-inbox/hooks/register.tsx:1263 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 MEFORORG/korus
/plugin install korus-inbox@korus

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

Search them from Claude: the MCP connector

Similar designs