sprites
Use Sprites from Claude Code to create, inspect, and operate remote isolated development environments.
何をするか
- 欄を描く
- session.startにフックする
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like sprites by Fly.io (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/superfly-sprites/
// 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: "Sprites" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Input, Text, Button, Link } = $.ui.resolve(e)
const prefix = '…'
const status = '…'
const length = '…'
const timeOfDay = '…'
const name = '…'
const organization = '…'
const day = '…'
const url = '…'
const message = '…'
const name2 = '…'
const status2 = '…'
const name3 = '…'
const status3 = '…'
const name4 = '…'
const status4 = '…'
const length2 = '…'
const message2 = '…'
const id = '…'
const day2 = '…'
const id2 = '…'
const day3 = '…'
const id3 = '…'
const day4 = '…'
const service = '…'
const text = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column">
<Input placeholder="Filter by name prefix" value={`${prefix}`} submitLabel="Find" />
<Text dimColor>
Loading Sprites…
</Text>
<Text color="error" wrap="wrap">
{status}
</Text>
</Box>
<Box flexDirection="row" gap={2}>
<Box flexDirection="column" width={30} flexShrink={0}>
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
Sprites
</Text>
<Text dimColor>
{`${length}+ · as of ${timeOfDay}`}
</Text>
</Box>
<Text dimColor>
Press Find to list your Sprites, or filter by a name prefix.
</Text>
<Box flexDirection="row" gap={1}>
<Text color="claude">
▌
</Text>
<Text>
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Button plain label={`${name}`} />
</Box>
<Text color="suggestion">
in chat
</Text>
<Text dimColor>
unknown
</Text>
</Box>
<Box flexDirection="row" gap={1}>
<Text color="claude">
▌
</Text>
<Text>
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Button plain label={`${name}`} />
</Box>
<Text color="suggestion">
in chat
</Text>
<Text dimColor>
unknown
</Text>
</Box>
<Box flexDirection="row" gap={1}>
<Text color="claude">
▌
</Text>
<Text>
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Button plain label={`${name}`} />
</Box>
<Text color="suggestion">
in chat
</Text>
<Text dimColor>
unknown
</Text>
</Box>
<Box marginTop={1}>
<Button label="Loading…" />
</Box>
</Box>
<Box flexDirection="column" gap={1} flexGrow={1} flexShrink={1}>
<Box flexDirection="column" borderStyle="round" borderColor="claude" paddingX={1} gap={1}>
<Box flexDirection="row" justifyContent="space-between" gap={1}>
<Box flexShrink={1}>
<Text bold wrap="truncate-end">
{name}
</Text>
</Box>
<Box flexDirection="row" gap={1} flexShrink={0}>
<Text color="suggestion">
in chat
</Text>
<Text>
{"● "}
checking…
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row">
<Box width={8} flexShrink={0}>
<Text dimColor>
Org
</Text>
</Box>
<Text wrap="truncate-middle">
{organization}
</Text>
</Box>
<Box flexDirection="row">
<Box width={8} flexShrink={0}>
<Text dimColor>
Created
</Text>
</Box>
<Text wrap="truncate-middle">
{day}
</Text>
</Box>
<Box flexDirection="row">
<Box width={8} flexShrink={0}>
<Text dimColor>
URL
</Text>
</Box>
<Link href="" label={`${url}`} />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Button variant="secondary" label="In chat ✓" />
<Button label="Loading…" />
</Box>
<Text color="warning" wrap="wrap">
{"Loading runtime wakes this "}
idle
{" Sprite."}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
Services
</Text>
<Text dimColor>
{length}
</Text>
</Box>
<Text dimColor>
Loading…
</Text>
<Text color="error" wrap="wrap">
{message}
</Text>
<Text dimColor>
No services configured.
</Text>
<Box flexDirection="row" gap={1}>
<Text color="success">
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
{name2}
</Text>
</Box>
<Text dimColor>
{status2}
</Text>
<Button label="Logs ✓" />
</Box>
<Box flexDirection="row" gap={1}>
<Text color="success">
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
{name3}
</Text>
</Box>
<Text dimColor>
{status3}
</Text>
<Button label="Logs ✓" />
</Box>
<Box flexDirection="row" gap={1}>
<Text color="success">
●
</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
{name4}
</Text>
</Box>
<Text dimColor>
{status4}
</Text>
<Button label="Logs ✓" />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
Checkpoints
</Text>
<Text dimColor>
{length2}
</Text>
</Box>
<Text dimColor>
Loading…
</Text>
<Text color="error" wrap="wrap">
{message2}
</Text>
<Text dimColor>
No checkpoints.
</Text>
<Box flexDirection="row" gap={1}>
<Box width={8} flexShrink={0}>
<Text bold wrap="truncate-end">
{id}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
No comment
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{day2}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Box width={8} flexShrink={0}>
<Text bold wrap="truncate-end">
{id2}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
No comment
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{day3}
</Text>
</Box>
</Box>
<Box flexDirection="row" gap={1}>
<Box width={8} flexShrink={0}>
<Text bold wrap="truncate-end">
{id3}
</Text>
</Box>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">
No comment
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{day4}
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
{"Logs "}
<Text dimColor>
{"· "}
{service}
{" · last "}
100
{" lines"}
</Text>
</Text>
<Button plain label="Hide" />
</Box>
<Text dimColor>
Loading…
</Text>
<Text color="error" wrap="wrap">
{text}
</Text>
<Text dimColor>
No recent logs.
</Text>
</Box>
</Box>
</Box>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/sprites/hooks/register.tsx 409〜568 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Link, Code } = $.ui.resolve(e)
const Input = e.surface === 'mobile' ? undefined : $.ui.resolve(e).Input
// Coming back to the pane lists again; a drawing only schedules it, since it may not write.
if (e.props.isFocused && !wasFocused) later($, () => refresh($))
wasFocused = e.props.isFocused
const s = await read($, inspector)
const selected = s.selected
const isWide = e.props.bodyColumns >= WIDE_COLUMNS
const hasRuntime = s.services.state !== 'idle' || s.checkpoints.state !== 'idle'
const isRuntimeLoading = s.services.state === 'loading' || s.checkpoints.state === 'loading'
const field = (label: string, value: string) => (
<Box flexDirection="row">
<Box width={LABEL_COLUMNS} flexShrink={0}>
<Text dimColor>{label}</Text>
</Box>
<Text wrap="truncate-middle">{value}</Text>
</Box>
)
const heading = (title: string, detail?: string) => (
<Box flexDirection="row" justifyContent="space-between">
<Text bold>{title}</Text>
{detail ? <Text dimColor>{detail}</Text> : null}
</Box>
)
const search = (
<Box flexDirection="column">
{Input && (
<Input
key="prefix"
placeholder="Filter by name prefix"
value={s.prefix}
submitLabel="Find"
onSubmit={value => later($, () => loadPage($, false, value))}
/>
)}
{s.isListing && <Text dimColor>Loading Sprites…</Text>}
{s.status && (
<Text color={s.statusTone === 'error' ? 'error' : undefined} dimColor={s.statusTone !== 'error'} wrap="wrap">
{s.status}
</Text>
)}
</Box>
)
const list = (
<Box flexDirection="column" width={isWide ? LIST_COLUMNS : undefined} flexShrink={0}>
{s.sprites.length > 0 &&
heading(
'Sprites',
`${s.sprites.length}${s.cursor ? '+' : ''}${s.listedAt !== null ? ` · as of ${timeOfDay(s.listedAt)}` : ''}`,
)}
{!s.sprites.length && !s.isListing && !s.status && (
<Text dimColor>Press Find to list your Sprites, or filter by a name prefix.</Text>
)}
{s.sprites.map(one => {
const isSelected = one.id === selected?.id
return (
<Box key={`row-${one.id}`} flexDirection="row" gap={1}>
<Text color="claude">{isSelected ? '▌' : ' '}</Text>
<Text color={statusColor(one.status)}>●</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
{/* The selected row stays a Button: a focused element that leaves the
tree takes the pane's focus with it, and on desktop the next click
into an unfocused pane only focuses. */}
<Button
key={`sprite-${one.id}`}
plain
label={one.name}
onPress={() => {
if (!isSelected) later($, () => selectSprite($, one))
}}
/>
</Box>
{one.id === s.attachedId && <Text color="suggestion">in chat</Text>}
<Text dimColor>{one.status || 'unknown'}</Text>
</Box>
)
})}
{s.cursor && (
<Box marginTop={1}>
<Button key="more" label={s.isListing ? 'Loading…' : 'Load more'} onPress={() => later($, () => loadPage($, true))} />
</Box>
)}
</Box>
)
const details = selected ? (
<Box flexDirection="column" borderStyle="round" borderColor="claude" paddingX={1} gap={1}>
<Box flexDirection="row" justifyContent="space-between" gap={1}>
<Box flexShrink={1}>
<Text bold wrap="truncate-end">
{selected.name}
</Text>
</Box>
<Box flexDirection="row" gap={1} flexShrink={0}>
{selected.id === s.attachedId && <Text color="suggestion">in chat</Text>}
<Text color={statusColor(selected.status)}>● {s.isChecking ? 'checking…' : selected.status || 'unknown'}</Text>
</Box>
</Box>
<Box flexDirection="column">
{selected.organization && field('Org', selected.organization)}
{selected.created && field('Created', day(selected.created))}
{safeUrl(selected.url) && (
<Box flexDirection="row">
<Box width={LABEL_COLUMNS} flexShrink={0}>
<Text dimColor>URL</Text>
</Box>
<Link href={safeUrl(selected.url) ?? ''} label={selected.url.replace(/^https:\/\//, '').replace(/\/$/, '')} />
</Box>
)}
</Box>
{!s.isChecking && (
<Box flexDirection="column">
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Button
key="attach"
variant={selected.id === s.attachedId ? 'secondary' : 'primary'}
label={selected.id === s.attachedId ? 'In chat ✓' : 'Use in chat'}
onPress={() => later($, () => attach($))}
/>
<Button
key="runtime"
label={isRuntimeLoading ? 'Loading…' : hasRuntime ? 'Refresh runtime' : 'Load runtime'}
onPress={() => later($, () => loadRuntime($))}
/>
</Box>
{!hasRuntime && selected.status !== 'running' && (
<Text color="warning" wrap="wrap">
Loading runtime wakes this {selected.status || 'idle'} Sprite.
</Text>
)}
</Box>
)}
</Box>
) : isWide && s.sprites.length > 0 ? (
<Text dimColor>Select a Sprite to see its details.</Text>
) : null
const services = selected && hasRuntime && (
<Box flexDirection="column">
{heading('Services', s.services.state === 'ready' ? String(s.services.items.length) : undefined)}
{s.services.state === 'loading' && <Text dimColor>Loading…</Text>}
{s.services.state === 'error' && <Text color="error" wrap="wrap">{s.services.message}</Text>}
{s.services.state === 'ready' && !s.services.items.length && <Text dimColor>No services configured.</Text>}
{s.services.items.map(service => (
<Box key={`svc-${service.name}`} flexDirection="row" gap={1}>
<Text color={service.status === 'running' ? 'success' : service.status === 'stopped' ? 'inactive' : 'warning'}>●</Text>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate-end">{service.name}</Text>
</Box>
<Text dimColor>{service.status}</Text>
<Button
key={`logs-${service.name}`}ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Fly.io, Inc. 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 に読んだコミット 398d445f86b6 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/sprites/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 superfly/sprites-claude-plugin/plugin install sprites@sprites入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(398d445f86b6)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「superfly-sprites」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…ReviewPR #3 Fix loginbranche couranteà traiter ▸3 ▸3 ▸3 · en relecture ▸3 ▸3 ▸3▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review────────fil 31/3 Review ↗ GitHub
Review@alexReview@alexReview@alexReviewRéponse : Review publierEntrée publie · Esc annule la réponse · les touches n, p… tapent dans le champ… ReviewLe panneau n'a pas le clavier : ctrl+x tab ou un clic, et les touches marchent.p préc. n suiv. t PR suiv. x démarquer a tout démarquer f corriger (3) r répondre v résoudre o web q fermer -
Claude に頼む…PulseFix loginRefresh (r) rResume (p) pokRefresh rResume pAAPL, BTC/USDT AddAddNot fetchedYour watchlist is empty. Add a ticker above.●Pulse$1.24—Remove$1.24—PulseCached quote · 3●Pulse$1.24—Remove$1.24—PulseCached quote · 3●Pulse$1.24—Remove$1.24—PulseCached quote · 3Yahoo Finance · Binance Spot · Stocks: regular session, exchange delays vary · Crypto: 24h change · Times are local · pulseticker.appTab: move between controls · Enter: activate · Esc: return to prompt
-
slop Edit1 of 3accepteditrejectClaude に頼む…
-
Claude に頼む…Review plannerEXAMPLE · REVIEW PLANNINGPrepare a focused reviewDemo data and a manual checklist. No code has been inspected.Review scope Chat composer: draft handling and keyboard focuscorrectnessView example diffPreparation checklist42%✓Fix loginExample diffUndo✓Fix loginExample diffUndo✓Fix loginExample diffUndoPrepare review promptReset checklistPreparing a prompt only updates the draft. Nothing is sent.
-
Claude に頼む…Mod controlsLive Claude ModCount: 0 / Initial / oneAdd oneName InitialOne**Markdown** with a [link](https://example.com)
const count = 1;
./counter.tsxFill composerAppend noteSuggest draftCopy text -
Claude に頼む…Desktop File DeskDesktop File DeskText file README.md applyFilter lines applyChoose a file to read.
RetryDraft a questionRefresh