PhucUSk20/pixel-familiars/tree/main/plugins/pixel-pet
关于这个 mod
<p align="center"> <img src="docs/images/slime.gif" width="160" alt="会呼吸、眨眼、跳跃和欢呼的像素史莱姆"> </p> <h1 align="center">Pixel Familiars</h1> <p align="center">为 <strong>Codex</strong> 和 <strong>Claude Code</strong> 提供会动的像素伙伴。<br>通过一个鲜活的像素世界查看 AI 的活动、上下文和配额。</p> <p align="center"> <a href="#codex"><img alt="Codex companion" src="https://img.shields.io/badge/Codex-VS_Code-5aa9ff"></a> <a href="#claude-code"><img alt="Claude Code companion" src="https://img.shields.io/badge/Claude_Code-terminal-ffe25a"></a> <a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-5aa9ff"></a> </p>由 PhucUSk20 拥有并维护。基于 Namenomeaning/pixel-pet,保留原作者信息和 MIT 声明。
选择你的伙伴
两个集成都使用共享的像素引擎和主题格式。每个集成都连接自己的运行时;由于事件流和显示界面不同,功能也会有所差异。
| | Codex | Claude Code | | --- | --- | --- | | 显示 | 自适应 VS Code 面板 | 提示列上方的宠物,下方的 HUD | | 活动 | 原生 hooks,不可用时回退到工作阶段日志 | Claude Code mod 事件 | | 共享宠物动作 | 读取、搜索、写入、终端、网页、思考和庆祝 | 读取、搜索、写入、终端、网页、思考和庆祝 | | HUD | 剩余上下文和报告的配额/重置时间 | 剩余上下文和报告的配额/重置时间 | | 自定义 | MCP 主题工具、预览和导入 | 外挂 skill、预览和主题工具 | | 任务伙伴 | Portal workers、subagent minis 和自动项目 Mini | 跟随主宠物的 subagent minis | | 闲置游戏 | 独立漫游和 20 种宠物互动 | 呼吸、环顾四周和睡眠 | | Legendary Pet | 带有五个 Mega Rayquaza 动作的独立面板 | 可通过 Codex VS Code companion 使用 | | 详细指南 | Codex guide | Claude Code guide |
观察和动画都在本地运行,不会产生 AI 调用或 tokens。让 AI 重新设计主题时,使用的是正常的聊天/工具流程。
开始使用
将此储存库克隆下来,即可安装 Codex companion,或直接从源代码加载 Claude 外挂:
git clone https://github.com/PhucUSk20/pixel-familiars.git
cd pixel-familiars
Codex
要求:Node 22.18+、可使用 code 命令的 VS Code,以及已安装 Codex 扩展。
在克隆的资料夹中运行一个安装命令:
npm.cmd run install:codex
在 macOS/Linux 上使用 npm run install:codex。安装程序会下载依赖、构建/打包扩展、安装扩展,并配置本地观察器 hooks 和 MCP 主题工具。它会打开内置的 Codex CLI 供你审核 hooks:
- 如果出现提示,允许资料夹信任。输入 /hooks,审核并信任 12 个 Pixel Pet observer 条目。
- 退出审核 CLI。运行 Developer: Reload Window,然后在 VS Code 中运行 Pixel Pet: Open Companion。
- 开始新的 Codex 对话并运行工具。收到真实事件后,面板应显示 Direct hooks。
Direct hooks 能提供最完整的工具/subagent 计时和压缩动画。原生事件不可用时仍可使用 Log fallback,但无法恢复每个嵌套启动的时间。审核是 Codex 要求的步骤,不会自动授予权限。批准后可以关闭审核 CLI。
<p align="center"><img src="docs/images/codex-pet-summoning.gif" width="816" alt="Codex 演示:天空传送门召唤独立的 Read、Edit 和 Run worker,并带回结果"></p>工具会通过彩色天空传送门召唤 worker minis。并行工作会让独立 worker 一直保留,直到记录完成。成功时,主宠物会收到一个包裹;失败时,会出现可点击的错误标志。持久的 Mini 会自动观察已记录的检查和编辑器错误。
宠物也会独立探索,偶尔进行 20 种不同的闲置互动。Feed 会邀请野餐,Play 会开始接物游戏,Rest 会暂停自动游戏。真实工作会中断游戏。草地会填满面板宽度,面板较窄时,紧凑 HUD 会移到角落。工作场所建筑暂时停用。
<p align="center"><img src="docs/images/codex-pet-actions.gif" width="816" alt="Codex 演示:20 种不同的本地宠物互动画廊"></p>Codex GIF 使用生产渲染器模拟活动。重新运行安装程序并审核变更后的 hook 定义即可更新。请阅读 Codex guide,了解工作阶段选择、配额读数、设置、隐私和面板位置。宠物是独立视图,不是 Codex 聊天的嵌入部分。
Claude Code
要求:Claude Code 2.1.287+(claude --version)。通过此储存库的 marketplace 安装外挂:
claude plugin marketplace add PhucUSk20/pixel-familiars
claude plugin install pixel-pet@pixel-pet
开始新的工作阶段,或运行 /reload-plugins。宠物会出现在终端提示列上方,下面是上下文/配额 HUD。
marketplace 和外挂会保留既有的 pixel-pet 标识符。如果已经使用原始 marketplace,可以在不改变现有安装的情况下,用此 checkout 试用一个工作阶段:
claude --plugin-dir ./plugins/pixel-pet
<p align="center"><img src="docs/images/demo.gif" width="806" alt="Claude Code 演示:读取、搜索、subagent minis、网页抓取、编辑、失败测试和庆祝"></p>
宠物会演示读取、搜索、写入、终端命令和网页活动。subagent 会获得持续到完成为止的 minis。工具失败会改变宠物表情;回合完成时它会欢呼。闲置时会呼吸、眨眼和睡觉。
运行 /plugin configure pixel-pet@pixel-pet 可设置速度、睡眠、HUD、状态文字和 subagent minis。让 Claude 自定义宠物,或运行 /pixel-pet:pixel-pet;应用主题前先审核浏览器预览。请阅读 Claude Code guide,了解设置、更新、支持的显示界面、隐私和开发检查。
上下文和配额 HUD
- HP:剩余上下文窗口。
- MP:报告的剩余 5 小时配额,并显示重置倒计时。
- ST:报告的剩余 7 天配额,并显示重置倒计时。
配额可用性取决于运行时和账号。缺少的读数会保持未知。进度条反映观察到的使用量,并不代表额外权限或保证的任务容量。读数偏低时,颜色和宠物表情会改变。
打造自己的风格
两个集成都通过共享的主题格式支持自定义像素宠物、道具、效果、状态文字、HUD 颜色和场景。
试试紫色史莱姆、橡皮鸭、月亮场景、用于网页搜索的雷达,或名为 FUEL 的 HUD。Codex 使用 get_theme、get_theme_format、preview_theme 和 set_theme;Claude Code 使用它的外挂 skill 和主题工具。应用前先预览结果。
<p align="center"><img src="docs/images/pets.gif" width="440" alt="像素史莱姆和自定义橡皮鸭并排出现"></p>Legendary Pet
在 VS Code 中运行 Pixel Pet: Open Legendary Pet 打开独立面板。Mega Rayquaza 有五个动作:flight、curled sleep、roar、Dragon Pulse 和 dash/braking,带有平滑过渡、Auto 和 Pause。Hình gốc 会播放未改变的原始帧,方便比较。
<p align="center"><img src="docs/images/legendary-source-actions.gif" width="700" alt="五个 Mega Rayquaza 动作,带有平滑过渡和清晰可见的睡眠头部"></p>动画在本地运行,不共享 AI 工作阶段,也不会发出模型请求。
开发
- 共享引擎和 Claude adapter: plugins/pixel-pet/。
- Codex adapter 和 VS Code 面板: extensions/codex/。
- 构建、打包和录制: tools/codex/。
- 独立储存库工作流和上游贡献: development guide。
对于 Codex companion,运行 npm.cmd ci、npm.cmd run typecheck、npm.cmd test 和 npm.cmd run package。主机、渲染器或 bridge 有变更后,还要运行 npm.cmd run test:ui。在 macOS/Linux 上使用 npm。
对于 Claude 外挂变更,遵循 CLAUDE.md 并运行:
claude plugin validate . --strict
claude plugin validate plugins/pixel-pet --strict
claude plugin test plugins/pixel-pet
Claude Code guide 包含生成类型的设置和预览检查。使用 npm.cmd run record:codex-pets 或 npm.cmd run record:legendary 重新创建 Codex GIF(需要 Chrome/Edge 和 ffmpeg)。
隐私和安全
Codex companion 会观察本地 hooks、工作区范围的工作阶段日志和项目诊断。它保留经过清理的活动元数据,不保留提示、推理或完整工具输出。它不会修改 OpenAI 已安装的扩展,也不会批准工具。
Claude 外挂 在 Claude Code 内运行,读取其主题/工作阶段使用量/subagent 状态并绘制宠物。这个 mod 不发出网络请求、不启动进程,也不读取环境变量。可选的状态目标会显示简短的文件/命令提示;分享屏幕时请关闭它们。
详情请参阅各集成的指南。请通过私密安全公告报告漏洞。
许可和致谢
MIT。Pixel Familiars 由 PhucUSk20 维护。原始 Pixel Pet 由 halluqinate 制作,来自 Namenomeaning/pixel-pet。原始版权声明和提交作者信息均予以保留。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add PhucUSk20/pixel-familiars claude plugin install pixel-pet
原文 / README
Owned and maintained by PhucUSk20. Based on Namenomeaning/pixel-pet, with original authorship and MIT notices preserved.
Choose your companion
Both integrations use the shared pixel engine and theme format. Each connects to its own runtime; features differ where their event streams and display surfaces differ.
| | Codex | Claude Code | | --- | --- | --- | | Display | Responsive VS Code panel | Pet above the terminal prompt, HUD below | | Activity | Native hooks, with a session-log fallback | Claude Code mod events | | Shared pet motions | Read, search, write, terminal, web, think and celebrate | Read, search, write, terminal, web, think and celebrate | | HUD | Context remaining and reported quota/reset times | Context remaining and reported quota/reset times | | Customization | MCP theme tools, preview and import | Plugin skill, preview and theme tools | | Task companions | Portal workers, subagent minis and automatic project Mini | Subagent minis following the main pet | | Idle play | Independent roaming and 20 pet interactions | Breathing, looking around and sleep | | Legendary Pet | Independent panel with five Mega Rayquaza actions | Available through the Codex VS Code companion | | Detailed guide | Codex guide | Claude Code guide |
Observation and animation run locally and add no AI calls or tokens. Asking an AI to redesign a theme uses its normal chat/tool workflow.
Get started
Clone this repository to install the Codex companion or load the Claude plugin directly from source:
git clone https://github.com/PhucUSk20/pixel-familiars.git
cd pixel-familiars
Codex
Requirements: Node 22.18+, VS Code with the code command available, and the Codex extension installed.
Run one installation command from the cloned folder:
npm.cmd run install:codex
On macOS/Linux, use npm run install:codex. The installer downloads dependencies, builds/packages the extension, installs it and configures the local observer hooks and MCP theme tools. It opens the bundled Codex CLI for hook review:
- Approve folder trust if prompted. Enter
/hooks, review and trust the 12 Pixel Pet observer entries. - Exit the review CLI. Run Developer: Reload Window, then Pixel Pet: Open Companion in VS Code.
- Start a new Codex conversation and run a tool. The panel should show Direct hooks after receiving a real event.
Direct hooks provides the fullest tool/subagent timing and compaction animations. Log fallback remains available when native events are unavailable; it cannot recover every nested start time. Review is required by Codex and is not granted automatically. The review CLI can close after approval.
<p align="center"><img src="docs/images/codex-pet-summoning.gif" width="816" alt="Codex demo: sky portals summon independent Read, Edit and Run workers, with result deliveries"></p>Tools summon worker minis through colored sky portals. Parallel work keeps separate workers until recorded completion. Success brings a parcel back to the main pet; failure brings a clickable error sign. The persistent Mini watches observed checks and editor errors automatically.
The pets also explore independently and occasionally meet for 20 different idle interactions. Feed invites a picnic, Play starts catch, and Rest pauses autonomous play. Real work interrupts play. The meadow fills the panel width, and short panels move the compact HUD into a corner. Workplace buildings are temporarily disabled.
<p align="center"><img src="docs/images/codex-pet-actions.gif" width="816" alt="Codex demo gallery of 20 different local pet interactions"></p>The Codex GIFs use simulated activity with the production renderer. Update by rerunning the installer and reviewing changed hook definitions. Read the Codex guide for session selection, quota readings, settings, privacy and panel placement. The pet is a separate view rather than an embedded part of Codex's chat.
Claude Code
Requirement: Claude Code 2.1.287+ (claude --version). Install the plugin from this repository's marketplace:
claude plugin marketplace add PhucUSk20/pixel-familiars
claude plugin install pixel-pet@pixel-pet
Start a new session, or run /reload-plugins. The pet appears above the terminal prompt with its context/quota HUD below.
The marketplace and plugin retain their established pixel-pet identifiers. If you already use the original marketplace, you can try this checkout for one session without changing that installation:
claude --plugin-dir ./plugins/pixel-pet
<p align="center"><img src="docs/images/demo.gif" width="806" alt="Claude Code demo: reading, searching, subagent minis, web fetching, editing, failed tests and celebration"></p>
The pet acts out reading, searching, writing, terminal commands and web activity. Subagents get minis that remain until they finish. Tool failures change the pet's expression; completed turns make it cheer. Idle time brings breathing, blinking and sleep.
Run /plugin configure pixel-pet@pixel-pet for speed, sleep, HUD, status text and subagent minis. Ask Claude to customize a pet or run /pixel-pet:pixel-pet; review its browser preview before applying the theme. See the Claude Code guide for settings, updating, supported displays, privacy and development checks.
Context and quota HUD
- HP: context window remaining.
- MP: remaining reported 5-hour quota, with a reset countdown.
- ST: remaining reported 7-day quota, with a reset countdown.
Quota availability depends on the runtime and account. Missing readings stay unknown. The bars reflect observed usage, not extra permissions or guaranteed task capacity. Low readings change colors and pet expressions.
Make it yours
Both integrations support custom pixel pets, props, effects, status text, HUD colors and scenes through the shared theme format.
Try a purple slime, a rubber duck, a moon scene, a radar for web searches or a HUD named FUEL. Codex uses get_theme, get_theme_format, preview_theme and set_theme; Claude Code uses its plugin skill and theme tools. Preview the result before applying it.
Legendary Pet
In VS Code, run Pixel Pet: Open Legendary Pet for an independent panel. Mega Rayquaza has five actions: flight, curled sleep, roar, Dragon Pulse and dash/braking, with smooth transitions, Auto and Pause. Hình gốc plays the unchanged source frames for comparison.
<p align="center"><img src="docs/images/legendary-source-actions.gif" width="700" alt="Five Mega Rayquaza actions with smooth transitions and a visible sleeping head"></p>Its animation runs locally, shares no AI session and makes no model requests.
Develop
- Shared engine and Claude adapter:
plugins/pixel-pet/. - Codex adapter and VS Code panels:
extensions/codex/. - Build, packaging and recordings:
tools/codex/. - Independent repo workflow and upstream contributions: development guide.
For the Codex companion, run npm.cmd ci, npm.cmd run typecheck, npm.cmd test and npm.cmd run package. Also run npm.cmd run test:ui after host, renderer or bridge changes. On macOS/Linux, use npm.
For Claude plugin changes, follow CLAUDE.md and run:
claude plugin validate . --strict
claude plugin validate plugins/pixel-pet --strict
claude plugin test plugins/pixel-pet
The Claude Code guide includes generated-type setup and preview checks. Recreate Codex GIFs with npm.cmd run record:codex-pets or npm.cmd run record:legendary (Chrome/Edge and ffmpeg required).
Privacy and security
The Codex companion observes local hooks, workspace-scoped session logs and project diagnostics. It retains sanitized activity metadata, not prompts, reasoning or full tool output. It does not modify OpenAI's installed extension or approve tools.
The Claude plugin runs inside Claude Code, reads its theme/session usage/subagent state and draws the pet. The mod makes no network requests, starts no processes and reads no environment variables. Its optional status targets show short file/command hints; turn those off when sharing your screen.
See each integration's guide for details. Report vulnerabilities through a private security advisory.
License and attribution
MIT. Pixel Familiars is maintained by PhucUSk20. Original Pixel Pet by halluqinate, from Namenomeaning/pixel-pet. Original copyright notices and commit authorship are preserved.

