oxen-pet
A pixel Luffy above the Claude Code prompt who acts out each tool call in five gears, an HP/MP/ST HUD for context, rate limits, and prompt cache, a shield that asks before destructive commands, a bug boss for failing tests, and a /pet stat…
何をするか
- 欄・プロンプトの上の帯・ステータス行・トーストを描く
- Bash の呼び出しを見張る(止めることがある)
- session.start・turn.completeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like oxen-pet by NhonNguyen (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/thanhnhoncntt-oxen-pet/
// 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: "oxen-pet" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Svg, Text } = $.ui.resolve(e)
const encodeSvg = '…'
const name = '…'
const label = '…'
const value = '…'
const value2 = '…'
const value3 = '…'
return (
<Box gap={2}>
<Svg source={`${encodeSvg}`} alt={`${name}, happy`} />
<Box flexDirection="column">
<Box>
<Text bold>
{`${label} `}
</Text>
<Text color="#8b93b8">
{value}
</Text>
</Box>
<Box>
<Text bold>
{`${label} `}
</Text>
<Text color="#8b93b8">
{value2}
</Text>
</Box>
<Box>
<Text bold>
{`${label} `}
</Text>
<Text color="#8b93b8">
{value3}
</Text>
</Box>
</Box>
</Box>
)
})
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Svg, Text } = $.ui.resolve(e)
const encodeSvg = '…'
const name = '…'
const mode = '…'
const line = '…'
const bossAlt = '…'
const label = '…'
const key = '…'
const pct = '…'
const text = '…'
const text2 = '…'
const text3 = '…'
const label2 = '…'
const text4 = '…'
const text5 = '…'
const text6 = '…'
const label3 = '…'
const text7 = '…'
const text8 = '…'
const text9 = '…'
return (
<Box flexDirection="column">
<Box alignItems="flex-end">
<Box>
<Svg source={`${encodeSvg}`} alt={`${name}, ${mode}`} />
</Box>
<Text bold>
{line}
</Text>
<Box flexGrow={1} />
<Svg source={`${encodeSvg}`} alt={`${bossAlt}`} />
</Box>
<Box flexDirection="row" alignSelf="flex-start">
<Box alignItems="center">
<Text>
{" │ "}
</Text>
<Text>
{label}
{" "}
</Text>
<Svg source={`${encodeSvg}`} alt={`${key} bar, ${pct}% left`} />
<Text>
{text}
</Text>
<Text>
{text2}
</Text>
<Text>
{text3}
</Text>
</Box>
<Box alignItems="center">
<Text>
{" │ "}
</Text>
<Text>
{label2}
{" "}
</Text>
<Svg source={`${encodeSvg}`} alt={`${key} bar, ${pct}% left`} />
<Text>
{text4}
</Text>
<Text>
{text5}
</Text>
<Text>
{text6}
</Text>
</Box>
<Box alignItems="center">
<Text>
{" │ "}
</Text>
<Text>
{label3}
{" "}
</Text>
<Svg source={`${encodeSvg}`} alt={`${key} bar, ${pct}% left`} />
<Text>
{text7}
</Text>
<Text>
{text8}
</Text>
<Text>
{text9}
</Text>
</Box>
</Box>
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
const err = '…'
const errors = '…'
const DEFAULT_THEME = '…'
const name = '…'
const message = '…'
await $.ui.status(`oxen-pet: ${err}`)
await $.ui.toast(`oxen-pet: your theme no longer reads (${errors}). Showing ${DEFAULT_THEME}.`)
await $.ui.toast(`oxen-pet: the ${name} theme does not read (${message}). Showing ${DEFAULT_THEME}.`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/oxen-pet/hooks/register.tsx 483〜527 行 · ペイン
on('ui.render', { component: 'Pane' }, async ($, e, next) => {
if (e.requestId !== PANE_ID) {
return next(e)
}
if (!body) {
body = await keptBody($, settings.theme, settings.customDir)
}
const now = await $.clock.now()
const rows = statsRows(stats, now, hud, settings.targets)
const labelW = Math.max(...rows.map(r => r.label.length))
const face = composeFace(body, stats.bosses > 0 ? 'star' : 'happy', now)
const frame = frameColor(body.look.hud)
if (e.surface === 'terminal') {
const { Box, Raster, Text } = $.ui.resolve(e)
return (
<Box gap={2}>
<Raster key="face" columns={BODY_W} rows={ROWS} cells={encodeCells(face)} />
<Box flexDirection="column">
{rows.map(r => (
<Box key={r.label}>
<Text color={frame} bold>{`${r.label.padEnd(labelW)} `}</Text>
<Text color={DETAIL_COLOR}>{r.value}</Text>
</Box>
))}
</Box>
</Box>
)
}
const { Box, Svg, Text } = $.ui.resolve(e)
return (
<Box gap={2}>
<Svg key="face" source={encodeSvg(face)} alt={`${body.name}, happy`} width={BODY_W * SVG_PX} height={HEIGHT * SVG_PX} />
<Box flexDirection="column">
{rows.map(r => (
<Box key={r.label}>
<Text color={frame} bold>{`${r.label.padEnd(labelW)} `}</Text>
<Text color={DETAIL_COLOR}>{r.value}</Text>
</Box>
))}
</Box>
</Box>
)
})plugins/oxen-pet/hooks/register.tsx 632〜788 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
try {
if (e.props.hasSurvey) {
return next(e)
}
isWorking = e.props.isWorking
bodyColumns = e.props.bodyColumns
if (!body) {
body = await keptBody($, settings.theme, settings.customDir)
}
const a = await read($, anim)
const now = await $.clock.now()
const elapsed = now - a.since
const views = minisOnScreen(minis, now)
// A leap is the run mode playing the jump clip, slowed, while the pet travels.
const drawn = a.leap ? { mode: 'jump' as const, ms: leapClipMs((now - a.leap.since) * settings.pace) } : { mode: a.mode, ms: elapsed * settings.pace }
const picture = compose(body, drawn.mode, drawn.ms, a.dir, hud ? mood(hud) : 'ok', views)
const extra = views.length > MAX_MINIS ? ` (+${views.length - MAX_MINIS} minis)` : ''
const shielded = shield !== undefined && guarding === 0 && now < shield.until ? guardLine(shield.result) : undefined
const noticed = notice !== undefined && now < notice.until ? notice.text : undefined
const line = settings.statusLine ? (shielded ?? noticed ?? statusLine(a.mode, a.since, elapsed, a.target, body.look.lines[a.mode])) + extra : ''
const tint = noticed && !shielded ? NOTICE_COLOR : lineColor(a.mode, body.look.lineColors)
if (showsError) {
showsError = false
$.ui.status(undefined)
}
const scene = sceneLayout(body)
const shownBoss = settings.boss ? bossOnScreen(boss, now) : undefined
const bossArt = shownBoss && drawBoss(shownBoss, now)
const bossW = bossArt ? BOSS_W + 1 : 0
if (e.surface === 'terminal' && scene && body.scene) {
const { Box, Raster, Text } = $.ui.resolve(e)
const width = scene.width
const textW = line ? lineWidth(line) + 3 : 0
const left = Math.max(0, Math.min(Math.round(a.x), width - picture.w - textW - bossW))
const band = drawBand(body, body.scene, scene, picture, left, now)
if (bossArt) {
overlay(band, bossArt, width - bossW)
}
const cells = (x: number, y: number, w: number, h: number) => encodeCells(crop(band, x, y, w, h))
// The status line cuts a hole in the band; the band shows above, below, and right of it.
const textAt = left + picture.w
const shown = Math.min(textW, width - textAt)
const rest = width - textAt - shown
return (
<Box flexDirection="column" height={ROWS + GROUND_ROWS}>
<Box height={ROWS}>
<Raster key="pet" columns={textAt} rows={ROWS} cells={cells(0, 0, textAt, HEIGHT)} />
{shown > 0 && (
<Box key="line" flexDirection="column" width={shown}>
<Raster key="above" columns={shown} rows={ROWS - 2} cells={cells(textAt, 0, shown, HEIGHT - 4)} />
<Text color={tint} bold wrap="truncate">
{` › ${line}`}
</Text>
<Raster key="below" columns={shown} rows={1} cells={cells(textAt, HEIGHT - 2, shown, 2)} />
</Box>
)}
{rest > 0 && <Raster key="rest" columns={rest} rows={ROWS} cells={cells(textAt + shown, 0, rest, HEIGHT)} />}
</Box>
<Raster key="ground" columns={width} rows={GROUND_ROWS} cells={cells(0, HEIGHT, width, GROUND_H)} />
</Box>
)
}
if (e.surface === 'terminal') {
const { Box, Raster, Text } = $.ui.resolve(e)
const room = Math.max(0, bodyColumns - picture.w - line.length - 4 - bossW)
return (
<Box height={ROWS} width={bandWidth()}>
<Box marginLeft={Math.min(Math.round(a.x), room)} alignItems="flex-end">
<Raster key="pet" columns={picture.w} rows={ROWS} cells={encodeCells(picture)} />
{line && (
<Box marginBottom={1} marginLeft={1}>
<Text color={tint} bold>
› {line}
</Text>
</Box>
)}
</Box>
{bossArt && <Box flexGrow={1} />}
{bossArt && <Raster key="boss" columns={BOSS_W} rows={ROWS} cells={encodeCells(bossArt)} />}
</Box>
)
}
if (e.surface === 'desktop') {
// The desktop has no Raster: the pet, its scene and the HUD's bars draw as SVG, and the HUD sits in the band,
// since the desktop's hint line under the prompt is its own.
const { Box, Svg, Text } = $.ui.resolve(e)
const rows = settings.hud && hud ? hudRows({ ...hud, cacheMin: cacheLeftMin(lastTurnEndAt, settings.cacheTtlMin, now) }, body.look.hud, settings.hudRow) : []
const hudFrame = frameColor(body.look.hud)
const hudBox = rows.length > 0 && (
<Box key="hud" flexDirection={settings.hudRow ? 'row' : 'column'} alignSelf="flex-start" {...(settings.hudRow ? {} : { borderStyle: 'round', borderColor: hudFrame, paddingX: 1 })}>
{rows.map((r, k) => (
<Box key={r.key} alignItems="center">
{settings.hudRow && k > 0 && <Text color={hudFrame}>{ROW_GAP}</Text>}
<Text color={r.color}>{r.label} </Text>
<Svg source={encodeSvg(r.bar)} alt={`${r.key.toUpperCase()} bar, ${r.pct}% left`} width={r.bar.w * HUD_SVG_PX} height={r.bar.h * HUD_SVG_PX} />
{r.parts.map((p, i) => (
<Text key={String(i)} color={p.color} bold={p.bold}>
{p.text}
</Text>
))}
</Box>
))}
</Box>
)
if (scene && body.scene) {
const width = Math.min(scene.width, DESKTOP_BAND_W)
const left = Math.max(0, Math.min(Math.round(a.x), width - picture.w - bossW))
const band = crop(drawBand(body, body.scene, scene, picture, left, now), 0, 0, width, HEIGHT + GROUND_H)
if (bossArt) {
overlay(band, bossArt, width - bossW)
}
return (
<Box flexDirection="column">
<Svg source={encodeSvg(band)} alt={`${body.name}, ${a.mode}, in its scene`} width={width * SVG_PX} height={band.h * SVG_PX} />
{line && (
<Text color={tint} bold>
› {line}
</Text>
)}
{hudBox}
</Box>
)
}
return (
<Box flexDirection="column">
<Box alignItems="flex-end">
<Box marginLeft={Math.round(a.x)}>
<Svg source={encodeSvg(picture)} alt={`${body.name}, ${a.mode}`} width={picture.w * SVG_PX} height={HEIGHT * SVG_PX} />
</Box>
{line && (
<Text color={tint} bold>
{line}
</Text>
)}
{shownBoss && bossArt && <Box flexGrow={1} />}
{shownBoss && bossArt && <Svg key="boss" source={encodeSvg(bossArt)} alt={bossAlt(shownBoss)} width={BOSS_W * SVG_PX} height={HEIGHT * SVG_PX} />}
</Box>
{hudBox}
</Box>
)
}
return next(e)
} catch (err) {
showsError = true
$.ui.status(`oxen-pet: ${String(err)}`)
return next(e)
}
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 halluqinate Copyright (c) 2026 NhonNguyen (oxen-pet fork) 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 に読んだコミット 014cf61e65ed のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/oxen-pet/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。15 ファイルを解析 |
| コードが 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 thanhnhoncntt/oxen-pet/plugin install oxen-pet@oxen-pet入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(014cf61e65ed)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「thanhnhoncntt-oxen-pet」をコードごと読んで、同じようなペインを作って似たデザイン
-
spending-effort-with-jev: no TypeSafe API key, so effort tips are off. Set it in /plugin.⚠ effort: long run, fuzzy spec → have Claude interview you, then go maxClaude に頼む…
-
✦ explain as pick how Claude answers×3 ● build3 ● build3 ● build▸ VideoClaude に頼む…
-
Claude に頼む…superpowersϟ Arc tokens showing buildNot now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)Not now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)Not now██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓██ FinalFinal42%:1 ✓███ brand gradient (OKLCH)d darkl lightz daltonizeda ansiu auto
-
何をするか
- ターミナルにプロンプトの上の帯・欄・ステータス行・トーストを描く
- /agentzero を足す
- Bash の呼び出しを見張る(止めることがある)
- command.register・env.get・fs.read・fs.stat ほか 13 個にフックする
-
Claude に頼む…Timer● MonAprNo timer runningStopResume last CollapseFri week./meter.tsxUnbilled Wed h$1.24 · expenses MarMayToday, Oct 6This week
-
Claude に頼む…Notes⚠ A team of Never uses your Claude usage much faster.Showing:buildbuildbuildHide completed:buildbuildbuildSet team size:DefaultDefaultDefaultSet model:NotesNotesNotesWorkflowYour next prompt can hand work to Never Notes helpers.● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m● Fix login · Tool agents42% AllCopy failed2h 10m