modscode EN

modscode / 図鑑 / oneliner

oneliner

A calm instrument strip for Claude Code: 5-hour limit with forecast, prompt-cache countdown, context fill, one-click git ship, and next-step ideas, in one line above your prompt.

確かめやすいコードターミナル+デスクトップペインバンドトーストBoxButtonText

何をするか

  • 欄・プロンプトの上の帯・トーストを描く
  • /ship・/handoff・/limits・/strip を足す
  • ツールの呼び出しを見張る(止めることがある)
  • classic.PostModelSwitch・classic.PreModelSwitch・classic.SessionStart・config.set ほか 6 個にフックする
  • ターンをまたいで自分の状態を持つ

良いところ

  • TypeScript で書かれている
  • エラーを扱う

作り始めるためのコード

2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。

雛形(register.tsx)

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

// Drawn like oneliner by deadraw (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/deadraw-oneliner/
// 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: "Where you left off" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const pct = '…'
    const pace = '…'
    const hhmmAt = '…'
    const hhmm = '…'
    const axis = '…'
    const row = '…'
    const futureRows = '…'
    const axis2 = '…'
    const row2 = '…'
    const futureRows2 = '…'
    const axis3 = '…'
    const row3 = '…'
    const futureRows3 = '…'
    const hhmmAt2 = '…'
    const hhmmAt3 = '…'
    const weekPercent = '…'
    const toLocaleDateString = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Text bold>
            {"5h "}
            {pct}
            %
          </Text>
          <Text dimColor>
            {"· pace "}
            +
            {pace}
            %/h
          </Text>
          <Text color="warning">
            · full ~
            {hhmmAt}
          </Text>
          <Text dimColor>
            {"· resets "}
            {hhmm}
          </Text>
        </Box>
        <Box flexDirection="row">
          <Text dimColor>
            {axis}
            {" │"}
          </Text>
          <Text>
            {row}
          </Text>
          <Text dimColor>
            {futureRows}
          </Text>
        </Box>
        <Box flexDirection="row">
          <Text dimColor>
            {axis2}
            {" │"}
          </Text>
          <Text>
            {row2}
          </Text>
          <Text dimColor>
            {futureRows2}
          </Text>
        </Box>
        <Box flexDirection="row">
          <Text dimColor>
            {axis3}
            {" │"}
          </Text>
          <Text>
            {row3}
          </Text>
          <Text dimColor>
            {futureRows3}
          </Text>
        </Box>
        <Text dimColor>
          {"    └────────"}
        </Text>
        <Box flexDirection="row" justifyContent="space-between">
          <Text dimColor>
            {`     ${hhmmAt}`}
          </Text>
          <Text dimColor>
            {"now "}
            {hhmmAt2}
          </Text>
          <Text dimColor>
            {hhmmAt3}
          </Text>
        </Box>
        <Text dimColor>
          {"7-day window: "}
          {weekPercent}
          %
          {` · resets ${toLocaleDateString}`}
        </Text>
        <Text dimColor italic>
          The chart fills in as readings arrive (one per few minutes while you work).
        </Text>
        <Button role="dismiss" label="Close" />
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const text4 = '…'
    const detail = '…'
    const label = '…'
    const text5 = '…'
    const text6 = '…'
    const text7 = '…'
    const text8 = '…'
    const text9 = '…'
    const text10 = '…'
    const text11 = '…'
    const text12 = '…'
    const ch = '…'
    const ch2 = '…'
    const ch3 = '…'
    const ch4 = '…'
    const ch5 = '…'
    const ch6 = '…'
    const hotkey = '…'
    const label2 = '…'
    const label3 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" justifyContent="space-between">
          <Box flexDirection="row" flexShrink={1} overflow="hidden">
            <Box flexDirection="row" gap={1} paddingRight={1}>
              <Text dimColor>
                │
              </Text>
              <Box flexDirection="row">
                <Text wrap="truncate">
                  {text}
                </Text>
                <Text wrap="truncate">
                  {text2}
                </Text>
                <Text wrap="truncate">
                  {text3}
                </Text>
                <Text wrap="truncate">
                  {text4}
                </Text>
                <Box display="none" gap={1}>
                  <Text dimColor wrap="truncate">
                    {` · ${detail}`}
                  </Text>
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                </Box>
              </Box>
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
            </Box>
            <Box flexDirection="row" gap={1} paddingRight={1}>
              <Text dimColor>
                │
              </Text>
              <Box flexDirection="row">
                <Text wrap="truncate">
                  {text5}
                </Text>
                <Text wrap="truncate">
                  {text6}
                </Text>
                <Text wrap="truncate">
                  {text7}
                </Text>
                <Text wrap="truncate">
                  {text8}
                </Text>
                <Box display="none" gap={1}>
                  <Text dimColor wrap="truncate">
                    {` · ${detail}`}
                  </Text>
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                </Box>
              </Box>
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
            </Box>
            <Box flexDirection="row" gap={1} paddingRight={1}>
              <Text dimColor>
                │
              </Text>
              <Box flexDirection="row">
                <Text wrap="truncate">
                  {text9}
                </Text>
                <Text wrap="truncate">
                  {text10}
                </Text>
                <Text wrap="truncate">
                  {text11}
                </Text>
                <Text wrap="truncate">
                  {text12}
                </Text>
                <Box display="none" gap={1}>
                  <Text dimColor wrap="truncate">
                    {` · ${detail}`}
                  </Text>
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                  <Button label={`${label}`} />
                </Box>
              </Box>
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
              <Button label={`${label}`} />
            </Box>
          </Box>
          <Box flexDirection="row" gap={1} flexShrink={0} marginLeft={1}>
            <Box flexDirection="row">
              <Text>
                {ch}
              </Text>
              <Text>
                {ch2}
              </Text>
              <Text>
                {ch3}
              </Text>
            </Box>
            <Button plain label=" ▴  " />
          </Box>
        </Box>
        <Box flexDirection="row" justifyContent="space-between" marginTop={1}>
          <Box flexDirection="row">
            <Text>
              {"  "}
            </Text>
            <Box flexDirection="row">
              <Text>
                {ch4}
              </Text>
              <Text>
                {ch5}
              </Text>
              <Text>
                {ch6}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            {"saved for all projects "}
          </Text>
        </Box>
        <Box flexDirection="row" marginLeft={2} gap={1}>
          <Button plain hotkey={`${hotkey}`} label="›" />
          <Box flexDirection="row" gap={1}>
            <Text color="success">
              ●
            </Text>
            <Text>
              {label}
            </Text>
            <Text color="success">
              on
            </Text>
          </Box>
        </Box>
        <Box flexDirection="row" marginLeft={2} gap={1}>
          <Button plain hotkey={`${hotkey}`} label="›" />
          <Box flexDirection="row" gap={1}>
            <Text color="success">
              ●
            </Text>
            <Text>
              {label2}
            </Text>
            <Text color="success">
              on
            </Text>
          </Box>
        </Box>
        <Box flexDirection="row" marginLeft={2} gap={1}>
          <Button plain hotkey={`${hotkey}`} label="›" />
          <Box flexDirection="row" gap={1}>
            <Text color="success">
              ●
            </Text>
            <Text>
              {label3}
            </Text>
            <Text color="success">
              on
            </Text>
          </Box>
        </Box>
        <Text dimColor>
          {"  ────────"}
        </Text>
        <Box flexDirection="row" marginLeft={2} gap={1}>
          <Button plain hotkey="0" label="›" />
          <Text color="error">
            close
          </Text>
        </Box>
        {await next(e)}
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const path = '…'
    await $.ui.toast(`Press Enter to clear; then ask Claude to continue from the handoff.`)
    await $.ui.toast(`Couldn't write ${path}`)
    return next(e)
  })
}

