modscode EN

modscode / 図鑑 / homedot-panel

homedot-panel

Shows your homedot agents in Claude Code's status line (running, resting, stopped), with the 5-hour limit and minutes until it resets, plus a /dots pane.

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

何をするか

  • 欄・ステータス行・トーストを描く
  • /dots を足す
  • session.measure・session.startにフックする
  • ターンをまたいで自分の状態を持つ
  • プロセスを起こす

良いところ

  • ネットワークに出ない
  • 小さい(160 行)
  • TypeScript で書かれている
  • エラーを扱う

作り始めるためのコード

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

雛形(register.tsx)

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

// Drawn like homedot-panel by tsurutanmen (pane, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/tsurutanmen-homedot-panel/
// 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: "ドット" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const name = '…'
    const line = '…'
    const line2 = '…'
    const line3 = '…'
    const r = '…'
    const r2 = '…'
    const r3 = '…'
    const pending = '…'
    const id = '…'
    const split = '…'
    const id2 = '…'
    const split2 = '…'
    const id3 = '…'
    const split3 = '…'
    const r4 = '…'
    const r5 = '…'
    const r6 = '…'
    const name2 = '…'
    const line4 = '…'
    const line5 = '…'
    const line6 = '…'
    const r7 = '…'
    const r8 = '…'
    const r9 = '…'
    const pending2 = '…'
    const id4 = '…'
    const split4 = '…'
    const id5 = '…'
    const split5 = '…'
    const id6 = '…'
    const split6 = '…'
    const r10 = '…'
    const r11 = '…'
    const r12 = '…'
    const name3 = '…'
    const line7 = '…'
    const line8 = '…'
    const line9 = '…'
    const r13 = '…'
    const r14 = '…'
    const r15 = '…'
    const pending3 = '…'
    const id7 = '…'
    const split7 = '…'
    const id8 = '…'
    const split8 = '…'
    const id9 = '…'
    const split9 = '…'
    const r16 = '…'
    const r17 = '…'
    const r18 = '…'
    const toLocaleTimeString = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="column">
          <Text bold>
            {name}
            のドット
          </Text>
          <Text color="red">
            止まっている(画面の口 に届かない)
          </Text>
          <Text wrap="truncate-end">
            {line}
          </Text>
          <Text wrap="truncate-end">
            {line2}
          </Text>
          <Text wrap="truncate-end">
            {line3}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r2}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r3}
          </Text>
          <Text dimColor>
            {"待ち "}
            {pending}
            {" 件"}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id}
            {" "}
            {split}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id2}
            {" "}
            {split2}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id3}
            {" "}
            {split3}
          </Text>
          <Text dimColor>
            最近の活動
          </Text>
          <Text dimColor wrap="truncate-end">
            {r4}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r5}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r6}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {name2}
            のドット
          </Text>
          <Text color="red">
            止まっている(画面の口 に届かない)
          </Text>
          <Text wrap="truncate-end">
            {line4}
          </Text>
          <Text wrap="truncate-end">
            {line5}
          </Text>
          <Text wrap="truncate-end">
            {line6}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r7}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r8}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r9}
          </Text>
          <Text dimColor>
            {"待ち "}
            {pending2}
            {" 件"}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id4}
            {" "}
            {split4}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id5}
            {" "}
            {split5}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id6}
            {" "}
            {split6}
          </Text>
          <Text dimColor>
            最近の活動
          </Text>
          <Text dimColor wrap="truncate-end">
            {r10}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r11}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r12}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {name3}
            のドット
          </Text>
          <Text color="red">
            止まっている(画面の口 に届かない)
          </Text>
          <Text wrap="truncate-end">
            {line7}
          </Text>
          <Text wrap="truncate-end">
            {line8}
          </Text>
          <Text wrap="truncate-end">
            {line9}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r13}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r14}
          </Text>
          <Text color="cyan" wrap="truncate-end">
            {"実行中 "}
            {r15}
          </Text>
          <Text dimColor>
            {"待ち "}
            {pending3}
            {" 件"}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id7}
            {" "}
            {split7}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id8}
            {" "}
            {split8}
          </Text>
          <Text color="yellow" wrap="truncate-end">
            許可待ち #
            {id9}
            {" "}
            {split9}
          </Text>
          <Text dimColor>
            最近の活動
          </Text>
          <Text dimColor wrap="truncate-end">
            {r16}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r17}
          </Text>
          <Text dimColor wrap="truncate-end">
            {r18}
          </Text>
        </Box>
        <Text dimColor>
          15秒ごとに更新・
          {toLocaleTimeString}
        </Text>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const summary = '…'
    const fiveHour = '…'
    const d = '…'
    const id = '…'
    const split = '…'
    await $.ui.status(`${summary}${fiveHour}`)
    await $.ui.toast(`ドット(${d})が許可を待っている:#${id} ${split}`)
    return next(e)
  })
}

Mod 自身のコード

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

hooks/register.tsx 118〜142 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text } = $.ui.resolve(e)
    const { value: list = [] } = await $.state.get(SNAPS)
    if (list.length === 0) return <Text dimColor>読み込み中…</Text>

    return (
      <Box flexDirection="column" gap={1}>
        {list.map(d => (
          <Box flexDirection="column">
            <Text bold>{d.name}のドット</Text>
            {!d.up && <Text color="red">止まっている(画面の口 に届かない)</Text>}
            {d.up && d.status.map(line => <Text wrap="truncate-end">{line}</Text>)}
            {d.up && d.running.map(r => <Text color="cyan" wrap="truncate-end">実行中 {r}</Text>)}
            {d.up && d.pending > 0 && <Text dimColor>待ち {d.pending} 件</Text>}
            {d.up && d.approvals.map(a => (
              <Text color="yellow" wrap="truncate-end">許可待ち #{a.id} {a.summary.split('\n')[0]}</Text>
            ))}
            {d.up && d.recent.length > 0 && <Text dimColor>最近の活動</Text>}
            {d.up && d.recent.map(r => <Text dimColor wrap="truncate-end">{r}</Text>)}
          </Box>
        ))}
        <Text dimColor>15秒ごとに更新・{new Date(list[0].checkedAt).toLocaleTimeString('ja-JP')}</Text>
      </Box>
    )
  })
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 tsurutanmen

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 に読んだコミット c809e5b87820 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。

載せる条件: 確かめやすいコード
入口を読んだ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:79 C:\Windows\System32\curl.exe(通信する)
読んで送るファイルや環境変数を読み、かつ通信するか。通信するが、ファイルも環境変数も読まない
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

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

入れる

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

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

/plugin marketplace add tsurutanmen/homedot-panel
/plugin install homedot-panel@homedot-panel

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

Claude に聞く

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

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

Claude から探す: MCP コネクタ

似たデザイン