modscode JA

modscode / Gallery / dock

dock

Container stacks per worktree: a pixel-art pane of every compose stack with its memory and worktree, orphans whose worktree is gone, and a guard that asks before booting another stack when memory headroom is low.

Code you can checkTerminal + desktopPaneToastBoxButtonText

What it does

  • Draws a pane, toasts
  • Adds /dock
  • Watches tool calls and can refuse them
  • Hooks session.start, ui.close
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Handles errors
  • Writes no files

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 dock by Pourya (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/pourya7-dock/
// 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: "DOCK" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const text4 = '…'
    const text5 = '…'
    const text6 = '…'
    const text7 = '…'
    const text8 = '…'
    const text9 = '…'
    const text10 = '…'
    const text11 = '…'
    const text12 = '…'
    const text13 = '…'
    const text14 = '…'
    const text15 = '…'
    const text16 = '…'
    const text17 = '…'
    const text18 = '…'
    const gib = '…'
    const gib2 = '…'
    const minGiB = '…'
    const name = '…'
    const stateLabel = '…'
    const text19 = '…'
    const text20 = '…'
    const text21 = '…'
    const text22 = '…'
    const text23 = '…'
    const text24 = '…'
    const text25 = '…'
    const text26 = '…'
    const text27 = '…'
    const gib3 = '…'
    const where = '…'
    const name2 = '…'
    const stateLabel2 = '…'
    const text28 = '…'
    const text29 = '…'
    const text30 = '…'
    const text31 = '…'
    const text32 = '…'
    const text33 = '…'
    const text34 = '…'
    const text35 = '…'
    const text36 = '…'
    const gib4 = '…'
    const name3 = '…'
    const stateLabel3 = '…'
    const text37 = '…'
    const text38 = '…'
    const text39 = '…'
    const text40 = '…'
    const text41 = '…'
    const text42 = '…'
    const text43 = '…'
    const text44 = '…'
    const text45 = '…'
    const gib5 = '…'
    const intervalMs = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row">
          <Box flexDirection="column" marginRight={2}>
            <Box flexDirection="row">
              <Text>
                {text}
              </Text>
              <Text>
                {text2}
              </Text>
              <Text>
                {text3}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text>
                {text4}
              </Text>
              <Text>
                {text5}
              </Text>
              <Text>
                {text6}
              </Text>
            </Box>
            <Box flexDirection="row">
              <Text>
                {text7}
              </Text>
              <Text>
                {text8}
              </Text>
              <Text>
                {text9}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column">
            <Text bold color="#29ADFF">
              D O C K
            </Text>
            <Box flexDirection="row">
              <Text color="#C2C3C7">
                {"MEM "}
              </Text>
              <Box flexDirection="column">
                <Box flexDirection="row">
                  <Text>
                    {text10}
                  </Text>
                  <Text>
                    {text11}
                  </Text>
                  <Text>
                    {text12}
                  </Text>
                </Box>
                <Box flexDirection="row">
                  <Text>
                    {text13}
                  </Text>
                  <Text>
                    {text14}
                  </Text>
                  <Text>
                    {text15}
                  </Text>
                </Box>
                <Box flexDirection="row">
                  <Text>
                    {text16}
                  </Text>
                  <Text>
                    {text17}
                  </Text>
                  <Text>
                    {text18}
                  </Text>
                </Box>
              </Box>
              <Text color="#C2C3C7">
                {" "}
                {gib}
                /
                {gib2}
                {" GIB"}
              </Text>
            </Box>
            <Box>
              <Text bold color="#FF004D">
                {`HEADROOM ${gib} GIB ▶ LOW FUEL (MIN ${minGiB})`}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box marginTop={1}>
          <Text color="#C2C3C7">
            NO STACKS IN PORT. docker compose up TO DOCK ONE
          </Text>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row">
            <Text color="#FFEC27">
              {"◆ "}
            </Text>
            <Text bold color="#FF004D">
              {name}
            </Text>
            <Text color="#00E436">
              {" "}
              {stateLabel}
              {" "}
            </Text>
            <Box flexDirection="column">
              <Box flexDirection="row">
                <Text>
                  {text19}
                </Text>
                <Text>
                  {text20}
                </Text>
                <Text>
                  {text21}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text22}
                </Text>
                <Text>
                  {text23}
                </Text>
                <Text>
                  {text24}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text25}
                </Text>
                <Text>
                  {text26}
                </Text>
                <Text>
                  {text27}
                </Text>
              </Box>
            </Box>
            <Text color="#C2C3C7">
              {" "}
              {gib3}
              {"G "}
            </Text>
            <Button label="DOWN" />
          </Box>
          <Box>
            <Text color="#FF004D">
              {`    ${where}`}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row">
            <Text color="#FFEC27">
              {"◆ "}
            </Text>
            <Text bold color="#FF004D">
              {name2}
            </Text>
            <Text color="#00E436">
              {" "}
              {stateLabel2}
              {" "}
            </Text>
            <Box flexDirection="column">
              <Box flexDirection="row">
                <Text>
                  {text28}
                </Text>
                <Text>
                  {text29}
                </Text>
                <Text>
                  {text30}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text31}
                </Text>
                <Text>
                  {text32}
                </Text>
                <Text>
                  {text33}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text34}
                </Text>
                <Text>
                  {text35}
                </Text>
                <Text>
                  {text36}
                </Text>
              </Box>
            </Box>
            <Text color="#C2C3C7">
              {" "}
              {gib4}
              {"G "}
            </Text>
            <Button label="DOWN" />
          </Box>
          <Box>
            <Text color="#FF004D">
              {`    ${where}`}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="column" marginTop={1}>
          <Box flexDirection="row">
            <Text color="#FFEC27">
              {"◆ "}
            </Text>
            <Text bold color="#FF004D">
              {name3}
            </Text>
            <Text color="#00E436">
              {" "}
              {stateLabel3}
              {" "}
            </Text>
            <Box flexDirection="column">
              <Box flexDirection="row">
                <Text>
                  {text37}
                </Text>
                <Text>
                  {text38}
                </Text>
                <Text>
                  {text39}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text40}
                </Text>
                <Text>
                  {text41}
                </Text>
                <Text>
                  {text42}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text>
                  {text43}
                </Text>
                <Text>
                  {text44}
                </Text>
                <Text>
                  {text45}
                </Text>
              </Box>
            </Box>
            <Text color="#C2C3C7">
              {" "}
              {gib5}
              {"G "}
            </Text>
            <Button label="DOWN" />
          </Box>
          <Box>
            <Text color="#FF004D">
              {`    ${where}`}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="row" marginTop={1}>
          <Button label="RESCAN" hotkey="r" />
          <Text>
            {" "}
          </Text>
          <Button label="CLOSE" hotkey="x" role="dismiss" />
          <Text color="#5F574F">
            {" EVERY "}
            {intervalMs}
            S WHILE OPEN · DOWN COPIES, NEVER RUNS
          </Text>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const command = '…'
    await $.ui.toast(`DOCK ▸ COPIED: ${command}`)
    await $.ui.toast(`DOCK ▸ IN YOUR PROMPT BOX: ${command}`)
    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.

