modscode JA

modscode / Gallery / stash

stash

dima's command center above the prompt, one folded row with three features: asks (every live session's open ⏳ asks, copy all per thread), afk (one switch every session obeys) and holds (no two sessions write the same file)

Code you can checkTerminal + desktopPaneBandBoxButtonText

What it does

  • Draws a pane, a band above the prompt
  • Adds /board
  • Watches Bash calls and can refuse them
  • Hooks classic.Stop, prompt.submit, session.end, session.measure and 3 more
  • Keeps its own state between turns

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 stash by dvakatsiienko (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/dvakatsiienko-stash/
// 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: "fleet board" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Text } = $.ui.resolve(e)
    return (
      <Text dimColor>
        the session registry is unreadable
      </Text>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    const n = '…'
    const length = '…'
    const sid = '…'
    const name = '…'
    const command = '…'
    const target = '…'
    const key = '…'
    const length2 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" justifyContent="space-between" marginBottom={0.25}>
          <Box flexDirection="row" gap={1}>
            <Text bold color="#d97757">
              {"⏳ "}
              {`${n}${length}`}
              {" open"}
            </Text>
            counts
            holds
          </Box>
          <Box flexDirection="row" gap={1}>
            {`copy:${sid}`}
            hot
            afk
            board
            asks-toggle
          </Box>
        </Box>
        <Box flexDirection="row" gap={1} justifyContent="space-between">
          <Text wrap="truncate-end">
            {`🛡️ ${name} — ${command} → ran on dima-ok: ${target}`}
          </Text>
          {`dismiss:${key}`}
        </Box>
        <Box flexDirection="row" gap={1} justifyContent="space-between">
          <Text wrap="truncate-end">
            {`🛡️ ${name} — ${command} → ran on dima-ok: ${target}`}
          </Text>
          {`dismiss:${key}`}
        </Box>
        <Box flexDirection="row" gap={1} justifyContent="space-between">
          <Text wrap="truncate-end">
            {`🛡️ ${name} — ${command} → ran on dima-ok: ${target}`}
          </Text>
          {`dismiss:${key}`}
        </Box>
        <Text dimColor>
          +
          {length}
          {" more guard lines"}
        </Text>
        <Text dimColor>
          +
          {length2}
          {" more"}
        </Text>
        {await next(e)}
      </Box>
    )
  })
}

The mod's own code

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