Mod 自身のコード

Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。

hooks/register.tsx 1418〜1489 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: LIMITS_PANE }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const [l, at] = await Promise.all([read($, limit), read($, now)])
    const h = ((await $.store.get(HISTORY_KEY)) as History | undefined) ?? { resetsAt: null, points: [] }
    const width = Math.max(20, Math.min(72, ((e.props as { bodyColumns?: number }).bodyColumns ?? 60) - 8))
    const close = <Button key="limits-close" role="dismiss" label="Close" onPress={() => void $.ui.close({ id: LIMITS_PANE })} />
    if (l.percent === null || !l.resetsAt) {
      return <Box flexDirection="column"><Text dimColor>No limit reading yet: it arrives with the next reply.</Text>{close}</Box>
    }
    const end = Date.parse(l.resetsAt)
    const start = end - WINDOW_MS
    const nowAt = at || Date.now()
    const fullAt = limitFullAt(l)
    const pace = (() => {
      const s = l.samples ?? []
      if (s.length < 2) return null
      const first = s[0]
      const last = s[s.length - 1]
      if (!first || !last) return null
      const span = last.at - first.at
      return span >= FORECAST_MIN_SPAN_MS ? ((last.pct - first.pct) / span) * 3_600_000 : null
    })()
    const points = h.resetsAt === l.resetsAt ? h.points : []
    // Each column is a slice of the 5h window: past → last reading; future → the forecast line.
    const past: (number | null)[] = []
    const future: (number | null)[] = []
    for (let i = 0; i < width; i++) {
      const t = start + ((i + 1) / width) * WINDOW_MS
      if (t <= nowAt) {
        const before = points.filter(p => p.at <= t)
        past.push(before[before.length - 1]?.pct ?? null)
        future.push(null)
      } else {
        past.push(null)
        future.push(pace !== null && pace > 0 ? Math.min(100, l.percent + (pace * (t - nowAt)) / 3_600_000) : null)
      }
    }
    const pastRows = barRows(past, 5)
    const futureRows = barRows(future, 5)
    const pct = Math.round(l.percent)
    const tone = pct >= LIMIT_RED_PCT ? 'error' : pct >= LIMIT_YELLOW_PCT ? 'warning' : 'success'
    const axis = ['100', '', ' 50', '', '  0']
    const nowCol = Math.max(0, Math.min(width - 1, Math.floor(((nowAt - start) / WINDOW_MS) * width)))
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Text color={tone} bold>5h {pct}%</Text>
          {pace !== null && <Text dimColor>· pace {pace >= 0 ? '+' : ''}{Math.round(pace)}%/h</Text>}
          {fullAt !== null
            ? <Text color="warning">· full ~{hhmmAt(fullAt)}</Text>
            : <Text dimColor>· won't fill before reset</Text>}
          <Text dimColor>· resets {hhmm(l.resetsAt)}</Text>
        </Box>
        {pastRows.map((row, r) => (
          <Box flexDirection="row">
            <Text dimColor>{(axis[r] ?? '').padStart(3)} │</Text>
            <Text color={tone}>{row.slice(0, nowCol + 1)}</Text>
            <Text dimColor>{(futureRows[r] ?? '').slice(nowCol + 1)}</Text>
          </Box>
        ))}
        <Text dimColor>{'    └' + '─'.repeat(width)}</Text>
        <Box flexDirection="row" width={width + 5} justifyContent="space-between">
          <Text dimColor>{'     ' + hhmmAt(start)}</Text>
          <Text dimColor>now {hhmmAt(nowAt)}</Text>
          <Text dimColor>{hhmmAt(end)}</Text>
        </Box>
        {l.weekPercent !== null && <Text dimColor>7-day window: {Math.round(l.weekPercent)}%{l.weekResetsAt ? ` · resets ${new Date(l.weekResetsAt).toLocaleDateString()}` : ''}</Text>}
        {points.length < 3 && <Text dimColor italic>The chart fills in as readings arrive (one per few minutes while you work).</Text>}
        {close}
      </Box>
    )
  })
