sherlog
Groom an issue backlog: find stale, duplicate, vague, unlabeled and unprioritized issues, report them, and apply only the fixes you approve.
何をするか
- プロンプトの上の帯・欄・トーストを描く
- /groom-report を足す
- mcp__sherlog__show_report・mcp__sherlog__mark_results の呼び出しを見張る(止めることがある)
- session.start・ui.closeにフックする
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like sherlog by Sherlemious (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/sherlemious-sherlog/
// 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 scope = '…'
const length = '…'
const applied = '…'
const length2 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" columnGap={2}>
<Text wrap="truncate-end">
<Text bold>
▤ Grooming report
</Text>
<Text dimColor>
{" "}
{"· "}
{scope}
{" · "}
{length}
{" selected · ✓ "}
{applied}
/
{length2}
</Text>
</Text>
<Button hotkey="g" variant="primary" label="Show" />
<Button hotkey="h" dimColor label="Dismiss" />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "sherlog" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Markdown } = $.ui.resolve(e)
const scope = '…'
const tracker = '…'
const scanned = '…'
const applied = '…'
const length = '…'
const skipped = '…'
const icon = '…'
const mark = '…'
const n = '…'
const bars = '…'
const issue = '…'
const action = '…'
const title = '…'
const label = '…'
const action2 = '…'
const reason = '…'
const note = '…'
const draftText = '…'
const url = '…'
const n2 = '…'
const bars2 = '…'
const icon2 = '…'
const action3 = '…'
const title2 = '…'
const label2 = '…'
const action4 = '…'
const reason2 = '…'
const note2 = '…'
const n3 = '…'
const bars3 = '…'
const icon3 = '…'
const action5 = '…'
const title3 = '…'
const label3 = '…'
const action6 = '…'
const reason3 = '…'
const note3 = '…'
return (
<Box flexDirection="column">
<Text>
<Text bold>
{"▤ "}
{scope}
</Text>
<Text dimColor>
{" "}
{"· "}
{tracker}
{" · "}
{scanned}
{" scanned"}
{" · ✓ "}
{applied}
/
{length}
</Text>
</Text>
<Text dimColor wrap="truncate-end">
{"Skipped: "}
{skipped}
</Text>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Button hotkey="y" variant="primary" label={`Apply ${length} selected`} />
<Button hotkey="a" label="Select shown" />
<Button hotkey="c" label="Clear" />
<Button hotkey="q" role="dismiss" label="Hide" />
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Button plain label={`${icon} All 0`} />
<Button plain label={`${icon} All 0`} />
<Button plain label={`${icon} All 0`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button plain label={`${mark}`} />
<Text dimColor>
{n}
</Text>
<Text>
{bars}
</Text>
<Button plain label={`▾ ${issue}`} />
<Text color="yellow">
{" "}
</Text>
<Text>
{icon}
</Text>
<Text wrap="truncate-end">
{action}
</Text>
</Box>
<Box flexDirection="column" marginLeft={4} marginBottom={1} borderStyle="round" borderDimColor paddingX={1}>
<Text bold wrap="truncate-end">
{title}
</Text>
<Text>
<Text dimColor>
{"Priority "}
</Text>
<Text>
–
</Text>
<Text dimColor>
{" "}
{label}
</Text>
</Text>
<Text>
<Text dimColor>
{"Will do "}
</Text>
{action2}
</Text>
<Text>
<Text dimColor>
{"Why "}
</Text>
{reason}
</Text>
<Text color="red">
{"Result: "}
{note}
</Text>
<Box flexDirection="column" marginTop={1}>
<Text color="yellow">
{"✎ "}
Comment
{" to post"}
</Text>
<Markdown text={`${draftText}`} />
<Button plain dimColor label="Show less" />
</Box>
<Markdown text={`[Open in ${tracker} ↗](${url})`} />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button plain label={`${mark}`} />
<Text dimColor>
{n2}
</Text>
<Text>
{bars2}
</Text>
<Button plain label={`▾ ${issue}`} />
<Text color="yellow">
{" "}
</Text>
<Text>
{icon2}
</Text>
<Text wrap="truncate-end">
{action3}
</Text>
</Box>
<Box flexDirection="column" marginLeft={4} marginBottom={1} borderStyle="round" borderDimColor paddingX={1}>
<Text bold wrap="truncate-end">
{title2}
</Text>
<Text>
<Text dimColor>
{"Priority "}
</Text>
<Text>
–
</Text>
<Text dimColor>
{" "}
{label2}
</Text>
</Text>
<Text>
<Text dimColor>
{"Will do "}
</Text>
{action4}
</Text>
<Text>
<Text dimColor>
{"Why "}
</Text>
{reason2}
</Text>
<Text color="red">
{"Result: "}
{note2}
</Text>
<Box flexDirection="column" marginTop={1}>
<Text color="yellow">
{"✎ "}
Comment
{" to post"}
</Text>
<Markdown text={`${draftText}`} />
<Button plain dimColor label="Show less" />
</Box>
<Markdown text={`[Open in ${tracker} ↗](${url})`} />
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button plain label={`${mark}`} />
<Text dimColor>
{n3}
</Text>
<Text>
{bars3}
</Text>
<Button plain label={`▾ ${issue}`} />
<Text color="yellow">
{" "}
</Text>
<Text>
{icon3}
</Text>
<Text wrap="truncate-end">
{action5}
</Text>
</Box>
<Box flexDirection="column" marginLeft={4} marginBottom={1} borderStyle="round" borderDimColor paddingX={1}>
<Text bold wrap="truncate-end">
{title3}
</Text>
<Text>
<Text dimColor>
{"Priority "}
</Text>
<Text>
–
</Text>
<Text dimColor>
{" "}
{label3}
</Text>
</Text>
<Text>
<Text dimColor>
{"Will do "}
</Text>
{action6}
</Text>
<Text>
<Text dimColor>
{"Why "}
</Text>
{reason3}
</Text>
<Text color="red">
{"Result: "}
{note3}
</Text>
<Box flexDirection="column" marginTop={1}>
<Text color="yellow">
{"✎ "}
Comment
{" to post"}
</Text>
<Markdown text={`${draftText}`} />
<Button plain dimColor label="Show less" />
</Box>
<Markdown text={`[Open in ${tracker} ↗](${url})`} />
</Box>
</Box>
</Box>
<Text dimColor>
ctrl+x tab focus · Tab/arrows move · Enter on ▸ expands · Enter on [ ] ticks · ✎ posts text · /groom-report shows or hi…
</Text>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Select at least one item to apply.`)
await $.ui.toast(`Applying the first 25; batches are capped.`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/sherlog/hooks/register.tsx 258〜284 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const shown = await read($, report)
const isQuiet =
e.props.hasSurvey ||
shown === null ||
(await read($, isPaneOpen)) ||
(await read($, isBandHidden))
if (isQuiet || shown === null) return next(e)
const { Box, Text, Button } = $.ui.resolve(e)
const done = await read($, results)
const picked = (await read($, selected)).filter(n => done[String(n)] === undefined)
const applied = Object.values(done).filter(result => result.status === 'applied').length
return (
<Box key="groom-band" flexDirection="row" columnGap={2}>
<Text wrap="truncate-end">
<Text bold>▤ Grooming report</Text>
<Text dimColor>
{' '}
· {shown.scope} · {picked.length} selected · ✓ {applied}/{shown.items.length}
</Text>
</Text>
<Button key="band-show" hotkey="g" variant="primary" label="Show" onPress={() => openPane($, true)} />
<Button key="band-dismiss" hotkey="h" dimColor label="Dismiss" onPress={() => update($, isBandHidden, () => true)} />
</Box>
)
})plugins/sherlog/hooks/register.tsx 338〜497 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Markdown } = $.ui.resolve(e)
const shown = await read($, report)
if (shown === null) {
return <Text dimColor>No grooming report yet. Run /sherlog:groom.</Text>
}
const picked = await read($, selected)
const done = await read($, results)
const filter = await read($, bucket)
const open = await read($, expanded)
const isShowingAll = await read($, showAll)
const visible = filter === 'all' ? shown.items : shown.items.filter(item => item.bucket === filter)
const pickable = picked.filter(n => done[String(n)] === undefined)
const applied = Object.values(done).filter(result => result.status === 'applied').length
const expand = async (n: number) => {
await update($, showAll, () => false)
await update($, expanded, () => n)
}
const toggleExpand = async (n: number) => {
await update($, showAll, () => false)
await update($, expanded, current => (current === n ? null : n))
}
// Ticking a row opens it, so the text it will post is in view.
const toggle = async (n: number) => {
const isNowPicked = !picked.includes(n)
await update($, selected, current =>
current.includes(n) ? current.filter(one => one !== n) : [...current, n],
)
if (isNowPicked) await expand(n)
}
const selectVisible = () =>
update($, selected, current => {
const ids = visible.filter(item => done[String(item.n)] === undefined).map(item => item.n)
return [...new Set([...current, ...ids])]
})
const details = (item: GroomItem) => {
const result = done[String(item.n)]
const priority = priorityOf(item.priority)
const lines = item.draft?.split('\n') ?? []
const isLong = lines.length > DRAFT_LINES
const draftText =
isLong && !isShowingAll ? `${lines.slice(0, DRAFT_LINES).join('\n')}\n…` : item.draft
return (
<Box
key={`details:${item.n}`}
flexDirection="column"
marginLeft={4}
marginBottom={1}
borderStyle="round"
borderDimColor
paddingX={1}
>
<Text bold wrap="truncate-end">
{item.title}
</Text>
<Text>
<Text dimColor>Priority </Text>
<Text color={priority.color}>{priority.bars.trim() === '' ? '–' : priority.bars.trim()}</Text>
<Text dimColor> {priority.label}</Text>
</Text>
<Text>
<Text dimColor>Will do </Text>
{item.action}
</Text>
<Text>
<Text dimColor>Why </Text>
{item.reason}
</Text>
{result?.note !== undefined && <Text color="red">Result: {result.note}</Text>}
{draftText === undefined ? (
<Text dimColor>Nothing will be posted on this issue.</Text>
) : (
<Box flexDirection="column" marginTop={1}>
<Text color="yellow">✎ {item.draftKind ?? 'Comment'} to post</Text>
<Markdown key={`draft:${item.n}`} text={draftText} />
{isLong && (
<Button
key={`more:${item.n}`}
plain
dimColor
label={isShowingAll ? 'Show less' : `Show all (${lines.length - DRAFT_LINES} more lines)`}
onPress={() => update($, showAll, current => !current)}
/>
)}
</Box>
)}
{item.url !== undefined && (
<Markdown key={`link:${item.n}`} text={`[Open in ${shown.tracker} ↗](${item.url})`} />
)}
</Box>
)
}
return (
<Box flexDirection="column">
<Text>
<Text bold>▤ {shown.scope}</Text>
<Text dimColor>
{' '}
· {shown.tracker} · {shown.scanned} scanned
{shown.staleDays === undefined ? '' : ` · ◷ ${shown.staleDays}d`} · ✓ {applied}/
{shown.items.length}
</Text>
</Text>
{shown.skipped !== undefined && (
<Text dimColor wrap="truncate-end">
Skipped: {shown.skipped}
</Text>
)}
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
<Button
key="apply"
hotkey="y"
variant="primary"
label={`Apply ${pickable.length} selected`}
onPress={() => apply($)}
/>
<Button key="select-all" hotkey="a" label="Select shown" onPress={selectVisible} />
<Button key="clear" hotkey="c" label="Clear" onPress={() => update($, selected, () => [])} />
<Button key="close" hotkey="q" role="dismiss" label="Hide" onPress={() => closePane($)} />
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={2} marginTop={1}>
{['all', ...bucketsOf(shown.items)].map(name => {
const count =
name === 'all' ? shown.items.length : shown.items.filter(item => item.bucket === name).length
const icon = name === 'all' ? '≡' : iconOf(name).icon
return (
<Button
key={`bucket:${name}`}
plain
dimColor={filter !== name}
label={`${icon} ${name === 'all' ? 'All' : name} ${count}`}
onPress={() => update($, bucket, () => name)}
/>
)
})}
</Box>
<Box flexDirection="column" marginTop={1}>
{visible.map(item => {
const result = done[String(item.n)]
const isOpen = item.n === open
const icon = iconOf(item.bucket)
const priority = priorityOf(item.priority)
return (
<Box key={`row:${item.n}`} flexDirection="column">
<Box flexDirection="row" columnGap={1}>
<Button
key={`toggle:${item.n}`}
plain
label={mark(result, picked.includes(item.n))}
onPress={() => (result === undefined ? toggle(item.n) : expand(item.n))}
/>
<Text dimColor>{String(item.n).padStart(2)}</Text>
<Text color={priority.color} dimColor={priority.color === undefined}>
{priority.bars}ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Sherlemious 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 に読んだコミット 7e8be4c4bc35 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/sherlog/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 Sherlemious/claude-plugins/plugin install sherlog@sherlemious入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(7e8be4c4bc35)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「sherlemious-sherlog」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…HandoffHandoffHandoff… the rest of the step is in the handoff████████░░░░░░░░ /clear in 4spress 1 to clear now, or send a prompt to stay
-
Claude に頼む…Question guideAwaiting answer Questions from Claude (3)Freeform answer1/3p ◀ Previousn Next ▶l Latesta AI explanation: ONh Hide historyCloseAI tokens this session: 3$1.24▍Your recent instructions▍Claude's preceding explanationCancelledFreeform answerExplainf Full context✦ AI explanation (instructions, context, effects, recommendation)compact context42%Generating… (you can keep answering)Freeform answerCould not generate an explanation: Freeform answerOFF (enable for the next question with [a])────────Past questions and answers31/3 ▶ Selected[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer→ Freeform: Explain31/3 ▶ Selected[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer→ Freeform: Explain31/3 ▶ Selected[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer[Freeform answer] Question guide → Awaiting answer→ Freeform: Explain
-
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 に頼む…Glossary BrowserGlossary openContextsContextsContexts▲ prevWrite1/Glossary▼ nextContexts
-
Claude に頼む…envbuildbuildbuild+ .env.localsrc/app.ts is not in .gitignoreWriteNo .env files in the project root yet.K = paste the value, Enter saves saveNew key: NAME, Enter to continuegenerate randomcancelMissing compared with Write:KKK
-
何をするか
- 欄・プロンプトの上の帯を描く
- Bash の呼び出しを見張る(止めることがある)
- classic.CwdChanged・classic.SessionStart・classic.SubagentStart・classic.UserPromptSubmit ほか 5 個にフックする
- ターンをまたいで自分の状態を持つ