isr431/desk-pet

isr431/desk-pet

一个住在 Claude Code 会话旁、会根据 Claude 的行为做出反应的小型动画宠物,让漫长的会话更值得偶尔看一眼。

选择 axolotl、quokka、tiny robot、dog 或 cat。每种宠物对每个反应都有自己的表现方式。
| When | Your pet | |---|---| | A turn starts | 醒来并伸展身体 | | Claude reads files | 阅读一本小书 | | Claude edits code | quokka、robot、dog 敲锤子,axolotl、cat 织毛线 | | Claude runs a shell command | 在迷你键盘上疯狂打字 | | Claude searches or fetches the web | 透过望远镜观察 | | Tests pass | 在彩纸雨中跳舞 | | Tests fail | 躲到石头后,再探头出来 | | A turn runs 5+ minutes | 打哈欠、玩毛线、堆沙堡 | | Claude needs your input | 挥手直到你回应 | | A turn finishes | 带来小奖杯或信封 | | Context compaction | 整理房间,把箱子叠起来 | | Nothing happening | 呼吸并眨眼 |
宠物住在一个小小的像素房间里(墙纸、带窗帘的窗户、吊灯、木地板和地毯),房间会跟随当地时间:黎明(5–7)是粉色日出,上午(7–11)和中午(11–14)是蓝天与飘动的云,下午(14–17)是金色光线,傍晚(17–20)是夕阳,夜间(20–5)是星空和亮起的吊灯。窗外阳光落在地板上并随太阳移动,标题旁的闲置图标也会随小时变化。终端使用半方块像素绘制(48 列、12 行),Claude desktop app 中使用动画 SVG。
你可以选择位置:
在 Claude Code 中将此仓库加入插件市场,然后安装:
/plugin marketplace add isr431/desk-pet
/plugin install desk-pet@desk-pet
也可以从 shell 执行:
claude plugin marketplace add isr431/desk-pet
claude plugin install desk-pet@desk-pet
开始新会话后宠物会出现。运行 /desk-pet 选择宠物和设置。Desk Pet 是 function-hooks 插件,需要 Claude Code 2.1.286 或更高版本。function-hooks API 处于 early access,未来版本可能改变。
不安装、直接从本地 checkout 试用:
claude --plugin-dir /path/to/desk-pet
/desk-pet 打开设置面板并为每个反应提供预览;/desk-pet cat(或 axolotl、quokka、robot、dog)切换宠物;/desk-pet show 重新打开侧边面板。终端中的 /config 将设置列为 Desk Pet: …,宠物和位置以 axolotl、quokka、robot、dog、cat、panel、above 等文字输入,其他值回退到默认值。/desk-pet demo 会依次播放所有反应,适合截图或 GIF。
Privacy policy:以下披露说明 mod 的资料处理。
Desk Pet 只观察 Claude 正在做什么并绘制宠物。它不发出网络请求、不读取文件、不运行命令,也不在会话之间保留自己的资料。
Hooks。 每个钩子查看事件后原样传递,不批准、阻挡或改写任何内容。
| Hook | What it reads | Why | |---|---|---| | session.start | nothing | 启动动画、打开侧边面板并注册 /desk-pet | | prompt.submit | nothing, not even your prompt's text | 你回复后停止需要输入的挥手 | | turn.start, turn.complete | whether the turn ended with an answer, and whether it was a subagent's | 醒来、5 分钟后无聊、回合结束礼物 | | tool.call | 工具名称、文件名(不读内容)、搜索模式或查询、URL 主机、shell 命令前约 38 个字符、调用是否失败 | 选择反应和标题,发现测试运行及结果 | | session.compact | whether it was a subagent's, or a background precompute | 整理房间反应 | | classic.Notification | notification type only(permission_prompt 或 elicitation_dialog) | 开始需要输入的挥手 | | classic.PermissionDenied | nothing | 提示被拒绝时停止挥手 | | command.run | what you typed after /desk-pet | 执行命令 | | ui.render | the surface and the space available | 绘制宠物 |
标题只会出现在屏幕上。当前标题在会话期间保存在记忆体($.state)中供面板重绘,不会写入磁碟或传送到任何地方。
它会写入的设置。 Desk Pet 只在你要求时变更设置:设置面板的按钮,或 /desk-pet cat 等切换。每次写入都只针对 desk-pet.pet、desk-pet.position、desk-pet.sound 或 desk-pet.react_… 开关,Claude Code 将其保存在设置档的 pluginConfigs 下。它不会碰触其他设置、权限或环境变量。
Sound。 默认关闭;开启后播放由程式码合成的短提示音。在 above the prompt 位置,终端按 ctrl+x ctrl+a 可收合卡片。
claude plugin validate .
claude plugin test .
像素艺术位于 hooks/art.ts,是没有引擎调用的纯 TypeScript,可以在 Node 下导入来绘制预览。
MIT
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add isr431/desk-pet claude plugin install desk-pet
A small animated pet that lives beside your Claude Code session and reacts to what Claude is doing, so long sessions are more fun to glance at.

Pick an axolotl, quokka, tiny robot, dog or cat. Each one has its own take on every reaction.
| When | Your pet | |---|---| | A turn starts | wakes up and stretches | | Claude reads files | reads a tiny book | | Claude edits code | hammers (quokka, robot, dog) or knits (axolotl, cat) | | Claude runs a shell command | types furiously at a mini keyboard | | Claude searches or fetches the web | peers through binoculars | | Tests pass | dances in a shower of confetti | | Tests fail | hides behind a rock, then peeks out | | A turn runs 5+ minutes | gets bored: yawns, plays with yarn, builds a sandcastle | | Claude needs your input | waves until you respond | | A turn finishes | brings you a little trophy or envelope | | Context compaction | tidies its room, stacking boxes | | Nothing happening | breathes and blinks |
Your pet lives in a little pixel room (wallpaper, a curtained window, a pendant lamp, a wooden floor and a rug) that follows your local time of day: a pink sunrise at dawn (5–7), blue skies and drifting clouds in the morning (7–11) and at noon (11–14), golden light in the afternoon (14–17), a sunset in the evening (17–20), and a starry night with the lamp glowing (20–5). Sunlight through the window falls across the floor and shifts with the sun, and the caption's idle icon changes with the hour. It's drawn with half-block pixels in the terminal (48 columns by 12 rows) and as an animated SVG in the Claude desktop app.
You choose where it sits:
/desk-pet show brings it back. A terminal opens the panel by itself only when it's at least 144 columns wide.In Claude Code, add this repository as a plugin marketplace, then install the plugin:
/plugin marketplace add isr431/desk-pet
/plugin install desk-pet@desk-pet
Or from a shell:
claude plugin marketplace add isr431/desk-pet
claude plugin install desk-pet@desk-pet
Start a new session and your pet appears. Run /desk-pet to pick your pet and settings.
Desk Pet is a function-hooks plugin. It needs Claude Code 2.1.286 or newer. The function-hooks API is early access, so a future release may change it.
To try it from a local checkout without installing:
claude --plugin-dir /path/to/desk-pet
You can change these in three places:
/desk-pet opens a settings pane with a preview button for each reaction./desk-pet cat (or axolotl, quokka, robot, dog) switches pets./desk-pet show reopens the side panel./config in the terminal lists every setting as a "Desk Pet: …" row. Pet and position are typed there as text (axolotl, quokka, robot, dog, cat; panel, above); anything else falls back to the default./desk-pet demo plays every reaction in turn, which is handy for a screenshot or a GIF.
npm test, pytest, go test, cargo test, vitest, jest, rspec and similar). A non-zero exit counts as a failure.AskUserQuestion and plan approval. Permission prompts and MCP elicitations are noticed through Claude Code's notification event, the same one that drives desktop notifications. The pet stops waving when you send a prompt or when the tool call it was waiting on finishes. One known gap: after you approve a long-running command, the pet keeps waving until that command ends, because the hooks API has no event for the moment a prompt is answered.Privacy policy: the disclosure below describes the mod’s data handling.
Desk Pet only watches what Claude is doing and draws a pet. It makes no network requests, reads no files, runs no commands, and keeps no data of its own between sessions.
Hooks. Every hook looks, then passes the event on unchanged. None of them approves, blocks or rewrites anything.
| Hook | What it reads | Why |
|---|---|---|
| session.start | nothing | starts the animation, opens the side panel and registers /desk-pet |
| prompt.submit | nothing, not even your prompt's text | stops the "needs input" wave as soon as you reply |
| turn.start, turn.complete | whether the turn ended with an answer, and whether it was a subagent's | wake-up, boredom after 5 minutes, the end-of-turn gift |
| tool.call | the tool's name, plus a file's name (never its contents), a search pattern or query, a URL's host, the first ~38 characters of a shell command, and whether the call failed | picks the reaction and its caption, and spots test runs and whether they passed |
| session.compact | whether it was a subagent's, or a background precompute | the tidying-up reaction |
| classic.Notification | the notification's type only (permission_prompt or elicitation_dialog) | starts the "needs input" wave |
| classic.PermissionDenied | nothing | stops the wave when a prompt is refused |
| command.run | what you typed after /desk-pet | the command |
| ui.render | the surface and the space available | draws the pet |
Captions appear on your screen only. The current caption is held in memory for the session ($.state) so the panel can redraw it. It is never written to disk or sent anywhere.
Settings it writes. Desk Pet changes a setting only when you ask: a button in the /desk-pet settings pane, or /desk-pet cat (or another pet). Each write is to one of Desk Pet's own settings (desk-pet.pet, desk-pet.position, desk-pet.sound or a desk-pet.react_… switch), which Claude Code saves in your settings file under pluginConfigs, exactly as /config would. It never touches any other setting, permission or environment variable.
Sound. Off by default. When on, it plays a short chime that it synthesizes in code.
In the "above the prompt" position, press ctrl+x ctrl+a to collapse the card in the terminal.
claude plugin validate .
claude plugin test .
The pixel art lives in hooks/art.ts. It's plain TypeScript with no engine calls, so you can import it under Node to render previews.
MIT