your-serve
🎾 Tells you when Claude needs you: one line with the question it ended on, and its answers as buttons.
何をするか
- プロンプトの上の帯・欄・トーストを描く
- /your-serve を足す
- prompt.submit・session.end・session.start・turn.completeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like your-serve by Lorcan Chinnock (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/lorcanchinnock-your-serve/
// 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 line = '…'
const HOTKEYS = '…'
const label = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="wrap" columnGap={2}>
<Box flexShrink={1}>
<Text>
{line}
</Text>
</Box>
<Box flexShrink={0} flexWrap="wrap" gap={1}>
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} />
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} />
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} />
<Button plain dimColor label="other" />
<Button plain dimColor label="skip" />
</Box>
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "‹title›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const index = '…'
const question = '…'
const question2 = '…'
const question3 = '…'
const step = '…'
const question4 = '…'
const HOTKEYS = '…'
const label = '…'
const clockTime = '…'
const question5 = '…'
const clockTime2 = '…'
const question6 = '…'
const clockTime3 = '…'
const question7 = '…'
const toast = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" marginBottom={1}>
<Text bold>
🎾 Your Serve
</Text>
<Text dimColor>
{" · "}
nothing waiting on you
</Text>
</Box>
<Text dimColor>
{`${index}1`}
{". "}
{question}
{" "}
(skipped, type it in the prompt)
</Text>
<Text dimColor>
{`${index}1`}
{". "}
{question2}
{" "}
(skipped, type it in the prompt)
</Text>
<Text dimColor>
{`${index}1`}
{". "}
{question3}
{" "}
(skipped, type it in the prompt)
</Text>
<Text>
{`${step}1. `}
{question4}
</Text>
<Box flexDirection="row" gap={1} marginTop={1}>
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} autoFocus />
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} autoFocus />
<Button hotkey={`${HOTKEYS}`} plain label={`${label}`} autoFocus />
<Button plain dimColor label="other" autoFocus />
<Button plain dimColor label="skip" />
</Box>
<Box flexDirection="column" marginTop={0}>
<Text dimColor>
Earlier this session
</Text>
<Box flexDirection="row">
<Box width={7} flexShrink={0}>
<Text dimColor>
{clockTime}
</Text>
</Box>
<Box flexShrink={1}>
<Text>
{question5}
</Text>
</Box>
</Box>
<Box flexDirection="row">
<Box width={7} flexShrink={0}>
<Text dimColor>
{clockTime2}
</Text>
</Box>
<Box flexShrink={1}>
<Text>
{question6}
</Text>
</Box>
</Box>
<Box flexDirection="row">
<Box width={7} flexShrink={0}>
<Text dimColor>
{clockTime3}
</Text>
</Box>
<Box flexShrink={1}>
<Text>
{question7}
</Text>
</Box>
</Box>
</Box>
<Text dimColor>
No questions yet. The ball's with Claude.
</Text>
<Box marginTop={1}>
<Text dimColor>
{toast}
{" · /config to change · esc closes"}
</Text>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`🎾 Claude needs a decision`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/your-serve/hooks/register.tsx 275〜324 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const shown = await read($, serve)
if (shown === null) return next(e)
const below = await next(e)
const elements = $.ui.resolve(e)
const { Box, Text, Button } = elements
// The mobile app draws no field, so there `other` isn't offered and a question is skipped instead.
const Input = 'Input' in elements ? elements.Input : null
const current = currentStep(shown)
const count = shown.questions.length
const isMany = count > 1
const line =
current === null
? `🎾 Your serve: all ${count} answers are in your prompt`
: `🎾 Your serve${isMany ? ` (${current.step + 1}/${count})` : ''}: ${current.asked.question}`
return (
<Box flexDirection="column">
{/* Wraps rather than truncates: answers you can't read are no use. */}
<Box flexDirection="row" flexWrap="wrap" columnGap={2} width={e.props.bodyColumns - MARKER}>
<Box flexShrink={1}>
<Text>{line}</Text>
</Box>
{current !== null && (current.asked.options.length > 0 || isMany) && (
<Box flexShrink={0} flexWrap="wrap" gap={1}>
{shown.isTyping && Input !== null ? (
<Input key="serve-other" placeholder="your answer" submitLabel="answer" autoFocus onSubmit={value => void chooseTyped($, value, false)} />
) : (
current.asked.options.map((option, index) => (
<Button
key={`serve-${index + 1}`}
hotkey={HOTKEYS[index]}
plain
label={option.label}
onPress={() => void choose($, option.reply, false)}
/>
))
)}
{/* No digit left to spare for these two: they're clicked, or reached with the focus ring. */}
{isMany && !shown.isTyping && Input !== null && (
<Button key="serve-other" plain dimColor label="other" onPress={() => void startTyping($)} />
)}
{isMany && <Button key="serve-skip" plain dimColor label="skip" onPress={() => void choose($, null, false)} />}
</Box>
)}
</Box>
{below}
</Box>
)
})plugins/your-serve/hooks/register.tsx 339〜427 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const elements = $.ui.resolve(e)
const { Box, Text, Button } = elements
const Input = 'Input' in elements ? elements.Input : null
const shown = await read($, serve)
const waiting = new Set(shown?.questions.map(asked => asked.question))
const earlier = (await read($, history)).filter(asked => !waiting.has(asked.question))
const current = shown === null ? null : currentStep(shown)
const isMany = shown !== null && shown.questions.length > 1
const isTyping = shown?.isTyping === true && Input !== null
const toast = `toast after ${Math.round(toastAfterMs / 1000)}s · voice ${shouldSpeak ? 'on' : 'off'}`
return (
<Box flexDirection="column">
<Box flexDirection="row" marginBottom={1}>
<Text bold>🎾 Your Serve</Text>
<Text dimColor> · {shown === null ? 'nothing waiting on you' : current === null ? 'answers in your prompt' : 'waiting on you'}</Text>
</Box>
{shown !== null &&
isMany &&
shown.answers.map((reply, index) => (
<Text dimColor>
{index + 1}. {shown.questions[index]?.question} {reply ?? '(skipped, type it in the prompt)'}
</Text>
))}
{current !== null && (
<Text>
{isMany ? `${current.step + 1}. ` : ''}
{current.asked.question}
</Text>
)}
{current !== null && (current.asked.options.length > 0 || isMany) && (
<Box flexDirection="row" gap={1} marginTop={1}>
{isTyping && Input !== null ? (
<Input key="pane-serve-other" placeholder="your answer" submitLabel="answer" autoFocus onSubmit={value => void chooseTyped($, value, true)} />
) : (
current.asked.options.map((option, index) => (
<Button
key={`pane-serve-${index + 1}`}
hotkey={HOTKEYS[index]}
plain
label={option.label}
autoFocus={index === 0 ? true : undefined}
onPress={() => void choose($, option.reply, true)}
/>
))
)}
{isMany && !isTyping && Input !== null && (
<Button
key="pane-serve-other"
plain
dimColor
label="other"
autoFocus={current.asked.options.length === 0 ? true : undefined}
onPress={() => void startTyping($)}
/>
)}
{isMany && (
<Button
key="pane-serve-skip"
plain
dimColor
label="skip"
onPress={() => void choose($, null, true)}
/>
)}
</Box>
)}
{earlier.length > 0 && (
<Box flexDirection="column" marginTop={shown === null ? 0 : 1}>
<Text dimColor>Earlier this session</Text>
{earlier.map(asked => (
<Box flexDirection="row" width={e.props.bodyColumns}>
<Box width={7} flexShrink={0}>
<Text dimColor>{clockTime(asked.at)}</Text>
</Box>
<Box flexShrink={1}>
<Text>{asked.question}</Text>
</Box>
</Box>
))}
</Box>
)}
{shown === null && earlier.length === 0 && <Text dimColor>No questions yet. The ball's with Claude.</Text>}
<Box marginTop={1}>
<Text dimColor>{toast} · /config to change · esc closes</Text>
</Box>
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Lorcan Chinnock 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 に読んだコミット 985685d682c0 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/your-serve/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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add LorcanChinnock/claude-desk-neighbours/plugin install your-serve@claude-desk-neighbours入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(985685d682c0)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「lorcanchinnock-your-serve」をコードごと読んで、同じようなペインを作って似たデザイン
-
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
-
slop Edit1 of 3accepteditrejectClaude に頼む…
-
Claude に頼む…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Claude に頼む…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel
-
Claude に頼む…Fanyi settingsOnAPI · OpusenOn this MacAPIHost src/ SaveKey K · paste a new one, Enter SaveOpus↻ RefreshCustom model model id, for an API that lists none UseFanyi settingsHostClose
-
Claude に頼む…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts