todo-list
Keeps a running list of open items from the conversation and shows it above the prompt.
何をするか
- プロンプトの上の帯・トーストを描く
- /todos を足す
- prompt.edit・prompt.submit・session.end・session.start ほか 3 個にフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like todo-list by Chienlung Huang (band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/cldotdev-todo-list/
// 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 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 i = '…'
const head = '…'
const tail = '…'
const head2 = '…'
const tail2 = '…'
const head3 = '…'
const tail3 = '…'
const helpLine = '…'
return (
<Box flexDirection="column">
<Text dimColor>
────────
</Text>
<Text bold>
{" "}
Todos
</Text>
<Box flexDirection="row">
<Box width={0} overflow="hidden">
<Button label=" " plain />
</Box>
<Text>
{"• "}
</Text>
<Text>
{`${i}1`}
</Text>
<Text wrap="truncate-end">
{head}
<Text dimColor>
{tail}
</Text>
</Text>
<Text bold color="ansi256(1)">
{" "}
delete?
</Text>
</Box>
<Box flexDirection="row">
<Box width={0} overflow="hidden">
<Button label=" " plain />
</Box>
<Text>
{"• "}
</Text>
<Text>
{`${i}1`}
</Text>
<Text wrap="truncate-end">
{head2}
<Text dimColor>
{tail2}
</Text>
</Text>
<Text bold color="ansi256(1)">
{" "}
delete?
</Text>
</Box>
<Box flexDirection="row">
<Box width={0} overflow="hidden">
<Button label=" " plain />
</Box>
<Text>
{"• "}
</Text>
<Text>
{`${i}1`}
</Text>
<Text wrap="truncate-end">
{head3}
<Text dimColor>
{tail3}
</Text>
</Text>
<Text bold color="ansi256(1)">
{" "}
delete?
</Text>
</Box>
<Box flexDirection="row">
<Text>
{" "}
</Text>
<Text wrap="wrap">
(No detail. Run /todos refresh to add one.)
</Text>
</Box>
<Box flexDirection="row">
<Text dimColor>
{" "}
{helpLine}
</Text>
<Box width={0} overflow="hidden">
<Button label="next" hotkey="j" plain />
<Button label="previous" hotkey="k" plain />
<Button label="details" hotkey="o" plain />
<Button label="paste" hotkey="p" plain />
<Button label="select" hotkey="s" plain />
<Button label="select all" hotkey="a" plain />
<Button label="ask" hotkey="b" plain />
<Button label="delete" hotkey="d" plain />
</Box>
</Box>
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Could not insert into the prompt box. Close the dialog and try again.`)
await $.ui.toast(`Could not ask /btw about this item.`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 622〜717 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const [list, current, openTitle, armed, selectedTitles] = await Promise.all([
read($, items),
read($, focused),
read($, detailed),
read($, deleting),
read($, selected),
])
const picked = pickedFrom(list, selectedTitles)
const { isWorking } = e.props
// While one item's detail is shown, the band shows that item alone.
const opened = list.find(one => one.title === openTitle)
if (list.length === 0 || e.props.hasSurvey) {
return next(e)
}
const { Box, Button, Text } = $.ui.resolve(e)
const numberWidth = labelWidth(list.length)
return (
<Box flexDirection="column">
<Text dimColor>{'─'.repeat(e.props.bodyColumns)}</Text>
<Text bold>{GUTTER}Todos</Text>
{list.map((item, i) => {
// The focus ring tracks its stop by position, so every row keeps its
// Button in every view; dropping the hidden rows' Buttons would slide
// the ring onto the next stop, the first hotkey Button.
const button = (
<Button key={`${ROW_PREFIX}${i}`} label=" " plain onPress={() => toggleDetails($)} />
)
if (opened !== undefined && item !== opened) {
return (
<Box key={`row-${i}`} width={0} height={0} overflow="hidden">
{button}
</Box>
)
}
// Items stored before parentheses were normalized still need normalizing here.
const shown = normalizeParens(item.title)
const [, main = shown] = NOTE.exec(shown) ?? []
const room = e.props.bodyColumns - GUTTER.length - numberWidth
const isFocused = item.title === current
const color = picked.includes(item) ? SELECTED_COLOR : undefined
const isLong = !isFocused && opened === undefined && cellWidth(shown) > room
// The cut may end inside the note.
const cut = isLong ? fit(shown, room) : shown
const head = cut.slice(0, main.length)
const tail = cut.slice(main.length)
return (
<Box key={`row-${i}`} flexDirection="row">
{/* The focus ring always inverts a Button, so the row's Button takes
no cells and the dot beside it marks the focus instead. */}
<Box width={0} overflow="hidden">
{button}
</Box>
<Text>{isFocused ? '• ' : ' '}</Text>
<Text color={color}>{numberLabel(i + 1, numberWidth)}</Text>
<Text color={color} wrap={isLong ? 'truncate-end' : 'wrap'}>
{head}
{tail !== '' && <Text dimColor>{tail}</Text>}
</Text>
{item.title === armed && (
<Text bold color={DELETE_COLOR}>
{' '}
delete?
</Text>
)}
</Box>
)
})}
{opened !== undefined && (
<Box flexDirection="row">
<Text>{' '.repeat(GUTTER.length + numberWidth)}</Text>
<Text wrap="wrap">{opened.detail || '(No detail. Run /todos refresh to add one.)'}</Text>
</Box>
)}
<Box flexDirection="row">
<Text dimColor>
{GUTTER}
{helpLine(current !== '', armed !== '', opened !== undefined, picked.length)}
</Text>
{/* Holds the hotkeys out of sight: a drawn hotkey takes the accent color. */}
<Box width={0} overflow="hidden">
<Button key="next" label="next" hotkey={NEXT_KEY} plain onPress={() => moveFocus($, e.requestId, 1)} />
<Button key="previous" label="previous" hotkey={PREVIOUS_KEY} plain onPress={() => moveFocus($, e.requestId, -1)} />
<Button key="details" label="details" hotkey={DETAILS_KEY} plain onPress={() => toggleDetails($)} />
<Button key="paste" label="paste" hotkey={PASTE_KEY} plain onPress={() => paste($)} />
<Button key="select" label="select" hotkey={SELECT_KEY} plain onPress={() => toggleSelected($)} />
<Button key="select-all" label="select all" hotkey={SELECT_ALL_KEY} plain onPress={() => toggleAll($)} />
<Button key="ask" label="ask" hotkey={ASK_KEY} plain onPress={() => askAbout($, isWorking)} />
<Button key="delete" label="delete" hotkey={DELETE_KEY} plain onPress={() => deleteFocused($)} />
</Box>
</Box>
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Chienlung Huang and other contributors 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 に読んだコミット 7e18aafbe47a のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。2 ファイルを解析 |
| コードが 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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add cldotdev/claude-todo-list/plugin install todo-list@claude-todo-list入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(7e18aafbe47a)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「cldotdev-todo-list」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
could not fill the prompt boxcould not fill:Claude に頼む…
-
▴Token OptimizerCheckpointCheckpointCheckpointbuildStart freshbuildStart freshbuildStart freshbuildCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointCheckpointbuildbuildbuildTokens savedSaved Clean up tokens in 30 days (chat 2 this session)Claude に頼む…
-
reflect · "Skip" ×3Save to ./CLAUDE.mdGlobal insteadEditSkipreflect · "Skip" ×3Save to ./CLAUDE.mdGlobal insteadEditSkipreflect · "Skip" ×3reflect · +3 more · /reflect-queueSave to ./CLAUDE.mdGlobal insteadEditSkipClaude に頼む…
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
✉ 3 unread AMP message ReadHideClaude に頼む…