modscode EN

modscode / 図鑑 / net-connections

net-connections

Pane listing every network connection this session made, traced back to the prompt and command that caused it

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

何をするか

  • 欄を描く
  • /net を足す
  • ツールの呼び出しを見張る(止めることがある)
  • session.start・turn.start・turn.step・ui.focus ほか 1 個にフックする
  • ターンをまたいで自分の状態を持つ

良いところ

  • TypeScript で書かれている
  • エラーを扱う
  • ファイルを書かない

作り始めるためのコード

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

雛形(register.tsx)

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

// Drawn like net-connections by soefrey (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/soefrey-net-connections/
// 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: "Network connections" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const length = '…'
    const uncertain = '…'
    const size = '…'
    const fmtNum = '…'
    const running = '…'
    const nNew = '…'
    const showing = '…'
    const glyph = '…'
    const KIND_LABEL = '…'
    const host = '…'
    const seq = '…'
    const url = '…'
    const protocol = '…'
    const status = '…'
    const statusText = '…'
    const printable = '…'
    const printable2 = '…'
    const EVIDENCE_TEXT = '…'
    const reason = '…'
    const fmtTime = '…'
    const bytes = '…'
    const source = '…'
    const toolUseId = '…'
    const printable3 = '…'
    const rowLabel = '…'
    const i = '…'
    const text = '…'
    const printable4 = '…'
    const key = '…'
    const printable5 = '…'
    const key2 = '…'
    const printable6 = '…'
    const key3 = '…'
    const printable7 = '…'
    const printable8 = '…'
    const rawPage = '…'
    const rawPages = '…'
    const t = '…'
    const t2 = '…'
    const t3 = '…'
    const promptLabel = '…'
    const value = '…'
    return (
      <Box flexDirection="column" flexGrow={1} backgroundColor="black">
        <Box flexDirection="column">
          <Box flexDirection="column">
            <Text wrap="truncate-end">
              <Text bold color="cyan">
                NETWORK CONNECTIONS
              </Text>
              <Text bold>
                {` · ${length} connections`}
              </Text>
              <Text color="yellow">
                {` (${uncertain} uncertain)`}
              </Text>
              <Text color="#ff8700" bold>
                {" · ⇄ 0 file-share access"}
              </Text>
              <Text dimColor>
                {` · ${size} hosts · 0 local tool calls · ${length} prompts · ${fmtNum}↑ ${fmtNum}↓ tokens`}
              </Text>
              <Text color="yellow">
                {` · ${running} open`}
              </Text>
              <Text color="green" bold>
                {` · ★ ${nNew} new host`}
              </Text>
            </Text>
            <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
              <Button plain hotkey="l" label="list" />
              <Button plain hotkey="g" label="by prompt" />
              <Button plain hotkey="h" label="by host" />
              <Text dimColor>
                │
              </Text>
              <Button plain hotkey="z" label="local tool calls: shown" />
            </Box>
            <Text color="cyan" wrap="truncate-end">
              {`Showing: ${showing}`}
            </Text>
          </Box>
          <Box flexDirection="row" columnGap={1} marginTop={1}>
            <Button plain hotkey="b" label="back" />
            <Button plain hotkey="p" label="newer" />
            <Button plain hotkey="n" label="older" />
            <Button plain hotkey="o" label="all from this prompt" />
            <Button plain hotkey="t" label="all to this host" />
            <Button plain hotkey="c" label="copy" />
          </Box>
          <Text>
            {" "}
          </Text>
          <Text wrap="truncate-end">
            <Text>
              {glyph}
              {" "}
            </Text>
            <Text bold>
              {KIND_LABEL}
              {" "}
            </Text>
            <Text bold>
              {host}
            </Text>
            <Text color="green" bold>
              {"  ★ NEW HOST"}
            </Text>
            <Text dimColor>
              {`  #${seq}`}
            </Text>
          </Text>
          <Box flexDirection="column" borderStyle="round" borderColor="#ff8700" paddingX={1} marginY={1}>
            <Text color="#ff8700" bold>
              ⇄ File-share access — not a web or API connection
            </Text>
            <Text wrap="wrap">
              {`The path lies on the network file system ${url}. The operating system reaches it over ${protocol}, opening or reusing a s…`}
            </Text>
            <Text wrap="wrap" dimColor>
              Duration and size are those of the tool call; the file-system session may outlive it, be shared with other programs, an…
            </Text>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Status
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {`${status} — ${statusText}`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                URL
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Protocol
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable2}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Evidence
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap" color="yellow">
                {`${EVIDENCE_TEXT} — ${reason}`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Started
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {`${fmtTime}`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Duration
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                still open
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Streamed out
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {`${bytes} chars`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Made by
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {`${source} (${toolUseId})`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Subagent
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable3}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Text bold>
              Caused by
            </Text>
            <Text wrap="wrap" dimColor>
              {`The ${source} call whose processes opened this connection; the engine reports the call, the poller saw the connection.`}
            </Text>
            <Button plain hotkey="u" label={`↑ ${rowLabel}`} />
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Text bold>
              {`Observed connections of this call (${length})`}
            </Text>
            <Text wrap="wrap" dimColor>
              What this call's processes connected to, as the poller saw it in the TCP table.
            </Text>
            <Button plain hotkey={`${i}`} label={`↳ ${rowLabel}`} />
            <Button plain hotkey={`${i}`} label={`↳ ${rowLabel}`} />
            <Button plain hotkey={`${i}`} label={`↳ ${rowLabel}`} />
          </Box>
          <Text>
            {" "}
          </Text>
          <Text bold>
            Origin
          </Text>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                (no prompt)
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {`${fmtTime}  ${text}`}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                Request
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable4}
              </Text>
            </Box>
          </Box>
          <Text>
            {" "}
          </Text>
          <Text bold>
            Details
          </Text>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                {key}
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable5}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                {key2}
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable6}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="row">
            <Box width={20} flexShrink={0}>
              <Text dimColor>
                {key3}
              </Text>
            </Box>
            <Box flexGrow={1}>
              <Text wrap="wrap">
                {printable7}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Box flexDirection="row" columnGap={1}>
              <Text bold>
                Response
              </Text>
              <Button plain hotkey="w" label="tool output" />
              <Button plain hotkey="r" label="raw page" />
              <Button plain hotkey="f" label="fetch again" />
            </Box>
            <Box flexDirection="column">
              <Text wrap="wrap" color="yellow">
                {`Fetched again by this pane at ${fmtTime}, not the bytes WebFetch received: mods only see the tool's output. The page may…`}
              </Text>
              <Box flexDirection="row">
                <Box width={20} flexShrink={0}>
                  <Text dimColor>
                    Status
                  </Text>
                </Box>
                <Box flexGrow={1}>
                  <Text wrap="wrap" color="red">
                    {`HTTP ${status}`}
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="row">
                <Box width={20} flexShrink={0}>
                  <Text dimColor>
                    Content type
                  </Text>
                </Box>
                <Box flexGrow={1}>
                  <Text wrap="wrap">
                    {printable8}
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="row">
                <Box width={20} flexShrink={0}>
                  <Text dimColor>
                    Length
                  </Text>
                </Box>
                <Box flexGrow={1}>
                  <Text wrap="wrap">
                    {`${length} chars — first 100000 shown`}
                  </Text>
                </Box>
              </Box>
              <Box flexDirection="row" columnGap={1} marginTop={1}>
                <Button plain hotkey="k" label="previous part" />
                <Text dimColor>
                  {`part ${rawPage}1/${rawPages}`}
                </Text>
                <Button plain hotkey="j" label="next part" />
              </Box>
              <Text>
                {" "}
              </Text>
              <Text wrap="wrap">
                {t}
              </Text>
              <Text wrap="wrap">
                {t2}
              </Text>
              <Text wrap="wrap">
                {t3}
              </Text>
            </Box>
          </Box>
          <Box flexDirection="column" marginTop={1}>
            <Text bold>
              {`Other connections from ${promptLabel} (${length})`}
            </Text>
            <Button plain dimColor label={`${value}`} />
            <Button plain dimColor label={`${value}`} />
            <Button plain dimColor label={`${value}`} />
          </Box>
        </Box>
      </Box>
    )
  })
}