home/.claude/plugin-x/mods/stash/hooks/register.tsx lines 825–943 · Pane
    on('ui.render', { component: 'Pane', requestId: BOARD }, async ($, e) => {
        const ui = $.ui.resolve(e);
        const { Box, Text, Button, Link } = ui;
        const now = await $.clock.now();
        const me = await $.session.id().catch(() => selfId);
        const list = await members($).catch(() => null);
        if (!list)
            return <Text dimColor>the session registry is unreadable</Text>;
        if (!list.length) return <Text dimColor>no live sessions</Text>;
        const row = (m: Member, i: number) => {
            const state = stateWord(m.status);
            const isBusy = state === 'busy';
            const ticket = ticketOf(m.name);
            const door = m.door;
            const name = m.sid === me ? `${m.name} (here)` : m.name;
            const line = m.wait && `🔭 ${m.wait}`;
            return (
                <Box
                    flexDirection='column'
                    key={`m:${m.sid}`}
                    marginTop={i > 0 ? 1 : 0}>
                    <Box
                        flexDirection='row'
                        gap={1}
                        justifyContent='space-between'>
                        {/* the name side gives way, clipped, so a long name never pushes the fact columns out of line */}
                        <Box
                            flexDirection='row'
                            flexGrow={1}
                            flexShrink={1}
                            gap={1}
                            minWidth={0}
                            overflow='hidden'>
                            {/* the whole name is the control; the coordinator's name stays bold text, since a Button label takes no weight */}
                            {door && !isCoordinator(m.name) ? (
                                <Button
                                    key={`door:${m.sid}`}
                                    onPress={(p) =>
                                        void pressDoor($, door, p.surface)
                                    }
                                    plain>
                                    {`${name} ${doorGlyph(door)}`}
                                </Button>
                            ) : (
                                <Text
                                    bold={isCoordinator(m.name)}
                                    wrap='truncate-end'>
                                    {name}
                                </Text>
                            )}
                            {door && isCoordinator(m.name) ? (
                                <Button
                                    key={`door:${m.sid}`}
                                    onPress={(p) =>
                                        void pressDoor($, door, p.surface)
                                    }
                                    plain>
                                    {doorGlyph(door)}
                                </Button>
                            ) : null}
                            {m.offPattern ? (
                                <Text color={ACCENT}>⚠</Text>
                            ) : null}
                        </Box>
                        {/* one fixed-width, right-aligned cell per fact, drawn empty when it has no reading, so the columns line up across rows (dima, 2026-10-05) */}
                        <Box
                            flexDirection='row'
                            flexShrink={0}
                            gap={e.surface === 'desktop' ? 0.5 : 1}>
                            {/* no hover card in the pane: an absolute card in a narrow row wraps and clips (dima, 2026-10-05) */}
                            <Box
                                justifyContent='flex-end'
                                width={COLUMNS.ticket}>
                                {ticket ? (
                                    // never wraps: `FRM-306` broke at its hyphen in the desktop font
                                    <Text dimColor wrap='truncate-end'>
                                        <Link
                                            href={`https://linear.app/x-com/issue/${ticket}`}>
                                            {ticket}
                                        </Link>
                                    </Text>
                                ) : null}
                            </Box>
                            <Box
                                justifyContent='flex-end'
                                width={COLUMNS.context}>
                                {m.context === undefined ? null : (
                                    <Text dimColor>ctx {m.context}%</Text>
                                )}
                            </Box>
                            <Box
                                justifyContent='flex-end'
                                width={COLUMNS.state}>
                                <Text
                                    bold={isBusy}
                                    color={isBusy ? ACCENT : undefined}
                                    dimColor={state === 'idle'}
                                    wrap='truncate-end'>
                                    {m.statusSince
                                        ? `${state} ${span(now - m.statusSince)}`
                                        : state}
                                </Text>
                            </Box>
                            {/* the asks close the row, always drawn: `⏳ 0` dimmed when none (dima, 2026-10-05) */}
                            <Box justifyContent='flex-end' width={COLUMNS.asks}>
                                <Text
                                    color={m.asks ? ACCENT : undefined}
                                    dimColor={!m.asks}>
                                    ⏳ {m.asks}
                                </Text>
                            </Box>
                        </Box>
                    </Box>
                    {line ? <Text wrap='truncate-end'>{line}</Text> : null}
                </Box>
            );
        };
        return <Box flexDirection='column'>{list.map(row)}</Box>;
    });