dock/hooks/register.tsx lines 224–347 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Button, Text } = $.ui.resolve(e)
    const snapshot = await read($, snapshotAtom)
    const cwd = await read($, cwdAtom)
    const columns = Math.max(30, e.props.bodyColumns)

    const pixels = (grid: readonly string[]) =>
      pixelRows(grid).map(runs => (
        <Box flexDirection="row">
          {runs.map((run: Run) => (
            <Text color={run.color} backgroundColor={run.backgroundColor}>
              {run.text}
            </Text>
          ))}
        </Box>
      ))

    const closeButton = <Button key="close" label="CLOSE" hotkey="x" role="dismiss" onPress={() => closePane($)} />

    const isOk = snapshot !== null && snapshot.health === 'ok'
    const isLow = snapshot !== null && isLowFuel(snapshot, minGiB)
    const gaugeWidth = Math.max(8, Math.min(24, columns - 40))
    const total = snapshot?.totalBytes ?? 0
    const redLine = total > 0 ? Math.max(0, total - minGiB * GIB) / total : 1

    const header = (
      <Box flexDirection="row">
        <Box key="crane" flexDirection="column" marginRight={2}>
          {pixels(CRANE)}
        </Box>
        <Box flexDirection="column">
          <Text bold color={PALETTE.u}>
            D O C K
          </Text>
          {isOk && snapshot ? (
            <Box key="gauge" flexDirection="row">
              <Text color={PALETTE.l}>MEM </Text>
              <Box flexDirection="column">{pixels(gaugeGrid(total > 0 ? snapshot.usedBytes / total : 0, redLine, gaugeWidth))}</Box>
              <Text color={PALETTE.l}>
                {' '}
                {gib(snapshot.usedBytes)}/{gib(total)} GIB
              </Text>
            </Box>
          ) : null}
          {isOk && snapshot ? (
            <Box key="headroom">
              <Text bold color={isLow ? PALETTE.r : PALETTE.u}>
                {`HEADROOM ${gib(headroomBytes(snapshot))} GIB ${isLow ? `▶ LOW FUEL (MIN ${minGiB})` : '▶ FUEL OK'}`}
              </Text>
            </Box>
          ) : null}
        </Box>
      </Box>
    )

    if (!isOk || snapshot === null) {
      return (
        <Box flexDirection="column">
          {header}
          <Box key="offline" marginTop={1}>
            <Text color={snapshot === null ? PALETTE.l : PALETTE.r}>
              {snapshot === null ? 'SCANNING DOCKER... (OR /dock TO INSERT COIN)' : offlineLine(snapshot)}
            </Text>
          </Box>
          <Box flexDirection="row" marginTop={1}>
            <Button key="rescan" label="RESCAN" hotkey="r" onPress={() => scanShared($)} />
            <Text> </Text>
            {closeButton}
          </Box>
        </Box>
      )
    }

    const nameWidth = Math.min(18, Math.max(5, ...snapshot.stacks.map(stack => stack.name.length)))
    const stateWidth = Math.max(4, ...snapshot.stacks.map(stack => stack.stateLabel.length))
    const pathWidth = Math.max(10, columns - 4)
    const mine = hereDir(
      snapshot.stacks.map(stack => stack.workingDir),
      cwd,
    )

    return (
      <Box flexDirection="column">
        {header}
        {snapshot.stacks.length === 0 ? (
          <Box key="empty" marginTop={1}>
            <Text color={PALETTE.l}>NO STACKS IN PORT. docker compose up TO DOCK ONE</Text>
          </Box>
        ) : null}
        {snapshot.stacks.map(stack => {
          const isMine = stack.workingDir !== null && stack.workingDir === mine
          const name = stack.name.length > nameWidth ? `${stack.name.slice(0, nameWidth - 1)}~` : stack.name.padEnd(nameWidth)
          const where = stack.isOrphan
            ? `ORPHAN ${shortenPath(stack.workingDir ?? '', pathWidth - 7)}`
            : shortenPath(stack.workingDir ?? 'WORKTREE UNKNOWN', pathWidth)
          return (
            <Box key={`stack-${stack.name}`} flexDirection="column" marginTop={1}>
              <Box flexDirection="row">
                <Text color={isMine ? PALETTE.y : PALETTE.n}>{isMine ? '◆ ' : '  '}</Text>
                <Text bold color={stack.isOrphan ? PALETTE.r : PALETTE.w}>
                  {name}
                </Text>
                <Text color={stack.isRunning ? PALETTE.e : PALETTE.d}> {stack.stateLabel.padEnd(stateWidth)} </Text>
                <Box flexDirection="column">
                  {pixels(barGrid(total > 0 ? stack.memoryBytes / total : 0, 8, stack.isOrphan ? 'r' : 'u'))}
                </Box>
                <Text color={PALETTE.l}> {gib(stack.memoryBytes).padStart(4)}G </Text>
                <Button key={`down-${stack.name}`} label="DOWN" onPress={press => offerDown($, stack.name, press.surface)} />
              </Box>
              <Box key={`where-${stack.name}`}>
                <Text color={stack.isOrphan ? PALETTE.r : PALETTE.l}>{`    ${where}`}</Text>
              </Box>
            </Box>
          )
        })}
        <Box flexDirection="row" marginTop={1}>
          <Button key="rescan" label="RESCAN" hotkey="r" onPress={() => scanShared($)} />
          <Text> </Text>
          {closeButton}
          <Text color={PALETTE.d}> EVERY {String(intervalMs / 1000)}S WHILE OPEN · DOWN COPIES, NEVER RUNS</Text>
        </Box>
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Pourya

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 filestool 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 2c7f62935f56 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.dock/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.4 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.dock/hooks/register.tsx:46 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 pourya7/claude-code-mods
/plugin install dock@claude-code-mods

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

Search them from Claude: the MCP connector

Similar designs