Mod 自身のコード

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

hooks/register.tsx 810〜818 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box } = $.ui.resolve(e)
    const body = await renderPane($, e)
    return (
      <Box flexDirection="column" flexGrow={1} backgroundColor="black" minHeight={e.viewport?.rows}>
        {body}
      </Box>
    )
  })
hooks/register.tsx 845〜1004 行 · ペイン
async function renderPane($: $, e: RenderInput<'Pane'>) {
  const { Box, Text, Button } = $.ui.resolve(e)
  listRows = []
  const all = await read($, conns)
  const ps = await read($, prompts)
  const v = await read($, view)
  const fresh = new Set(await read($, newHosts))
  const width = Math.max(30, e.props.bodyColumns)
  const rows = Math.max(8, (e.viewport?.rows ?? 30) - 2)
  const promptById = new Map(ps.map(p => [p.id, p]))
  // A row the poller saw belongs to the tool call with its tool use id: that call's own row.
  const isSeen = (c: NetConn) => c.seenByPoller === true
  const callRows = new Map<string, NetConn>()
  for (const c of all) if (c.toolUseId !== undefined && !isSeen(c) && !callRows.has(c.toolUseId)) callRows.set(c.toolUseId, c)
  const parentOf = (c: NetConn) => (isSeen(c) && c.toolUseId !== undefined ? callRows.get(c.toolUseId) : undefined)
  const seenOf = new Map<string, NetConn[]>()
  for (const c of all) {
    const p = parentOf(c)
    if (p !== undefined) seenOf.set(p.id, [...(seenOf.get(p.id) ?? []), c])
  }
  const promptLabel = (id?: string) => {
    const p = id === undefined ? undefined : promptById.get(id)
    return p === undefined ? '(no prompt)' : `${p.kind === 'command' ? 'C' : 'P'}${p.seq}`
  }

  const showLocal = v.showLocal === true
  const net = all.filter(c => c.kind !== 'local')
  const networked = (c: NetConn) => c.kind === 'local' && seenOf.has(c.id)
  const nNetworked = all.filter(networked).length
  const counts: Record<string, number> = { all: showLocal ? all.length : net.length + nNetworked, model: 0, web: 0, shell: nNetworked, mcp: 0, service: 0, share: 0, local: 0 }
  for (const c of all) counts[c.kind] = (counts[c.kind] ?? 0) + 1
  const uncertain = net.filter(c => c.confidence === 'uncertain').length
  const hosts = new Set(net.map(c => c.host).filter(h => !PLACEHOLDER_HOSTS.has(h)))
  const tokIn = all.reduce((n, c) => n + Number(c.details.find(d => d.key === 'Input tokens')?.value ?? 0) + Number(c.details.find(d => d.key === 'Cache read tokens')?.value ?? 0), 0)
  const tokOut = all.reduce((n, c) => n + Number(c.details.find(d => d.key === 'Output tokens')?.value ?? 0), 0)
  const running = net.filter(c => c.status === 'running').length
  const nNew = [...hosts].filter(h => fresh.has(h)).length

  // What the view shows right now, since the buttons alone make the choice hard to see.
  const viewName = { list: 'list', detail: 'details', prompts: 'by prompt', hosts: 'by host' }[v.mode]
  const showing = [
    `view: ${viewName}`,
    ...(v.mode === 'list'
      ? [
          `kind: ${v.filter === 'all' ? 'all' : KIND_LABEL[v.filter].toLowerCase()}`,
          ...(v.promptId !== undefined ? [`prompt: ${promptLabel(v.promptId || undefined)}`] : []),
          ...(v.host !== undefined ? [`host: ${v.host}`] : []),
        ]
      : []),
    ...(v.mode === 'hosts' ? [`hosts: ${{ session: 'this session', new: 'new in this session', known: 'all known' }[v.hostSet ?? 'session']}`] : []),
    `local tool calls: ${showLocal ? 'shown' : 'hidden'}`,
  ].join(' · ')

  const header = (
    <Box flexDirection="column">
      <Text wrap="truncate-end">
        <Text bold color="cyan">NETWORK CONNECTIONS</Text>
        <Text bold>{` · ${net.length} connections`}</Text>
        {uncertain > 0 ? <Text color="yellow">{` (${uncertain} uncertain)`}</Text> : null}
        {counts.share ? <Text color={KIND_COLOR.share} bold>{` · ⇄ ${counts.share} file-share access${counts.share === 1 ? '' : 'es'}`}</Text> : null}
        <Text dimColor>{` · ${hosts.size} hosts · ${counts.local} local tool calls · ${ps.length} prompts · ${fmtNum(tokIn)}↑ ${fmtNum(tokOut)}↓ tokens`}</Text>
        {running > 0 ? <Text color="yellow">{` · ${running} open`}</Text> : null}
        {nNew > 0 ? <Text color="green" bold>{` · ★ ${nNew} new host${nNew === 1 ? '' : 's'}`}</Text> : null}
      </Text>
      <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
        <Button key="v-list" plain hotkey="l" dimColor={v.mode !== 'list'} label="list" onPress={() => setView($, x => ({ ...x, mode: 'list', page: 0, back: [] }))} />
        <Button key="v-prompts" plain hotkey="g" dimColor={v.mode !== 'prompts'} label="by prompt" onPress={() => setView($, x => ({ ...x, mode: 'prompts', page: 0, back: [] }))} />
        <Button key="v-hosts" plain hotkey="h" dimColor={v.mode !== 'hosts'} label="by host" onPress={() => setView($, x => ({ ...x, mode: 'hosts', page: 0, back: [] }))} />
        <Text dimColor>│</Text>
        <Button key="toggle-local" plain hotkey="z" dimColor={!showLocal} label={`local tool calls: ${showLocal ? 'shown' : 'hidden'}`} onPress={() => setView($, x => ({ ...x, showLocal: x.showLocal !== true, page: 0 }))} />
      </Box>
      <Text color="cyan" wrap="truncate-end">{`Showing: ${showing}`}</Text>
    </Box>
  )

  // ---- detail ----
  if (v.mode === 'detail') {
    const list = scoped(all, v, networked)
    const idx = list.findIndex(c => c.id === v.selected)
    const c = idx >= 0 ? list[idx] : all.find(x => x.id === v.selected)
    if (c === undefined) {
      return (
        <Box flexDirection="column">
          {header}
          <Text dimColor>That connection is gone.</Text>
          <Button key="back" hotkey="b" label="back" onPress={() => goBack($)} />
        </Box>
      )
    }
    const p = c.promptId ? promptById.get(c.promptId) : undefined
    const parent = parentOf(c)
    const seen = seenOf.get(c.id) ?? []
    const linked = new Set([parent?.id, ...seen.map(x => x.id)])
    const siblings = all.filter(x => x.promptId === c.promptId && x.id !== c.id && !linked.has(x.id))
    const rowLabel = (x: NetConn) => trunc(`#${x.seq} ${KIND_LABEL[x.kind]} ${x.host}  ${oneLine(x.command ?? x.statusText ?? '')}`, width - 4)
    const mark = STATUS_MARK[c.status]
    const keyW = 20
    const field = (k: string, value: string, color?: string) => (
      <Box flexDirection="row">
        <Box width={keyW} flexShrink={0}><Text dimColor>{k}</Text></Box>
        <Box flexGrow={1}><Text wrap="wrap" color={color}>{trunc(printable(value), 9_000)}</Text></Box>
      </Box>
    )
    const go = (to?: NetConn) => to && setView($, x => ({ ...x, selected: to.id }))
    const copyText = c.url ?? c.command ?? c.host

    // WebFetch: its processed output, or the page's raw body fetched again on request.
    const isFetch = c.source === 'WebFetch' && c.url !== undefined
    const showRaw = v.response === 'raw'
    const r = isFetch ? (await read($, raw))[c.id] : undefined
    const toolOut = c.details.find(d => d.key === 'Response')?.value
    const body = r?.text === undefined ? '' : printable(r.text)
    const rawPages = Math.max(1, Math.ceil(body.length / RAW_PAGE))
    const rawPage = Math.min(Math.max(0, v.rawPage ?? 0), rawPages - 1)
    const pageText = body.slice(rawPage * RAW_PAGE, (rawPage + 1) * RAW_PAGE)
    const pickRaw = () => {
      void setView($, x => ({ ...x, response: 'raw', rawPage: 0 }))
      if (r === undefined || r.state === 'error') void fetchRaw($, c)
    }
    const responseSection = (
      <Box flexDirection="column" marginTop={1}>
        <Box flexDirection="row" columnGap={1}>
          <Text bold>Response</Text>
          <Button key="resp-tool" plain hotkey="w" dimColor={showRaw} label="tool output" onPress={() => setView($, x => ({ ...x, response: 'tool' }))} />
          <Button key="resp-raw" plain hotkey="r" dimColor={!showRaw} label="raw page" onPress={pickRaw} />
          {showRaw && r !== undefined && r.state !== 'loading' ? (
            <Button key="resp-refetch" plain hotkey="f" label="fetch again" onPress={() => void fetchRaw($, c)} />
          ) : null}
        </Box>
        {!showRaw ? (
          <Text wrap="wrap" dimColor={toolOut === undefined}>{toolOut ?? (c.status === 'running' ? 'Still running.' : 'WebFetch returned no output.')}</Text>
        ) : r === undefined ? (
          <Text dimColor>Press r to fetch the page.</Text>
        ) : r.state === 'loading' ? (
          <Text color="yellow">{`Fetching ${r.url} …`}</Text>
        ) : r.state === 'error' ? (
          <Text color="red" wrap="wrap">{`Fetch failed: ${r.error ?? 'unknown error'}`}</Text>
        ) : (
          <Box flexDirection="column">
            <Text wrap="wrap" color="yellow">{`Fetched again by this pane at ${fmtTime(r.at)}, not the bytes WebFetch received: mods only see the tool's output. The page may have changed, or answer this request differently.`}</Text>
            {field('Status', `HTTP ${r.status ?? '?'}`, r.status !== undefined && r.status < 400 ? undefined : 'red')}
            {field('Content type', r.headers?.['content-type'] ?? '—')}
            {field('Length', `${r.length ?? 0} chars${(r.length ?? 0) > RAW_MAX ? ` — first ${RAW_MAX} shown` : ''}`)}
            {rawPages > 1 ? (
              <Box flexDirection="row" columnGap={1} marginTop={1}>
                <Button key="raw-prev" plain hotkey="k" dimColor={rawPage === 0} label="previous part" onPress={() => setView($, x => ({ ...x, rawPage: Math.max(0, rawPage - 1) }))} />
                <Text dimColor>{`part ${rawPage + 1}/${rawPages}`}</Text>
                <Button key="raw-next" plain hotkey="j" dimColor={rawPage >= rawPages - 1} label="next part" onPress={() => setView($, x => ({ ...x, rawPage: Math.min(rawPages - 1, rawPage + 1) }))} />
              </Box>
            ) : null}
            <Text> </Text>
            {body === '' ? <Text dimColor>(empty body)</Text> : chunks(pageText, RAW_CHUNK).map((t, i) => <Text key={`raw-${rawPage}-${i}`} wrap="wrap">{t}</Text>)}
          </Box>
        )}
      </Box>
    )
    return (
      <Box flexDirection="column">
        {header}
        <Box flexDirection="row" columnGap={1} marginTop={1}>
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 soefrey

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.

コードが呼ぶもの

通信プログラム起動環境変数ツール呼び出し保存

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

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

コードから読めること

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

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx
解析できるすべてのファイルが TypeScript か JavaScript として解析できる。3 ファイルを解析
コードが 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:364 fetch(url)
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。hooks/register.tsx:438 powershell.exe(シェル・インタプリタ); hooks/register.tsx:561 実行時に決まるプログラム
読んで送るファイルや環境変数を読み、かつ通信するか。読んだうえで通信する
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

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

入れる

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

リポジトリの .claude-plugin/marketplace.json にこの Mod が載っていないため、入れる手順は出せません。コードとして読むか、作者の README に従ってください。

Claude に聞く

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

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

Claude から探す: MCP コネクタ

似たデザイン