file-explorer
A VS Code-style file explorer pane: tree, git decorations, preview and @-mention
何をするか
- 欄・トーストを描く
- /files・/quote・/ref・/search を足す
- ツールの呼び出しを見張る(止めることがある)
- prompt.submit・session.start・ui.scrollにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like file-explorer by tak-kam (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/tak-kam-file-explorer/
// 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: "‹baseName›" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Input } = $.ui.resolve(e)
const baseName = '…'
const label = '…'
const from = '…'
const path = '…'
const letter = '…'
const value = '…'
const note = '…'
const pick = '…'
return (
<Box flexDirection="row">
<Box flexDirection="column">
<Box flexDirection="row" justifyContent="space-between">
<Text bold>
{baseName}
</Text>
<Box flexDirection="row" gap={1}>
<Button label="follow" plain dimColor />
<Button label="↻" plain />
<Button label="⊟" plain />
<Button label="@" plain />
</Box>
</Box>
<Box flexDirection="row" gap={1} />
<Box flexDirection="row" gap={1} />
<Box flexDirection="row" gap={1} />
<Box flexDirection="row" gap={1}>
<Text dimColor>
vs
</Text>
<Button label={`${label}`} plain />
</Box>
<Input placeholder="ref or a..b (empty = HEAD)" />
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Button label="Name" plain dimColor />
<Button label="Text" plain dimColor />
<Button label="Aa" plain dimColor />
<Button label=".*" plain dimColor />
</Box>
<Input placeholder="text in files (Enter)" />
<Text dimColor>
ripgrep, ignore files honoured
</Text>
</Box>
</Box>
<Box width={1} marginRight={1}>
<Text dimColor>
{from}
</Text>
</Box>
<Box flexDirection="column" flexGrow={1}>
<Text bold>
{path}
</Text>
<Box flexDirection="row" gap={1} />
<Box flexDirection="row" gap={1} />
<Box flexDirection="row" gap={1} />
<Text dimColor>
<Text color="yellow">
{letter}
</Text>
{value}
</Text>
<Text dimColor>
{note}
</Text>
<Text color="blue">
{`at ${pick}`}
</Text>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
await $.ui.toast(`No main or master branch to compare with`)
await $.ui.toast(`Not a ref: ${name}`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
file-explorer/hooks/register.tsx 2335〜2355 行 · ペイン
on('ui.render', { component: 'Pane', requestId: EXPLORER }, async ($, e) => {
const els = $.ui.resolve(e)
const { Box, Text } = els
const Input = e.surface === 'mobile' ? undefined : $.ui.resolve(e).Input
const width = Math.max(20, e.props.bodyColumns)
const rows = Math.max(8, e.props.scroll.bodyRows)
layout.isSplit = width >= SPLIT_MIN_COLUMNS
if (!layout.isSplit) return drawSidebar($, els, Input, width, undefined)
const sidebar = clamp(Math.floor(width * 0.32), 26, 44)
layout.sidebarColumns = sidebar
return (
<Box flexDirection="row">
{await drawSidebar($, els, Input, sidebar, rows)}
<Box width={1} marginRight={1}>
<Text dimColor>{Array.from({ length: rows }, () => '│').join('\n')}</Text>
</Box>
{await drawPreview($, els, width - sidebar - 2, rows, false, e.surface)}
</Box>
)
})file-explorer/hooks/register.tsx 1285〜1444 行 · ペイン
async function drawSidebar(
$: EngineInterface,
els: Elements,
Input: InputElement,
width: number,
rows: number | undefined,
): Promise<RenderElement> {
const { Box, Text, Button } = els
const dir = await read($, root)
const current = await read($, view)
const list = await read($, changes)
const edited = new Set(await read($, touched))
const chosen = await read($, selected)
const against = await read($, base)
let lines: { key: string; node: () => RenderElement }[] = []
const isHidingIgnored = await read($, hideIgnored)
// The tabs and the list's scroll Buttons, measured and packed into rows
// that fit the sidebar: a Button pushed off the edge loses its hotkey.
const isRoomy = width >= 44
type Tab = { key: string; cells: number; draw: () => RenderElement }
const tab = (key: ExplorerView, label: string, hotkey: string): Tab => ({
key,
cells: buttonCells(label, true),
draw: () => (
<Button key={`tab:${key}`} label={label} plain hotkey={hotkey} dimColor={current === key ? undefined : true}
onPress={async () => {
await update($, view, () => key)
// The search tab is for typing: its field takes the focus, and only then.
if (key === 'search') await focusOn($, 'search-input')
}} />
),
})
const tabItems: Tab[] = [
tab('files', 'Files', 'f'),
tab('changes', `${isRoomy ? 'Changes' : 'Chg'} ${list.length}`, 'c'),
tab('history', isRoomy ? 'History' : 'Log', 'h'),
tab('search', isRoomy ? 'Search' : 'Find', 's'),
tab('outline', isRoomy ? 'Outline' : 'Out', 't'),
{
key: 'ignored',
cells: buttonCells('⊘', true),
draw: () => (
<Button key="ignored" label="⊘" plain hotkey="g" dimColor={isHidingIgnored ? undefined : true}
onPress={() => update($, hideIgnored, now => !now)} />
),
},
{
key: 'help',
cells: buttonCells('?', true),
draw: () => <Button key="help" label="?" plain hotkey="i" onPress={() => toggleHelp($)} />,
},
]
// Always drawn in the split view, dim when the list fits: these sit
// before the search field, and a control appearing or vanishing there as
// results change moved the focus off the field mid-typing.
if (rows !== undefined) {
tabItems.push({
key: 'list:up',
cells: buttonCells('▲', false),
draw: () => (
<Button key="list:up" label="▲" plain dimColor={isOver ? undefined : true}
onPress={() => scroll(-Math.max(1, room - 2))} />
),
})
tabItems.push({
key: 'list:down',
cells: buttonCells('▼', false),
draw: () => (
<Button key="list:down" label="▼" plain dimColor={isOver ? undefined : true}
onPress={() => scroll(Math.max(1, room - 2))} />
),
})
}
const tabRows = packRows(tabItems, Math.max(8, width))
let fixed = 1 + tabRows.length
const extra: RenderElement[] = []
if (current === 'search') {
const found = await read($, search)
fixed += 3
if (Input === undefined) extra.push(<Text dimColor>Search needs a surface with text input.</Text>)
if (found.mode === 'files') {
lines = found.files.map(path => {
const icon = iconFor(baseName(path), false, false, layout.icons)
const room = width - 2 - iconWidth(icon, layout.icons)
const label = fit(baseName(path), room)
const rest = room - label.length - 1
return {
key: path,
node: () => (
<Box key={`line:${path}`} flexDirection="row">
<Text color="blue">{path === chosen ? '▌' : ' '}</Text>
{icon.glyph !== '' && <Text color={icon.color}>{icon.glyph}</Text>}
<Button key={`found:${path}`} label={label} plain onPress={() => openFound($, path)} />
{parentOf(path) !== '' && rest > 3 && <Text dimColor> {fit(parentOf(path), rest)}</Text>}
</Box>
),
}
})
} else {
let lastPath = ''
const pattern = compileQuery(found.query, found)
const counts = new Map<string, number>()
for (const hit of found.hits) counts.set(hit.path, (counts.get(hit.path) ?? 0) + 1)
for (const hit of found.hits) {
if (hit.path !== lastPath) {
lastPath = hit.path
const icon = iconFor(baseName(hit.path), false, false, layout.icons)
const count = ` ${counts.get(hit.path) ?? 0}`
const room = width - 1 - iconWidth(icon, layout.icons) - count.length
lines.push({
key: `file:${hit.path}`,
node: () => (
<Box key={`hits:${hit.path}`} flexDirection="row">
<Text color="blue">{hit.path === chosen ? '▌' : ' '}</Text>
{icon.glyph !== '' && <Text color={icon.color}>{icon.glyph}</Text>}
<Button key={`hitfile:${hit.path}`} label={fit(hit.path, room)} plain onPress={() => openHit($, hit)} />
<Box flexGrow={1} />
<Text dimColor>{count}</Text>
</Box>
),
})
}
const number = String(hit.line)
const room = width - 4 - number.length
lines.push({
key: `${hit.path}:${hit.line}:${hit.column}`,
node: () => {
const piece = excerpt(hit.text, matchSpan(hit.text, pattern), room)
return (
<Box key={`hitline:${hit.path}:${hit.line}:${hit.column}`} flexDirection="row">
<Text>{' '}</Text>
<Button key={`hit:${hit.path}:${hit.line}:${hit.column}`} label={number} plain dimColor onPress={() => openHit($, hit)} />
<Text> {piece.before}</Text>
<Text color="black" backgroundColor="yellow">{piece.hit}</Text>
<Text>{piece.after}</Text>
</Box>
)
},
})
}
}
} else if (current === 'history') {
const narrowed = await read($, historyOf)
const ofFile = narrowed === '' ? [] : await read($, fileHistory)
const commits: (ExplorerCommit & { path?: string })[] = narrowed === '' ? await read($, history) : ofFile
if (narrowed !== '') {
extra.push(
<Box key="history:of" flexDirection="row">
<Text color="blue">{fit(`⌚ ${narrowed}`, Math.max(4, width - 6))}</Text>
<Box flexGrow={1} />
<Button key="history:all" label="✕" plain onPress={() => update($, historyOf, () => '')} />
</Box>,
)
}
if (commits.length === 0) extra.push(<Text dimColor>No commits.</Text>)
lines = commits.map(commit => {
const room = width - commit.short.length - 2
const subject = fit(commit.subject, room)file-explorer/hooks/register.tsx 1217〜1272 行 · ペイン
async function drawSearchControls(
$: EngineInterface,
els: Elements,
Input: InputElement,
width: number,
): Promise<RenderElement> {
const { Box, Text, Button } = els
const found = await read($, search)
const isText = found.mode === 'text'
const setMode = (mode: 'files' | 'text') => async () => {
await update($, search, now => ({ ...now, mode }))
const now = await read($, search)
if (mode === 'files') await searchFiles($, now.query)
else if (now.hits.length === 0) await searchText($, now.query)
}
return (
<Box flexDirection="column">
<Box flexDirection="row" gap={1}>
<Button key="search:files" label="Name" plain dimColor={isText ? true : undefined} onPress={setMode('files')} />
<Button key="search:text" label="Text" plain dimColor={isText ? undefined : true} onPress={setMode('text')} />
{isText && (
<Button key="search:case" label="Aa" plain dimColor={found.isCaseSensitive ? undefined : true}
onPress={() => toggleSearchFlag($, 'isCaseSensitive')} />
)}
{isText && (
<Button key="search:regex" label=".*" plain dimColor={found.isRegex ? undefined : true}
onPress={() => toggleSearchFlag($, 'isRegex')} />
)}
</Box>
{Input !== undefined && (
<Input
key="search-input"
placeholder={isText ? 'text in files (Enter)' : 'file name'}
onInput={async (value: string) => {
if (isText) await update($, search, now => ({ ...now, query: value }))
else await searchFiles($, value)
// Keep typing in the field however much the results moved around it.
await $.ui.focus({ requestId: EXPLORER, key: 'search-input' }).catch(() => undefined)
}}
onSubmit={async (value: string) => {
if (isText) {
await searchText($, value)
const first = (await read($, search)).hits[0]
if (first !== undefined) await focusOn($, `hit:${first.path}:${first.line}:${first.column}`)
return
}
await searchFiles($, value)
const first = (await read($, search)).files[0]
if (first !== undefined) await openFound($, first)
}}
/>
)}
<Text dimColor>{fit(found.note || (isText ? 'ripgrep, ignore files honoured' : 'fuzzy, as you type'), width)}</Text>
</Box>
)
}file-explorer/hooks/register.tsx 1664〜1823 行 · ペイン
async function drawPreview(
$: EngineInterface,
els: Elements,
width: number,
rows: number | undefined,
isOwnPane: boolean,
surface: RenderSurface,
): Promise<RenderElement> {
const { Box, Text, Button, Code, Markdown } = els
const shown = await read($, preview)
if (shown === null) {
return (
<Box flexDirection="column" flexGrow={1}>
<Text dimColor>Select a file in the explorer.</Text>
</Box>
)
}
const list = await read($, changes)
const against = await read($, base)
const at = list.findIndex(one => one.path === shown.path)
const change = list[at]
const verb = against.head === undefined ? 'vs' : 'in'
const step = (by: number) => {
const target = at < 0 ? list[0] : list[(at + by + list.length) % list.length]
if (target !== undefined) void showPath($, target.path, { mode: 'diff' })
}
// Each hunk is a label row and its lines; the file is its lines.
const hunks = shown.mode === 'diff' ? splitHunks(shown.diff) : []
const isSource = shown.mode === 'file' || shown.mode === 'rendered'
const fileLines = isSource && shown.text !== '' ? shown.text.replace(/\n$/, '').split('\n') : []
const hunkRows = hunks.map(hunk => hunk.body.replace(/\n$/, '').split('\n').length)
// A data file: each table or tree row one terminal row, cut, never wrapped.
const parsed = shown.mode === 'data' && shown.text !== '' ? dataFor(shown) : undefined
const tree = parsed?.kind === 'tree' ? await read($, dataView) : undefined
const nodes = parsed?.kind === 'tree' && tree !== undefined
? jsonRows(parsed.root, new Set(tree.path === shown.path ? tree.toggled : []), 2, MAX_DATA_ROWS)
: []
const pick = tree !== undefined && tree.path === shown.path ? tree.pick : ''
const dataTotal = parsed === undefined ? 0 : parsed.kind === 'table' ? parsed.lines.length : parsed.kind === 'tree' ? nodes.length : 1
const total = shown.mode === 'data' ? dataTotal : isSource ? fileLines.length : hunkRows.reduce((sum, n) => sum + n, 0)
const blamed = await read($, blame)
const blameOf = blamed !== null && blamed.path === shown.path && shown.mode === 'file' ? blamed : undefined
// Blame lines up beside the source one row a line: no wrapping under it.
const isWrapped = (await read($, wrapLines)) && blameOf === undefined
const blameCells = blameOf === undefined ? 0 : width >= 70 ? 24 : 8
const isTable = parsed?.kind === 'table'
const shift = isWrapped && !isTable ? 0 : await read($, sideways)
const isMd = isMarkdown(shown.path)
const isDataFile = isData(shown.path)
const lineRoomEstimate = Math.max(10, width - String(Math.max(total, 1)).length * (shown.mode === 'diff' ? 2 : 1) - 6)
const tableWidest = parsed?.kind === 'table' ? widest(parsed.lines.map(one => one.text)) : 0
const canShiftEstimate =
(isTable && tableWidest > width - 2) ||
(!isWrapped &&
(shown.mode === 'file' || shown.mode === 'diff') &&
widest(isSource ? fileLines : hunks.map(hunk => hunk.body).join('\n').split('\n')) > lineRoomEstimate)
// The toolbar, each Button with the cells it draws in, packed into rows
// that fit: a row that overflowed dropped its last Buttons, hotkeys and all.
type Tool = { key: string; cells: number; draw: () => RenderElement }
const tool = (key: string, label: string, hotkey: string | undefined, draw: () => RenderElement): Tool => ({
key,
cells: buttonCells(label, hotkey !== undefined),
draw,
})
const tools: Tool[] = []
// Placeholders for closures defined once the window is known.
const late: { scroll: (by: number) => unknown; slide: (by: number) => unknown; isOver: boolean; room: number; shift: number } = {
scroll: () => undefined,
slide: () => undefined,
isOver: false,
room: 1,
shift,
}
if (shown.isOnDisk && isMd) {
tools.push(tool('mode:rendered', 'Preview', 'm', () => (
<Button key="mode:rendered" label="Preview" plain hotkey="m" dimColor={shown.mode === 'rendered' ? undefined : true}
onPress={() => showPath($, shown.path, { mode: 'rendered' })} />
)))
}
if (shown.isOnDisk && isDataFile) {
const label = isDelimited(shown.path) ? 'Table' : 'Tree'
tools.push(tool('mode:data', label, 'm', () => (
<Button key="mode:data" label={label} plain hotkey="m" dimColor={shown.mode === 'data' ? undefined : true}
onPress={() => showPath($, shown.path, { mode: 'data' })} />
)))
}
if (shown.isOnDisk && (isMd || isDataFile || shown.isChanged)) {
const label = isMd || isDataFile ? 'Source' : 'File'
tools.push(tool('mode:file', label, 'o', () => (
<Button key="mode:file" label={label} plain hotkey="o" dimColor={shown.mode === 'file' ? undefined : true}
onPress={() => showPath($, shown.path, { mode: 'file' })} />
)))
}
if (shown.isChanged) {
tools.push(tool('mode:diff', 'Diff', 'd', () => (
<Button key="mode:diff" label="Diff" plain hotkey="d" dimColor={shown.mode === 'diff' ? undefined : true}
onPress={() => showPath($, shown.path, { mode: 'diff' })} />
)))
}
// Always drawn, dim when there is nowhere to go, so the toolbar's
// Buttons never shift under the focus as the content changes.
tools.push(tool('up', '▲', 'k', () => (
<Button key="up" label="▲" plain hotkey="k" dimColor={late.isOver ? undefined : true}
onPress={() => late.scroll(-Math.max(1, Math.floor(late.room / 2)))} />
)))
tools.push(tool('down', '▼', 'j', () => (
<Button key="down" label="▼" plain hotkey="j" dimColor={late.isOver ? undefined : true}
onPress={() => late.scroll(Math.max(1, Math.floor(late.room / 2)))} />
)))
if (list.length > 0) {
tools.push(tool('prev', '‹', 'p', () => <Button key="prev" label="‹" plain hotkey="p" onPress={() => step(-1)} />))
tools.push(tool('next', '›', 'n', () => <Button key="next" label="›" plain hotkey="n" onPress={() => step(1)} />))
}
tools.push(tool('wrap', '↩', 'w', () => (
<Button key="wrap" label="↩" plain hotkey="w" dimColor={isWrapped ? undefined : true}
onPress={() => update($, wrapLines, now => !now)} />
)))
if (canShiftEstimate) {
tools.push(tool('left', '◀', undefined, () => (
<Button key="left" label="◀" plain dimColor={late.shift === 0 ? true : undefined} onPress={() => late.slide(-1)} />
)))
tools.push(tool('right', '▶', undefined, () => <Button key="right" label="▶" plain onPress={() => late.slide(1)} />))
}
if (shown.isHelp !== true) {
tools.push(tool('quote', '❝', 'q', () => <Button key="quote" label="❝" plain hotkey="q" onPress={() => quoteSelection($, shown.path)} />))
tools.push(tool('ref', '#', 'r', () => <Button key="ref" label="#" plain hotkey="r" onPress={() => referenceLines($, shown)} />))
tools.push(tool('copy', '⧉', 'y', () => (
<Button key="copy" label="⧉" plain hotkey="y" onPress={press => copyPath($, shown.path, press.surface)} />
)))
const isPinned = (await read($, pins)).includes(shown.path)
tools.push(tool('pin', '★', 'b', () => (
<Button key="pin" label={isPinned ? '★' : '☆'} plain hotkey="b" onPress={() => togglePin($, shown.path)} />
)))
const isRepo = (await read($, gitError)) !== 'Not a git repository'
if (isRepo) {
tools.push(tool('log', 'Log', 'l', () => <Button key="log" label="Log" plain hotkey="l" onPress={() => showFileLog($, shown.path)} />))
}
if (isRepo && shown.isOnDisk) {
tools.push(tool('blame', 'Blame', 'a', () => (
<Button key="blame" label="Blame" plain hotkey="a" dimColor={blameOf === undefined ? true : undefined}
onPress={() => toggleBlame($, shown.path)} />
)))
}
}
if (isOwnPane) {
tools.push(tool('mention', '@', undefined, () => <Button key="mention" label="@" plain onPress={() => mention($, shown.path)} />))
tools.push(tool('close', '✕', undefined, () => (
<Button key="close" label="✕" plain role="dismiss" onPress={() => $.ui.close({ id: PREVIEW })} />
)))
}
const toolRows = packRows(tools, Math.max(8, width - 1))
const hasStatus = shown.isChanged || total > 0 || shown.size !== undefined
const nowMs = await clockNow($)
const ageText = shown.mtimeMs === undefined ? '' : formatAge(shown.mtimeMs, nowMs)
const fixed = 1 + toolRows.length + (hasStatus ? 1 : 0) + (shown.note !== '' ? 1 : 0) + (pick !== '' ? 1 : 0)
const room = rows === undefined ? total : Math.max(1, rows - fixed)
// The rows each unit takes: a line wrapped into the room beside its gutterライセンスの全文(MIT)
MIT License Copyright (c) 2026 Takahiro Kamekura 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 に読んだコミット 838adcb8d602 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。file-explorer/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。14 ファイルを解析 |
| コードが 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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。file-explorer/hooks/register.tsx:679 実行時に決まるプログラム; file-explorer/hooks/register.tsx:741 実行時に決まるプログラム; file-explorer/hooks/register.tsx:784 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add tak-kam/claude-mods/plugin install file-explorer@claude-mods入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(838adcb8d602)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「tak-kam-file-explorer」をコードごと読んで、同じようなペインを作って似たデザイン
-
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
-
Claude に頼む…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Claude に頼む…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd
-
Claude に頼む…Approved appsApproved appsComputer use can control these apps without asking.High riskAlways allowed (3)None. Allow one below.Not installed (3)This conversation (3)None.Allow an app App name, bundle id or path allowbuilda1b2c3dbuilda1b2c3dbuilda1b2c3d
-
Claude に頼む…great_cto: 3 gate waiting — /gatesGatesmy-app · 3 waiting · checked Gates UTCGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approveGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approveGates — Fix logina1b2c3dExpensive to undo. To approve, type Gates and press Enter.approve: Gates approve
-
slop Edit1 of 3accepteditrejectClaude に頼む…