✳ClaudeModsClaude Code 模组目录
☰
● 0 人在线 · 浏览 0 次
+ 提交作品
← 返回作品集
Reddit 帖子 · 游戏与娱乐 / 提示词与输入增强 / 主题与外观 / 工作流与 CI

Claude Code 像素宠物插件:养一只陪你写代码的小生物

一个住在 Claude Code 窗格里的像素宠物,会随工具调用、回合完成和抚摸获得经验成长,并根据你的使用习惯演变成不同性格与形态。

uuppinote@uppinote
已翻译

关于这个 mod

作者借 Claude Code 的 function-hook API 做了个「完全没必要」的像素宠物插件,住在会话旁边的窗格里。它会在一小块院子里走动、弹跳、眨眼;工具运行时停下来显示「. . .」,回合完成时跳起来喊「nice work!」,安静两分钟后打盹,速率限制窗口超过 80% 时会流泪,输入 /pet pat 可以摸它获得爱心和呼噜声。

成长机制:工具调用、完成回合、抚摸和输出 token 提供 XP(只用输出 token,因为输入和缓存随对话长度增长而非工作量)。等级 n+1 需要 25 × n² XP,一晚可到 Lv 5,之后放缓;Lv 15 变成带配饰的少年,Lv 40 进化。宠物会根据你的使用习惯获得性格:工具多则是抱着笔记本电脑的工人(成年后挥镐),长回合多是停下阅读的学者,抚摸多是甜心,游戏零食多是玩家——这也是进化形态,另有 1/20 概率出稀有形态。院子会随之慢慢填充成工地、图书馆角落或花园,并跟随你的时钟从晨光到月夜。偶尔完成的回合会掉落礼物,1/32 概率出现闪光宠物。还有两个小游戏 /pet play 和 /pet quest。没有饥饿、没有衰减、不会死亡。

安装:/plugin marketplace add uppinote20/claude-pets 然后 /plugin install pets@claude-pets,再输入 /pet

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

/plugin marketplace add uppinote20/claude-pets && /plugin install pets@claude-pets
原文 / README

When Claude Code mods dropped, I was poking around to see what the function-hook API could actually do, and ended up making something completely unnecessary: a pixel pet that lives in a pane next to your session. https://reddit.com/link/1wwwemd/video/bgz3c6e55bth1/player It wanders around a little yard, bouncing and blinking. While tools run it stops and goes . . . , when a turn finishes it hops with a "nice work!", after about two minutes of quiet it naps, and when a rate-limit window passes 80% it tears up. /pet pat gets you hearts and a purr. It grows with you. Tool calls, finished turns, pats and output tokens give XP (only output tokens, since input and cache grow with conversation length, not with work done). Level n+1 takes 25 × n² XP, so you'll hit Lv 5 in an evening and it slows down from there. At Lv 15 it becomes a teen with an accessory, and at Lv 40 it evolves. Then I got carried away. It picks up a personality from how you use it: mostly tools and it's a worker that holds up a laptop (and swings a pickaxe as an adult), mostly long turns and it's a scholar that stops to read, lots of pats and it's a sweetie, lots of game snacks and it's a gamer. That's also the form it evolves into, and one in twenty gets a rare one instead. The yard slowly fills in to match, a building site or a library corner or a garden, and follows your clock from morning sun to moon and stars. Every so often a finished turn drops a gift, and one new pet in 32 shows up shiny. There are even two tiny games, /pet play and /pet quest , for when you're waiting on a long task. No hunger, no decay, no dying. The whole point is to make the coding environment a bit cozier, not to give you one more thing to feel guilty about. /plugin marketplace add uppinote20/claude-pets /plugin install pets@claude-pets Then /pet to let it out. There are eight critters (cat, chick, dog, slime, bunny, hamster, penguin, frog). For anyone curious about mods: it's a register.tsx hooking session.start , command.run , tool.call , turn.complete , session.measure and ui.render . In the terminal the sprite is one Raster element of half-block cells, kitty and Ghostty get a single hi-res image, and desktop, VS Code and mobile get an SVG card instead. One fun quirk: the module's clock is UTC, so it asks date +%z for your offset to know when it's night. It went from 0.1.0 to 0.2.0 in about three days of Claude Code sessions (58 commits, 19 PRs), which says more about my self-control than anything. The mods API is early access, so a Claude Code update might break it until I catch up. I've mostly lived with it in the terminal, so if the card looks off on desktop, VS Code or mobile I'd really like to know. A new species is just a 12×12 and an 8×8 sprite written as string arrays, so new critters as PRs would make my day. https://github.com/uppinote20/claude-pets submitted by /u/uppinote [link] [comments]

查看原始来源 ↗

更多类似作品