hooks/register.tsx 1543〜1702 行 · バンド
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (e.props.hasSurvey) return next(e)
    const { Box, Text, Button } = $.ui.resolve(e)
    const [hiddenParts, isMenuOpen, writingHandoff, isOfferingUpdate] = await Promise.all([read($, hidden), read($, stripMenu), read($, isWritingHandoff), read($, autoUpdateOffer)])
    let [g, d, l, c, ctx, at, shipping, n] = await Promise.all([
      read($, git), read($, dev), read($, limit), read($, cache), read($, context), read($, now), read($, isShipping),
      read($, nextSteps),
    ])
    const demoLevel = (await read($, demo)) as DemoLevel | null
    if (demoLevel) ({ g, d, l, c, ctx, n } = demoFixture(demoLevel, at || Date.now(), n))
    // Past its reset the window is empty, even before the next turn reports a new reading.
    if (l.resetsAt && (at || Date.now()) >= Date.parse(l.resetsAt)) l = { ...l, percent: 0, resetsAt: null, samples: [] }
    if (l.weekResetsAt && (at || Date.now()) >= Date.parse(l.weekResetsAt)) l = { ...l, weekPercent: 0, weekResetsAt: null }
    const cols = e.props.bodyColumns
    const isTight = cols < 60

    type Seg = {
      id: string; text: string; color?: string; dim?: boolean
      extras?: { text: string; color?: string; dim?: boolean; drop?: number }[] // more numbers, each with its own color; `drop`: lower goes first when narrow
      button?: { label: string; onPress: () => void }
      detail?: string // revealed after the text while the pointer is over the part (desktop)
      detailMode?: 'push' | 'over' // push the parts to its right aside, or cover them to the strip's end
      buttons?: { label: string; onPress: () => void }[] // more buttons after `button`
      detailButtons?: { label: string; onPress: () => void }[] // actions offered only on hover
    }
    const segs: Seg[] = []
    const segTextLen = (s: Seg) => s.text.length + (s.extras ?? []).reduce((n, x) => n + x.text.length, 0)

    // git
    if (g.isRepo) {
      const dirty = g.changed > 0 || g.ahead > 0
      const isDiverged = g.ahead > 0 && g.behind > 0
      const isBroken = g.conflicts > 0 || g.operation !== null
      const parts = [g.branch]
      if (g.changed) parts.push(`${g.changed}Δ`)
      if (g.ahead) parts.push(`${g.ahead}↑`)
      if (g.behind) parts.push(`${g.behind}↓`)
      segs.push({
        id: 'git',
        text: shipping ? `${g.branch} shipping…`
          : isBroken ? `${g.branch} · ${g.operation ?? 'merge'}${g.conflicts ? ` ${g.conflicts}✗` : ''}`
          : isDiverged ? `${g.branch} · diverged ${g.ahead}↑${g.behind}↓`
          : dirty ? parts.join(isTight ? ' ' : ' · ') : `${g.branch} ✓`,
        color: isBroken || isDiverged ? 'error' : dirty || g.behind ? 'warning' : g.hasUpstream ? 'success' : undefined,
        dim: !isBroken && !isDiverged && !dirty && !g.behind && !g.hasUpstream,
        button: dirty && !shipping && !isBroken && !isDiverged ? { label: 'Ship', onPress: () => void ship($) } : undefined,
        detail: [
          g.files?.length ? `${g.files.join(', ')}${g.changed > g.files.length ? ` +${g.changed - g.files.length} more` : ''}` : '',
          g.ahead ? `${g.ahead} to push` : '',
          g.behind ? `${g.behind} to pull` : '',
          !g.hasUpstream ? 'not on a remote yet' : '',
          // The subject shortened, its age kept: "Hover details, handoff and clear flow… · 5 min ago".
          g.lastCommit ? `last: ${g.lastCommit.replace(/^(.*) · (\d+)$/, (_, subject: string, secs: string) => `${shortLabel(subject, 40)} · ${shortAge(at - Number(secs) * 1000)} ago`)}` : '',
        ].filter(Boolean).join(' · '),
        detailMode: 'push',
      })
    }

    // dev server
    if (d.port !== null) {
      const map = {
        up: { text: `:${d.port}`, color: 'success' },
        down: { text: isTight ? `:${d.port} ↓` : `:${d.port} down`, dim: true },
        starting: { text: `:${d.port} starting…`, dim: true },
        error: { text: isTight ? 'build ✗' : `build error`, color: 'error' },
        none: { text: '', dim: true },
      } as const
      const s = map[d.status]
      segs.push({
        id: 'dev', text: s.text, color: 'color' in s ? s.color : undefined, dim: 'dim' in s && s.dim,
        button: d.status === 'down' ? { label: 'Start', onPress: () => void startDev($, cwd) } : undefined,
        detail: d.status === 'error' ? (d.error ?? 'see the dev server output')
          : d.status === 'up' ? `http://localhost:${d.port}`
          : d.status === 'down' ? `localhost:${d.port} is not running` : '',
        detailMode: 'push',
      })
    }

    // limit
    if (l.percent !== null) {
      const pct = Math.round(l.percent)
      const tone = pct >= LIMIT_RED_PCT ? 'error' : pct >= LIMIT_YELLOW_PCT ? 'warning' : 'success'
      const hot = tone !== 'success'
      const minsLeft = l.resetsAt ? Math.max(0, Math.ceil((Date.parse(l.resetsAt) - at) / 60_000)) : null
      const fullAt = limitFullAt(l)
      const reset = fullAt !== null ? ` · full ~${hhmmAt(fullAt)}`
        : minsLeft !== null && minsLeft < 60 ? ` · ${minsLeft} min`
        : hot && l.resetsAt && !isTight ? ` · ${hhmm(l.resetsAt)}` : ''
      const week = l.weekPercent !== null && l.weekPercent >= WEEK_SHOW_PCT ? Math.round(l.weekPercent) : null
      segs.push({
        id: 'limit',
        text: `5h ${pct}%${reset}`,
        color: tone,
        extras: week !== null
          ? [{ text: ` · 7d ${week}%`, color: week >= LIMIT_RED_PCT ? 'error' : 'warning', drop: 3 }]
          : undefined,
        // Close to the wall: offer to write the handoff while there's still room to.
        button: (tone === 'error' || (fullAt !== null && fullAt - at < 60 * 60_000)) && !writingHandoff
          ? { label: 'Handoff', onPress: () => void writeHandoff($, cwd) }
          : undefined,
        detail: [
          l.resetsAt ? `resets ${hhmm(l.resetsAt)}` : '',
          fullAt !== null ? `full ~${hhmmAt(fullAt)}` : '',
          l.weekPercent !== null ? `7d ${Math.round(l.weekPercent)}%` : '',
          ctx.usd ? `$${ctx.usd.toFixed(2)}` : '',
        ].filter(Boolean).join(' · '),
      })
    }

    // context window
    const isContextRed = ctx.percent !== null && Math.round(ctx.percent) >= CONTEXT_RED_PCT
    if (ctx.percent !== null) {
      const pct = Math.round(ctx.percent)
      const k = ctx.tokens !== null && !isTight ? ` · ${tokensShort(ctx.tokens)}` : ''
      segs.push({
        id: 'context',
        text: `ctx ${pct}%${k}`,
        color: pct >= CONTEXT_RED_PCT ? 'error' : pct >= CONTEXT_YELLOW_PCT ? 'warning' : 'success',
        button: isContextRed && !writingHandoff ? { label: 'Handoff', onPress: () => void writeHandoff($, cwd) } : undefined,
        buttons: isContextRed ? [{ label: 'Compact', onPress: () => void compactNow($) }] : undefined,
        detail: [
          `${100 - pct}% free`,
          ctx.window ? `of ${tokensShort(ctx.window)}` : '',
        ].filter(Boolean).join(' '),
        // On hover at any fill: the same two, as icons (handoff, compact).
        detailButtons: isContextRed ? undefined : [
          ...(writingHandoff ? [] : [{ label: '📝', onPress: () => void writeHandoff($, cwd) }]),
          { label: '♻️', onPress: () => void compactNow($) },
        ],
        detailMode: 'push',
      })
    }

    // cache clock
    const ttl = cacheTtl(c, l)
    const isShort = ttl < CACHE_TTL_MIN
    const left = cacheMinutesLeft(c, ttl, at)
    if (left !== null) {
      const cold = left === 0 || c.resetReason != null
      const share = ((secsLeftExact(c, ttl, at) ?? 0) / 60) / ttl
      const timeTone = cold || share < CACHE_RED_SHARE ? 'error' : share < CACHE_GREEN_SHARE ? 'warning' : 'success'
      const readTone = c.readPercent === null ? undefined
        : c.readPercent >= READ_GREEN_PCT ? 'success' : c.readPercent >= READ_RED_PCT ? 'warning' : 'error'
      const of = isShort ? (isTight ? `/${ttl}` : ` of ${ttl}`) : ''
      const secs = isShort ? cacheSecondsLeft(c, ttl, at) : null
      const clock = secs !== null && secs < 120
        ? `${secs >= 60 ? `${Math.floor(secs / 60)}m ${secs % 60}s` : `${secs}s`}${of}${of ? 'm' : ''}`
        : `${left}${of}m`
      segs.push({
        id: 'cache',
        text: c.resetReason ? (isTight ? 'cache reset' : `cache reset · ${c.resetReason}`)
          : cold ? 'cache cold' : `${isTight ? '⏱' : 'cache '}${clock}`,
        color: timeTone,
        extras: [
          ...(!cold && !isTight && c.readPercent !== null ? [{ text: ` · ${c.readPercent}% read`, color: readTone, drop: 2 }] : []),
          // A /model switch throws this warm cache away; say how much it would re-send.
          ...(!cold && cols >= SWITCH_HINT_COLS && share >= CACHE_RED_SHARE && (ctx.tokens ?? 0) >= SWITCH_HINT_TOKENS
            ? [{ text: ` · switch re-sends ${tokensShort(ctx.tokens ?? 0)}`, dim: true, drop: 1 }] : []),
        ],
        // On a small context, re-sending it costs less than a compaction (which reads it all and writes a summary).
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 deadraw

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.

コードが呼ぶもの

通信プログラム起動ファイル書き込みClaude を動かすツール呼び出し保存

コードから読み取ったデザイン

読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。

コードから読めること

2026-10-06 に読んだコミット e7034deb4da6 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx
解析できるすべてのファイルが TypeScript か JavaScript として解析できる。1 ファイルを解析
コードが Mod の中で完結import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中
読める圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし
呼び出しが見える通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で
入れる前に自分で判断する材料
描く場所コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに同じように描く
入れる手順リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる
Windows のプログラム$.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない
通信fetch の送り先(https のホスト)がコードに書いてあるか。hooks/register.tsx:446 fetch(`http://localhost:${d.port}/`)
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。hooks/register.tsx:411 実行時に決まるプログラム; hooks/register.tsx:466 実行時に決まるプログラム
読んで送るファイルや環境変数を読み、かつ通信するか。読んだうえで通信する
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件

入れる

入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。

リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。

/plugin marketplace add deadraw/claude-code-oneliner
/plugin install oneliner@deadraw

入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(e7034deb4da6)と違うことがあります。入れる前に見比べてください。

Claude に聞く

modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:

modscode のデザイン「deadraw-oneliner」をコードごと読んで、同じようなペインを作って

Claude から探す: MCP コネクタ

似たデザイン