haunted-repo
Delete a file and its ghost haunts your prompt, whispering fragments of its lost code until you restore it. Seances, exorcisms, poltergeists and secrets.
何をするか
- プロンプトの上の帯・欄・ステータス行・トーストを描く
- /graveyard・/haunt-demo・/exorcise・/seance を足す
- ツールの呼び出しを見張る(止めることがある)
- prompt.submit・session.start・turn.completeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like haunted-repo by Jason Plimpton (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/choaticpixels-haunted-repo/
// 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 } = $.ui.resolve(e)
const out = '…'
return (
<Box flexDirection="column">
<Box>
<Text color="red">
{out}
</Text>
<Text dimColor>
{` ${out}`}
</Text>
</Box>
<Text italic color="gray">
{` ${out}`}
</Text>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "⚰️ Graveyard" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const length = '…'
const rested = '…'
const line = '…'
const line2 = '…'
const line3 = '…'
const line4 = '…'
const line5 = '…'
const line6 = '…'
const line7 = '…'
const line8 = '…'
const line9 = '…'
const line10 = '…'
const line11 = '…'
const line12 = '…'
const line13 = '…'
const line14 = '…'
const line15 = '…'
const line16 = '…'
const line17 = '…'
const line18 = '…'
const line19 = '…'
const line20 = '…'
const line21 = '…'
const line22 = '…'
const line23 = '…'
const line24 = '…'
const line25 = '…'
const line26 = '…'
const line27 = '…'
return (
<Box flexDirection="column">
<Text color="magenta" bold>
{"⚰️ "}
{length}
{" restless · ✨ "}
{rested}
{" at peace"}
</Text>
<Text dimColor>
Restore a file to free its ghost · /seance to speak · /exorcise to banish
</Text>
<Text>
{" "}
</Text>
<Text dimColor>
Only fog, and the soft sound of a cursor blinking.
</Text>
<Box flexDirection="row">
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line}
</Text>
<Text color="gray">
{line2}
</Text>
<Text color="gray">
{line3}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line4}
</Text>
<Text color="gray">
{line5}
</Text>
<Text color="gray">
{line6}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line7}
</Text>
<Text color="gray">
{line8}
</Text>
<Text color="gray">
{line9}
</Text>
</Box>
</Box>
<Box flexDirection="row">
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line10}
</Text>
<Text color="gray">
{line11}
</Text>
<Text color="gray">
{line12}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line13}
</Text>
<Text color="gray">
{line14}
</Text>
<Text color="gray">
{line15}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line16}
</Text>
<Text color="gray">
{line17}
</Text>
<Text color="gray">
{line18}
</Text>
</Box>
</Box>
<Box flexDirection="row">
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line19}
</Text>
<Text color="gray">
{line20}
</Text>
<Text color="gray">
{line21}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line22}
</Text>
<Text color="gray">
{line23}
</Text>
<Text color="gray">
{line24}
</Text>
</Box>
<Box flexDirection="column" marginRight={1}>
<Text color="gray">
{line25}
</Text>
<Text color="gray">
{line26}
</Text>
<Text color="gray">
{line27}
</Text>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
const path = '…'
await $.ui.status(` 🐈⬛ `)
await $.ui.toast(`👻 You cannot kill what is already dead. ${name} laughs at you.`)
await $.ui.toast(`👻👻👻 "My name is ${name}, for we are many." A horde rises from ${path}`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/haunted-repo/hooks/register.tsx 447〜532 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const list = await read($, ghosts)
const f = await read($, fx)
const w = await read($, whisper)
const t = await read($, frame)
const time = await timeOf($)
const now = time.now
const isPolter = f.poltergeistUntil > now
const isBusted = f.bustedUntil > now
const isTrick = f.trickUntil > now
const isMirror = f.mirrorUntil > now
const isDance = f.danceUntil > now
const isCandles = f.candlesUntil > now
if (list.length === 0 && !isPolter && !isMirror && !isDance && !isCandles && !time.isHalloween) return next(e)
const { Box, Text } = $.ui.resolve(e)
const width = Math.max(30, (e.props.bodyColumns ?? 80) - 2)
const out = (s: string) => (isTrick ? flip(s) : isPolter ? zalgo(s, 1) : s)
if (isMirror) {
return (
<Box flexDirection="column">
<Text color="red" bold>{' 🪞 ' + '░'.repeat(Math.min(40, width - 8))}</Text>
<Text color="red">{t % 4 < 2 ? ' she is behind you.' : ' d o n ’ t t u r n a r o u n d'}</Text>
</Box>
)
}
if (isDance) {
const moves = ['┌(・。・)┘♪', '└(・。・)┐♪', '┌(・o・)┘♫', '└(・o・)┐♫']
return (
<Box>
<Text color="white" bold>{`💀 ${moves[t % 4]} spooky scary skeletons send shivers down your spine ${moves[(t + 2) % 4]} 💀`}</Text>
</Box>
)
}
if (isCandles) {
const flame = t % 2 ? '🕯️' : '🕯'
return (
<Box>
<Text color="yellow">{` ${Array.from({ length: Math.max(1, Math.min(list.length || 3, 13)) }, () => flame).join(' ')} rest in peace`}</Text>
</Box>
)
}
// The drifting procession: each ghost floats along its own sine wave.
const track = Math.max(10, Math.min(width - 24, 70))
const row = Array.from({ length: track }, () => ' ')
if (!isBusted) {
list.slice(-6).forEach((g, i) => {
const phase = (hash(g.id) % 100) / 15
const x = Math.round(((Math.sin(t / (9 + i * 2) + phase) + 1) / 2) * (track - 2))
row[Math.min(track - 1, x)] = g.isBound ? '⛓' : g.kind === 'legion' ? '👥' : g.kind === 'wisp' ? '∿' : '👻'
})
}
const pumpkins = time.isHalloween ? (t % 6 < 3 ? '🎃 ' : '🎃 ') : ''
const header = isBusted
? '🚫👻 the ghosts are hiding…'
: isPolter
? `⚡ ${row.join('').replace(/ /g, () => pick([' ', ' ', ' ', '░', '▒']))} ⚡`
: `${pumpkins}${row.join('')}`
const count = list.length
const tag = count === 0 ? (time.isHalloween ? '🎃 happy halloween' : '') : `⚰ ${count}${count >= MAX_GHOSTS ? ' 🕯️ THE CIRCLE IS COMPLETE' : ''}${time.isWitching ? ' · witching hour' : ''}`
const g = w ? list.find(x => x.id === w.ghostId) : undefined
const isFresh = w !== null && now - w.at < 9_000 && !isBusted
const st = g ? strength(g) : 1
const whisperText = isFresh && w ? `“${fade(w.text, st).slice(0, Math.max(10, width - w.name.length - 12))}” — ${w.name}` : ''
return (
<Box flexDirection="column">
<Box>
<Text color={isPolter ? 'red' : time.isWitching ? 'magenta' : 'gray'}>{out(header)}</Text>
<Text dimColor>{' ' + out(tag)}</Text>
</Box>
{whisperText !== '' && (
<Text italic dimColor={st < 0.5} color={st < 0.25 ? 'gray' : 'cyan'}>
{' ' + out(whisperText)}
</Text>
)}
</Box>
)
})plugins/haunted-repo/hooks/register.tsx 535〜582 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const list = await read($, ghosts)
const rested = Number((await $.store.get('laidToRest')) ?? 0)
const cols = Math.max(1, Math.floor(((e.props.bodyColumns as number | undefined) ?? 40) / 20))
const stone = (g: Ghost) => {
const center = (s: string) => {
const cut = s.length > 15 ? s.slice(0, 14) + '…' : s
const pad = 15 - cut.length
return '│' + ' '.repeat(Math.floor(pad / 2)) + cut + ' '.repeat(Math.ceil(pad / 2)) + '│'
}
const d = new Date(g.diedAt)
const epitaph = EPITAPHS[hash(g.id) % EPITAPHS.length]
return [
' ╭─────────────╮ ',
center(g.isBound ? '⛓ R.I.P. ⛓' : 'R . I . P .'),
center(g.name),
center(g.kind === 'legion' ? `${g.lineCount} souls` : `${g.lineCount} lines`),
center(`${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`),
center(epitaph.slice(0, 15)),
'▁▁│▁▁▁▁▁▁▁▁▁▁▁▁▁│▁▁',
]
}
const rows: Ghost[][] = []
for (let i = 0; i < list.length; i += cols) rows.push(list.slice(i, i + cols))
return (
<Box flexDirection="column">
<Text color="magenta" bold>⚰️ {list.length} restless · ✨ {rested} at peace</Text>
<Text dimColor>Restore a file to free its ghost · /seance to speak · /exorcise to banish</Text>
<Text> </Text>
{list.length === 0 && <Text dimColor>Only fog, and the soft sound of a cursor blinking.</Text>}
{rows.map((r, ri) => (
<Box key={`row-${ri}`} flexDirection="row">
{r.map(g => (
<Box key={g.id} flexDirection="column" marginRight={1}>
{stone(g).map((line, li) => (
<Text key={`${g.id}-${li}`} color={li === 0 || li === 6 ? 'gray' : g.isBound ? 'red' : 'white'}>{line}</Text>
))}
</Box>
))}
</Box>
))}
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Jason Plimpton 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 に読んだコミット dae5c615d2f3 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/haunted-repo/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 choaticpixels/HauntedClaudeMod/plugin install haunted-repo@claude-mods入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(dae5c615d2f3)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「choaticpixels-haunted-repo」をコードごと読んで、同じようなペインを作って似たデザイン
-
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
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
Claude に頼む…TodayOct 63 left · Mar overdueRemCTL: Sep✓ All done for today.● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓Updated 14:32UndoRefresh
-
Claude に頼む…TO graph› Fix login › Fix login › Fix loginScopeThis featureWhole projectHide done stepsReconnect
-
Claude に頼む…InboxUntitled captureFinishing Open in localvoxtralUntitled captureFinishing Open in localvoxtralUntitled captureFinishing Open in localvoxtral
-
Claude に頼む…InboxUntitled captureFinishing Open in localvoxtralUntitled captureFinishing Open in localvoxtralUntitled captureFinishing Open in localvoxtral