modscode JA

modscode / Gallery / deck

deck

A cockpit for Claude Code: plan bars and subagent strips, context, usage limits with reset countdowns and burn rates, spend, the model route and a pet. Six bar styles, three collapsed looks. CLI and Desktop.

Code you can checkTerminal + desktopPaneBandBoxButtonSvgText

What it does

  • Draws a pane, a band above the prompt
  • Adds /deck
  • Watches tool calls
  • Hooks agent.spawn, classic.Stop, classic.SubagentStop, classic.TaskCompleted and 10 more
  • Keeps its own state between turns

Good points

  • Starts no processes
  • Has a desktop-specific branch
  • 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 deck by nvr0x5 (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/nvr0x5-deck/
// 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: "Deck style" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Svg, Text } = $.ui.resolve(e)
    const names = '…'
    const i = '…'
    const pw = '…'
    const desktopTrack = '…'
    const map = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" columnGap={2} alignItems="center">
          <Box width={14} flexShrink={0}>
            <Button label={`${names}`} plain hotkey={`${i}`} />
          </Box>
          <Svg alt={`${names} style`} height={22} source={`<svg xmlns="http://www.w3.org/2000/svg" width="${pw}" height="22">${desktopTrack}</svg>`} />
          <Text color="#5DCAA5">
            ← now
          </Text>
        </Box>
        <Box flexDirection="row" columnGap={2} alignItems="center">
          <Box width={14} flexShrink={0}>
            <Button label={`${names}`} plain hotkey={`${i}`} />
          </Box>
          <Svg alt={`${names} style`} height={22} source={`<svg xmlns="http://www.w3.org/2000/svg" width="${pw}" height="22">${desktopTrack}</svg>`} />
          <Text color="#5DCAA5">
            ← now
          </Text>
        </Box>
        <Box flexDirection="row" columnGap={2} alignItems="center">
          <Box width={14} flexShrink={0}>
            <Button label={`${names}`} plain hotkey={`${i}`} />
          </Box>
          <Svg alt={`${names} style`} height={22} source={`<svg xmlns="http://www.w3.org/2000/svg" width="${pw}" height="22">${desktopTrack}</svg>`} />
          <Text color="#5DCAA5">
            ← now
          </Text>
        </Box>
        <Text color="#77756f">
          {`Press ${map} to choose · Esc to close`}
        </Text>
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Button, Text, Svg } = $.ui.resolve(e)
    const length = '…'
    const extras = '…'
    const title = '…'
    const source = '…'
    const alt = '…'
    const title2 = '…'
    const title3 = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" columnGap={1}>
          <Button label="deck ▾" plain hotkey="0" dimColor />
          <Text color="#77756f">
            {`· ${length} row`}
          </Text>
          <Box flexGrow={1} />
          <Box flexShrink={0}>
            <Text color="#9a9893">
              {extras}
            </Text>
          </Box>
        </Box>
        <Box flexDirection="row" alignItems="flex-start" gap={1}>
          <Text>
            ⇄
          </Text>
          <Text wrap="truncate">
            {title}
          </Text>
          <Box flexGrow={1} />
          <Svg source={`${source}`} alt={`${alt}`} />
          <Button label="✕" plain dimColor />
        </Box>
        <Box flexDirection="row" alignItems="flex-start" gap={1}>
          <Text>
            ⇄
          </Text>
          <Text wrap="truncate">
            {title2}
          </Text>
          <Box flexGrow={1} />
          <Svg source={`${source}`} alt={`${alt}`} />
          <Button label="✕" plain dimColor />
        </Box>
        <Box flexDirection="row" alignItems="flex-start" gap={1}>
          <Text>
            ⇄
          </Text>
          <Text wrap="truncate">
            {title3}
          </Text>
          <Box flexGrow={1} />
          <Svg source={`${source}`} alt={`${alt}`} />
          <Button label="✕" plain dimColor />
        </Box>
        {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.

hooks/register.js lines 1469–1525 · Pane
  on('ui.render', { component: 'Pane' }, async ($, e, next) => {
    if (e.requestId !== 'deck-style') return next(e)
    const { Box, Text, Button, Svg } = $.ui.resolve(e)
    const desktop = e.surface === 'desktop'
    const nowMs = Date.now()
    const list = desktop ? DESKTOP_STYLES : TERMINAL_STYLES
    const names = desktop ? DESKTOP_STYLE_NAMES : TERMINAL_STYLE_NAMES
    const current = desktop ? prefs.style.desktop : prefs.style.terminal
    const row = collectRows(nowMs).find((r) => r.kind === 'bar') ?? sampleRow()
    const cols = Math.max(40, e.props.bodyColumns ?? 80)
    const pw = Math.max(200, Math.min(420, cols * 8 - 160))
    const lines = list.map((name, i) => {
      const preview = desktop
        ? Svg({
            alt: names[name] + ' style',
            width: pw,
            height: TRACK_H,
            
            source: `<svg xmlns="http://www.w3.org/2000/svg" width="${pw}" height="${TRACK_H}">${desktopTrack(name, { ...row, id: 'pick-' + name }, pw, nowMs, new Map())}</svg>`,
          })
        : Box({ flexDirection: 'row', children: runs(Text, terminalBar(name, { ...row, id: 'pick-' + name }, Math.max(24, Math.min(48, cols - 26)), frame)) })
      return Box({
        key: 'style-row-' + name,
        flexDirection: 'row',
        columnGap: 2,
        alignItems: 'center',
        children: [
          Box({
            width: 14,
            flexShrink: 0,
            children: [
              Button({
                key: 'style-' + name,
                label: names[name],
                plain: true,
                hotkey: String(i + 1),
                onPress: async (ev) => {
                  const surface = ev?.surface ?? e.surface
                  if (surface === 'desktop') prefs.style.desktop = name
                  else prefs.style.terminal = name
                  $.ui.invalidate('ui.render')
                  await $.store.set('prefs', prefs)
                },
              }),
            ],
          }),
          preview,
          Text({ color: name === current ? STYLE.ok.fill : DIM, children: [name === current ? '← now' : ' '] }),
        ],
      })
    })
    return Box({
      flexDirection: 'column',
      gap: desktop ? 1 : 0,
      children: [...lines, Text({ color: DIM, children: ['Press ' + list.map((_, i) => i + 1).join('/') + ' to choose · Esc to close'] })],
    })
  })
hooks/register.js lines 1527–1686 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (e.props.hasSurvey) return next(e)
    const { Box, Text, Button, Svg, Image } = $.ui.resolve(e)
    const desktop = e.surface === 'desktop'
    if (e.surface === 'terminal') sawTerminal = true
    const nowMs = Date.now()
    const cols = Math.max(40, e.props.bodyColumns ?? e.viewport?.columns ?? 100)
    const rows = collectRows(nowMs)
    const extras = []
    if (prefs.show.clock) extras.push((desktop ? '◷ ' : '') + clockText())
    const wt = prefs.show.weather ? weatherText(desktop) : ''
    if (wt) extras.push(wt)
    if (!rows.length && !extras.length && !prefs.show.pet) return next(e)

    // the pet's lane
    const lane = []
    if (prefs.show.pet) {
      if (desktop && Svg) {
        const W = Math.max(320, cols * 8)
        lane.push(Svg({ source: petLaneSvg(pet, nowMs, W, 54), alt: 'Claude pet, ' + pet.act, width: W, height: 54 }))
      } else if (!desktop && Image) {
        // leave a margin: a row as wide as the band gets cut and marked with [-]
        const room = Math.max(0, cols - PET_COLS - 4)
        const x = Math.round(petX(pet, nowMs) * room)
        const px = petFrame(pet.act, nowMs - pet.start, pet.dir)
        lane.push(
          Box({
            flexDirection: 'row',
            height: PET_ROWS,
            overflow: 'hidden',
            children: [
              Box({ width: x, flexShrink: 0, children: [] }),
              Image({ key: 'pet', source: { rgba: toBase64(px), width: PET_RASTER.width, height: PET_RASTER.height }, columns: PET_COLS, rows: PET_ROWS, alt: ' ' }),
            ],
          }),
        )
      }
    }

    const toggle = Button({
      key: 'deck-toggle',
      label: isOpening() ? 'deck ▾' : 'deck ▸',
      plain: true,
      hotkey: '0',
      dimColor: true,
      onPress: () => setOpen($, !isOpening()),
    })
    const extrasText = Box({ flexShrink: 0, children: [Text({ color: MUTED, children: [extras.join('  ·  ')] })] })
    const spacer = Box({ flexGrow: 1, children: [] })

    // ----- collapsed, rings: a ring per limit, its reset, and spend -----
    if ((!prefs.open || !rows.length) && prefs.collapsed === 'rings') {
      const items = []
      const ask = rows.find((r) => r.state === 'needs_input')
      if (ask) items.push(Text({ color: STYLE.ask.fill, children: ['? ' + trunc(ask.title, 24) + ' needs you'] }))
      for (const row of rows.filter((r) => r.limit)) {
        const st = STYLE[row.style]
        const tag = row.kindKey === 'five_hour' ? '5h' : row.kindKey === 'seven_day' ? '7d' : row.title
        const ring = desktop
          ? Svg({ alt: tag + ' ' + Math.round(row.pct) + '% used', width: 22, height: 22, source: ringSvg(row.pct, st.desk, row.kindKey === 'seven_day' ? 'week' : 'clock') })
          : Text({ color: st.fill, children: ['○◔◑◕●'[Math.min(4, Math.round(row.pct / 25))]] })
        items.push(
          Box({
            flexDirection: 'row',
            flexShrink: 0,
            columnGap: 1,
            alignItems: 'center',
            children: [ring, Text({ color: TEXT, bold: true, wrap: 'truncate', children: [Math.round(row.pct) + '%'] }), Text({ color: MUTED, wrap: 'truncate', children: [tag + (row.resets ? ' · resets ' + row.resets : '')] })],
          }),
        )
      }
      if (prefs.cost) {
        items.push(
          Box({
            flexDirection: 'row',
            flexShrink: 0,
            columnGap: 1,
            alignItems: 'center',
            children: [
              desktop ? Svg({ alt: 'spend', width: 22, height: 22, source: ringSvg(100, STYLE.done.desk, 'usd') }) : Text({ color: STYLE.done.fill, children: ['$'] }),
              Text({ color: STYLE.done.fill, bold: true, wrap: 'truncate', children: [fmtUsd(spend.dayUsd)] }),
              Text({ color: MUTED, wrap: 'truncate', children: ['today · ' + fmtUsd(spend.monthUsd) + ' this month'] }),
            ],
          }),
        )
      }
      const busy = rows.find((r) => (r.kind === 'bar' || r.kind === 'activity') && r.animating && r.state !== 'needs_input')
      if (busy) items.push(Box({ flexShrink: 1, children: [Text({ color: MUTED, wrap: 'truncate', children: [STYLE[busy.style].glyph + ' ' + trunc(busy.short, 22)] })] }))
      const line = Box({
        flexDirection: 'row',
        columnGap: 2,
        alignItems: 'center',
        children: [
          ...(rows.length ? [toggle] : []),
          Box({ flexDirection: 'row', flexShrink: 1, overflow: 'hidden', columnGap: desktop ? 4 : 3, alignItems: 'center', children: items }),
          spacer,
          extrasText,
        ],
      })
      return Box({ flexDirection: 'column', children: [...lane, line] })
    }

    // ----- collapsed, text: one plain status line, clock and weather at its end -----
    if ((!prefs.open || !rows.length) && prefs.collapsed === 'text') {
      const parts = []
      for (const row of collapsedOrder(rows)) {
        const st = STYLE[row.style]
        if (parts.length) parts.push(Text({ children: ['  '] }))
        if (row.kind === 'route') {
          parts.push(Text({ color: desktop ? STYLE.run.desk : STYLE.run.fill, children: ['⇄ '] }))
          parts.push(Text({ color: MUTED, children: [row.to + (row.effort ? ' · ' + row.effort : '')] }))
          continue
        }
        parts.push(Text({ color: desktop ? st.desk : st.fill, children: [st.glyph + ' '] }))
        parts.push(Text({ color: row.state === 'needs_input' ? st.fill : MUTED, children: [row.short] }))
      }
      if (extras.length) parts.push(Text({ color: MUTED, children: [(parts.length ? '  ' : '') + [...extras].reverse().join('  ')] }))
      const line = Box({
        flexDirection: 'row',
        columnGap: 1,
        children: [...(rows.length ? [toggle] : []), Box({ flexDirection: 'row', flexShrink: 1, children: [Text({ wrap: 'truncate', children: parts })] })],
      })
      return Box({ flexDirection: 'column', children: [...lane, line] })
    }

    // ----- collapsed, chips: one line of chips, limits first -----
    if (!prefs.open || !rows.length) {
      const chips = []
      // the terminal counts columns; the desktop counts pixels (about 8 per column, ~7.5 per character)
      let budget = desktop ? cols * 8 - 140 - extras.join('  ·  ').length * 7.5 : cols - 10 - extras.join('  ·  ').length
      let hidden = 0
      for (const row of collapsedOrder(rows)) {
        const st = STYLE[row.style]
        const w = desktop ? row.short.length * 8.5 + 76 : row.short.length + 10
        if (w > budget) {
          hidden++
          continue
        }
        budget -= w
        if (chips.length) chips.push(Text({ color: TRACK, children: [' │ '] }))
        if (row.kind === 'route') {
          chips.push(Text({ color: desktop ? STYLE.run.desk : STYLE.run.fill, children: [row.short + ' '] }))
          continue
        }
        chips.push(Text({ color: desktop ? st.desk : st.fill, children: [st.glyph + ' '] }))
        const chipText = { color: row.state === 'needs_input' ? st.fill : row.limit ? TEXT : '#c9c7c1', children: [row.short + ' '] }
        if (row.limit) chipText.bold = true
        chips.push(Text(chipText))
        chips.push(
          desktop
            ? Svg({
                alt: row.title + ' ' + Math.round(row.pct) + '%',
                width: 36,
                height: 8,
                source: `<svg xmlns="http://www.w3.org/2000/svg" width="36" height="8"><rect width="36" height="8" rx="4" fill="#808080" fill-opacity=".2"/><rect width="${Math.max((36 * row.pct) / 100, row.pct > 0 ? 4 : 0)}" height="8" rx="4" fill="${st.desk}"/></svg>`,
              })
            : Box({ flexDirection: 'row', children: runs(Text, terminalMini(prefs.style.terminal, row, 5)) }),
        )
      }
      if (hidden) chips.push(Text({ color: DIM, children: ['  +' + hidden] }))
Licence text (MIT)
MIT License

Copyright (c) 2026 nvr0x5

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

networkdrives 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 497f43ab7735 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.hooks/register.js
ParsesEvery file parses as TypeScript or JavaScript.5 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.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.hooks/register.js:939 fetch('https://api.open-meteo.com/v1/forecast?latitude='); hooks/register.js:1210 fetch('https://geocoding-api.open-meteo.com/v1/search?co)
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 files or environment variables and reaches the network.reaches the network, but reads no files and no environment variables
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 nvr0x5/claude-deck
/plugin install deck@deck

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

Search them from Claude: the MCP connector

Similar designs