home/.claude/plugin-x/mods/stash/hooks/register.tsx lines 991–1150 · Band
    on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
        if (e.surface !== 'terminal' && e.surface !== 'desktop') return next(e);
        const groups = Object.entries(entries).sort(([a], [b]) =>
            a === selfId ? -1 : b === selfId ? 1 : 0,
        );
        const total = groups.reduce((n, [, v]) => n + v.asks.length, 0);
        const ui = $.ui.resolve(e);
        const { Box, Text, Button } = ui;
        const surface = e.surface;
        // a thread reads its session name; the repo joins only when two sessions share one
        const title = (v: Entry) => {
            const base = v.name ?? v.label;
            const shared = groups.filter(
                ([, o]) => (o.name ?? o.label) === base,
            ).length;
            return shared > 1 && v.name ? `${base} · ${v.label}` : base;
        };
        // the head stays short; the per-session breakdown lives in its hover card
        const here = entries[selfId ?? '']?.asks.length ?? 0;
        const counts = `here ${here}, parallel ${total - here}`;
        const breakdown = groups
            .map(
                ([sid, v]) =>
                    `${sid === selfId ? `${title(v)} (here)` : title(v)} ${v.asks.length}`,
            )
            .join(', ');
        const toggle = () => {
            open = !open;
            void $.state.set(OPEN, open).catch(() => undefined);
            $.ui.invalidate('ui.render');
        };
        const flipAfk = async () => {
            afk = !afk;
            await $.store.set(AFK_KEY, { at: await $.clock.now(), on: afk });
            $.ui.invalidate('ui.render');
        };
        const flipHot = async () => {
            const now = await $.clock.now();
            const reset = fiveHour?.resetsAt;
            hot = hot
                ? undefined
                : {
                      since: now,
                      until: reset && reset > now ? reset : undefined,
                  };
            await saveHot($);
            await armHot($);
            $.ui.invalidate('ui.render');
        };
        const tip = (
            key: string,
            words: string,
            control: RenderElement,
            place: { left: number } | { right: number },
            press?: { hotkey: string; onPress: () => void },
        ) => hoverTip(ui, key, words, control, place, press);
        const boardOpen = await isBoardOpen($);
        const flipBoard = async () => {
            if (await isBoardOpen($)) await $.ui.close({ id: BOARD });
            else await openBoard($);
            $.ui.invalidate('ui.render');
        };
        // a terminal draws a chromed Button as `[ label ]`
        const leftOf = (label: string, chrome: boolean) => ({
            right: [...label].length + (chrome ? 4 : 0) + 1,
        });
        // only the head's copy takes `c`: two Buttons on one key clash, and the later wins
        const copyButton = (sid: string, asks: string[], hotkey?: string) => {
            const copy = () =>
                void $.ui.copy({
                    surface,
                    text: [
                        'lane',
                        ...asks.map((a, i) => `${i + 1}. ${a}`),
                    ].join('\n'),
                });
            return tip(
                `copy:${sid}`,
                "copy this thread's asks",
                <Button key={`copy:${sid}`} onPress={copy} variant='secondary'>
                    📋
                </Button>,
                leftOf('📋', true),
                hotkey ? { hotkey, onPress: copy } : undefined,
            );
        };
        const [first] = groups;
        const many = groups.length > 1;
        // other sessions' holds in this repo; ⚠ when a session was refused one of this session's files
        const chipText = [
            holds.warned ? '⚠' : '',
            holds.others ? `🔒 ${holds.others}` : '',
        ]
            .filter(Boolean)
            .join(' ');
        const chipName = [
            holds.warned
                ? 'a session was refused a file this session holds'
                : '',
            holds.others
                ? `${holds.others} ${holds.others === 1 ? 'file' : 'files'} held by other sessions`
                : '',
        ]
            .filter(Boolean)
            .join('; ');
        const holdsChip = chipText
            ? tip(
                  'holds',
                  chipName,
                  <Text color={holds.warned ? ACCENT : undefined}>
                      {chipText}
                  </Text>,
                  { left: [...chipText].length + 1 },
              )
            : null;
        // icons only; each card says what a press does (dima)
        const hotLabel = '🔥';
        // one icon; the accent background says afk is on (dima)
        const afkLabel = '💨';
        const foldLabel = open ? '📂' : '📁';

        // ~4px under the head on desktop when the asks show; a terminal cell is a whole line, so none there
        const head = (
            <Box
                flexDirection='row'
                justifyContent='space-between'
                marginBottom={
                    open && total && surface === 'desktop' ? 0.25 : 0
                }>
                {first ? (
                    <Box flexDirection='row' gap={1}>
                        <Text bold color={ACCENT}>
                            ⏳ {total} open
                        </Text>
                        {many
                            ? tip(
                                  'counts',
                                  breakdown,
                                  <Text dimColor>{counts}</Text>,
                                  { left: counts.length + 1 },
                              )
                            : null}
                        {holdsChip}
                    </Box>
                ) : (
                    <Box flexDirection='row' gap={1}>
                        <Text dimColor>no open asks</Text>
                        {holdsChip}
                    </Box>
                )}
                <Box flexDirection='row' gap={1}>
                    {first ? copyButton(first[0], first[1].asks, 'c') : null}
                    {tip(
                        'hot',
                        hot
                            ? "stop keeping this session's cache hot"
                            : "keep this session's cache hot: ping every 50 min",
                        <Button
                            key='hot'
                            onPress={() => void flipHot()}
Licence text (MIT)
MIT License

Copyright (c) 2026 Dima Vakatsiienko

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 filesenv varsdrives Claudetool 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 a3a6862b7eda 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.home/.claude/plugin-x/mods/stash/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, with its own branch for the desktop
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 install line to give
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).home/.claude/plugin-x/mods/stash/hooks/register.tsx:205 ps (not on Windows); home/.claude/plugin-x/mods/stash/hooks/register.tsx:580 ps (not on Windows); home/.claude/plugin-x/mods/stash/hooks/register.tsx:654 open (not on Windows)
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.home/.claude/plugin-x/mods/stash/hooks/register.tsx:161 sh (a shell or interpreter)
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the 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's .claude-plugin/marketplace.json does not list it, so there is no install line to give. Read it as code, or follow its author's README.

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 "dvakatsiienko-stash" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs