ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 isr431

desk-pet

一隻住在 Claude Code 工作階段旁、會依 Claude 的動作做出反應的小型動畫寵物,讓漫長的工作階段更值得偶爾瞄一眼。

已翻譯

關於這個 mod

Desk Pet

一隻住在 Claude Code 工作階段旁、會依 Claude 的動作做出反應的小型動畫寵物,讓漫長的工作階段更值得偶爾瞄一眼。

Five desk pets reading, hammering, typing, celebrating and bringing gifts

選擇 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。

你可以選擇位置:

  • Side panel(預設):對話旁的獨立面板,顯示寵物名稱、正在做什麼和設定按鈕。關閉後,/desk-pet show 會把它叫回來。終端至少 144 欄寬時才會自動開啟。
  • Above the prompt:訊息框正上方的全寬卡片,寵物在左側,旁邊顯示動作和設定按鈕。

Install

在 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

Settings

  • Pet:axolotl(預設)、quokka、robot、dog 或 cat。
  • Position:side panel(預設)或 above the prompt。
  • Sound:預設關閉。開啟後,Claude 需要輸入或一輪結束時播放柔和提示音。提示音由程式碼合成,不會隨附音訊檔案。
  • Reactions:每個反應都能開啟或關閉,預設全部開啟。

/desk-pet 開啟設定面板並提供每個反應的預覽;/desk-pet cat(或 axolotl、quokka、robot、dog)切換寵物;/desk-pet show 重新開啟側邊面板。終端的 /config 會將設定列為 Desk Pet: …,寵物和位置以文字輸入;其他值回到預設。/desk-pet demo 依序播放所有反應,適合截圖或 GIF。

How it decides what to show

  • 從 shell 命令偵測測試,包括 npm test、pytest、go test、cargo test、vitest、jest、rspec 等;非零結束算失敗。
  • Needs input 包括權限提示、MCP elicitations、AskUserQuestion 和計畫核准。權限提示與 MCP elicitations 透過 Claude Code 的通知事件察覺。送出提示或等待的工具呼叫結束時,寵物會停止揮手。核准長時間命令後仍會揮手到命令結束,是因為 hooks API 沒有提示已回覆的事件。
  • 子代理的反應也會算入;只有主要對話的一輪會觸發醒來、無聊和回合結束禮物。

Privacy and data handling

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 可收合卡片。

Development

claude plugin validate .
claude plugin test .

像素藝術位於 hooks/art.ts,是沒有引擎呼叫的純 TypeScript,可在 Node 下匯入來繪製預覽。

License

MIT

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add isr431/desk-pet
claude plugin install desk-pet
原文 / README

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.

Five desk pets reading, hammering, typing, celebrating and bringing gifts

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:

  • Side panel (default): its own panel beside the conversation, with the pet's name, what it's doing and a settings button. If you close it, /desk-pet show brings it back. A terminal opens the panel by itself only when it's at least 144 columns wide.
  • Above the prompt: a full-width card just above the message box, with the pet on the left, what it's doing beside it and a settings button.

Install

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

Settings

  • Pet: axolotl (default), quokka, robot, dog or cat.
  • Position: side panel (default) or above the prompt.
  • Sound: off by default. When on, a soft chime plays when Claude needs input and when a turn finishes. Both chimes are synthesized in code; no audio files are shipped.
  • Reactions: each one can be switched on or off. All are on by default.

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.

How it decides what to show

  • Tests are detected from the shell command (npm test, pytest, go test, cargo test, vitest, jest, rspec and similar). A non-zero exit counts as a failure.
  • "Needs input" covers permission prompts, MCP elicitations, 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.
  • Reactions from subagents count too. Only the main conversation's turns trigger wake-up, boredom and the end-of-turn gift.

Privacy and data handling

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.

Development

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.

License

MIT

更多類似作品