by myunwang
🐙 盯着 Claude Code 的桌面宠物:随 agent 状态变表情、弹消息气泡、一键授权,并统计 token 用量与花费。本地优先、MIT。
# Add to your Claude Code skills
git clone https://github.com/myunwang/LLMPETLast scanned: 7/25/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@electron/asar: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "@electron/universal: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "app-builder-lib: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "brace-expansion: brace-expansion: DoS via unbounded expansion length causing an out-of-memory process crash",
"severity": "high"
},
{
"type": "npm-audit",
"message": "dir-compare: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "dmg-builder: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "ejs: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "electron: Electron has ASAR Integrity Bypass via resource modification",
"severity": "high"
},
{
"type": "npm-audit",
"message": "electron-builder: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "electron-builder-squirrel-windows: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "electron-winstaller: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "fast-uri: fast-uri vulnerable to host confusion via literal backslash authority delimiter",
"severity": "high"
},
{
"type": "npm-audit",
"message": "filelist: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "glob: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "jake: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "minimatch: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "rimraf: Vulnerability found",
"severity": "high"
},
{
"type": "npm-audit",
"message": "tar: node-tar: Uncontrolled recursion in mapHas/filesFilter allows uncatchable stack-overflow DoS via crafted long-path tar with member selection",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "temp: Vulnerability found",
"severity": "high"
},
{
"file": "README.md",
"line": 44,
"type": "secret-exfiltration",
"message": "Instruction appears to send credentials/secrets to an external endpoint",
"severity": "medium"
}
],
"status": "WARNING",
"scannedAt": "2026-07-25T06:21:21.443Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}LLMPET is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by myunwang. 🐙 盯着 Claude Code 的桌面宠物:随 agent 状态变表情、弹消息气泡、一键授权,并统计 token 用量与花费。本地优先、MIT。. It has 101 GitHub stars.
LLMPET returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/myunwang/LLMPET" and add it to your Claude Code skills directory (see the Installation section above).
LLMPET is primarily written in JavaScript. It is open-source under myunwang on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh LLMPET against similar tools.
No comments yet. Be the first to share your thoughts!
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
一个实时盯着 Claude Code、OpenAI Codex 和 DeepSeek Harness 的桌面宠物:它会随 agent 的状态变表情(思考 / 干活 / 等你授权 / 完成庆祝 / 睡觉),把 agent 的回复弹成气泡,并在详情面板里给出上下文、额度或花费、用量趋势与会话列表。Claude Code 需要授权时,还可以直接在桌宠上一键允许 / 拒绝。
共三款皮肤:章鱼 🐙、像素怪兽 👾、月薪喵 🐱(猫 meme 表情包,素材来自抖音 @月薪喵,见 assets/cat/CREDITS.md)。后端(状态机 / 计量 / 权限 / 进程对账)从零自有实现。Claude Code 通过公开 hook 接口接入;Codex 与 DeepSeek Harness 都只读监听各自的本机会话文件,不修改 Agent 配置。
贡献者
欢迎更多 PR!
| 表情 | 状态 | 什么时候出现 |
|---|---|---|
| 🛠️ working 干活 | 正在调用工具 / 改文件——4 张打工姿态轮换:拍「上号」按钮 / 熬夜冠军 / 捂耳猛敲 / 边吃边敲 | |
| 🤔 thinking 思考 | 提交提问后 / 工具间隙的长推理——思考姿态轮换:挠头 / 躺想浮云 | |
| 💬 talking 回应中 | Claude 正在输出回复文本(对着笔记本疯狂输出喵喵喵) | |
| 🤹 juggling 并行子任务 | 召唤 subagent 多线开工(趴键盘上还同时刷手机) | |
| 🧹 sweeping 清理 | 压缩 / 清理上下文(对手机喷消毒水) | |
| ✋ waiting 等你授权 | 需要你点「允许 / 拒绝」(抱着手机冒冷汗) | |
| ❓ needsinput 等你回复 | 需要你选择 / 输入(头顶冒问号挠头) | |
| 🔔 attention 看一眼 | 任务刚结束提醒你(从工位起身够手机看消息) | |
| 🎉 happy 完成庆祝 | 一轮任务干完(摸小猫的头夸夸) | |
| 👋 greet 打招呼 | 新会话开始(被闹钟炸醒弹射到工位) | |
| 💥 error 出错 | 执行失败 / API 报错(抱头崩溃大叫) | |
| 🍦 loafing 摸鱼 | 上一步干完、下一步还没来的间隙——摸鱼轮换:躺地刷手机 / 点外卖 / 奶瓶手机 | |
| 🪑 idle 待命 | 没有任务(转椅上冰淇淋+手机摸鱼) | |
| 🧳 roam 旅行 | 青蛙旅行正在进行:独立 agent 只读探索项目(撒腿跑着玩) | |
| 😴 sleeping 睡觉 | 会话结束 / 久无活动——睡姿轮换:被窝一坨 / 拔肚子毛当眼罩 |
Claude Code ──(生命周期 hook)──► octopus-hook.js ──HTTP POST /state──┐
──(PermissionRequest HTTP hook,阻塞)──► /permission ──┤
▼
┌──────────────────────────────┐
│ 本地 HTTP server (127.0.0.1) │
└──────────────┬───────────────┘
▼
会话状态机 (core) ── 适配器 ── pet:stats / pet:event ──► 桌宠/面板渲染
计量扫描 (metering) ── 读 ~/.claude transcript → 算 token & 花费 ─┘
~/.claude/settings.json 注册两类钩子(合并写入,不覆盖你已有的钩子,卸载会先备份):
SessionStart / UserPromptSubmit / PreToolUse / PostToolUse / Stop / SubagentStart … 触发 hook/octopus-hook.js,它读 stdin + transcript 尾巴,POST 一个状态包给本地 server(127.0.0.1:41330 起)。/permission 并挂起,等桌宠回 allow/deny。pet:stats 快照 + pet:event 事件)。~/.claude/projects/**/*.jsonl,按 message.id 去重统计每轮 token,乘模型单价算花费,喂详情面板。**「Claude 客户端消息」**指的是 Claude Code(CLI agent)的回复内容——
Stop时从 transcript 抽最后一段 assistant 文本(截断 + 密钥脱敏),对应桌宠的💬气泡。(不是 Claude 桌面聊天 App 的消息。)
除 Claude Code 外,桌宠也能盯 OpenAI Codex(CLI / Desktop):
Codex CLI / Desktop ──写 rollout──► ~/.codex/sessions/YYYY/MM/DD/*.jsonl
│ (codex-watch 增量 tail,只读)
▼
同一个会话状态机 (core, agentId: 'codex') ──► 桌宠/面板
notify 配置位(常被 ChatGPT 桌面 App 占用),所以走「监听 rollout 文件」——增量 tail、零配置、卸载无残留。user_message→思考;首个 exec_command/apply_patch 后整轮保持“干活中”(工具结果和中间 reasoning 不会误降成思考),直到 task_complete→完成庆祝+💬 或 turn_aborted→中断徽标;token_count→上下文%。guardian / auto-review 等 subagent 内部线程自动过滤,长会话恢复时只读取新增事件、不重放历史。last_token_usage 建立去重台账,显示今日 / 本机留存历史 token;套餐 5h 主窗口与周窗口仍单独读取 rate_limits。本地 token 台账不冒充 OpenAI 账单或账号全生命周期统计。LLMPET_NO_CODEX=1 关闭 Codex 监听;LLMPET_CODEX_DIR=<dir> 指向假目录做开发验证。第三个能盯的后端是 DeepSeek Harness(CLI 名 dsh)。它仍处于 developer preview,上游明确提示会有破坏兼容的变更;LLMPET 对未知日志版本采取 fail-closed:不解析、不展示为正常会话,等待适配后再支持。
dsh web / dsh --profile … ──写会话日志──► ~/.dsh/sessions/--项目--/<会话>/session.jsonl.zstd
│ (dsh-watch 增量 tail,只读)
▼
同一个会话状态机 (core, agentId: 'dsh') ──► 桌宠/面板
cordis.patch.yml。为一只桌宠去改你的 agent 组合不值当——所以照 Codex 的路子读它自己的会话日志,零配置、卸载无残留。session.jsonl.zstd,一次落盘一帧),而 Electron 33 自带的 Node 20 没有 zstd API。桌宠自己扫帧边界、逐帧解压(内置纯 JS 解码器 fzstd,MIT,见 backend/vendor/),末尾半帧留到下一轮。单个压缩帧有 32 MiB 的解码安全上限;超过时会记录并跳过该帧、继续后续日志,避免监听永久卡死。compression: 'none' 的纯文本 session.jsonl 同样支持。turn/start→思考;首个 tool/call 之后整轮保持“干活中”;turn/end completed→完成庆祝 + 💬,aborted/blocked→中断徽标,error→出错;approval/asked→等你回复(授权仍在 dsh 自己的界面里答);compaction→打扫;session/title 直接用它自己起的标题;assistant/message.usage 配 request/context.contextWindow 算上下文 %。origin: 'subagent' 与 delegationDepth > 0 的子 agent 线程整份跳过。dsh web、--profile headless、已安装的 --profile tui,以及 Node / npx @deepseek-ai/dsh 入口识别为 dsh agent。dsh web 是内置的通用 Web profile(默认 http://127.0.0.1:3080,改过端口用 LLMPET_DSH_WEB 覆盖),不是某一条历史会话的精确定位;会话列表的「去回复」只能打开这个通用入口,不能承诺跳回具体 session。TUI 可用 dsh --profile tui --resume <id> 恢复,但该 profile 需要本机先安装;只有 web / headless profile 的机器不能把 dsh 作为 LLMPET 接管目标。dsh 会话仍可作为来源交接给 Claude / Codex(生成本地交接单)。LLMPET_NO_DSH=1 关闭 dsh 监听;LLMPET_DSH_DIR=<dir> 指向假目录做开发验证;日志根目录跟随 $DSH_HOME(默认 ~/.dsh)。在会话列表点该会话右侧的 🧳,可让对应的 Claude Code / Codex 独自出去探索。它使用该会话的项目目录,但不会续写或污染原会话;可选择「项目侦察」「捉虫寻迹」「灵感散步」,也能写自定义任务。
~/.octopus/wander-home/trips/ 下自己的足迹目录出发;旅行小屋和结构化日志一直保留,最近走过的路线和记忆会用于减少重复。0600 的 ~/.octopus/travel.json。只有你主动点击「出发」时,任务和项目上下文才会由对应 CLI 发给 Claude 或 OpenAI;LLMPET 不会自动发起旅行。完整的源码部署、调试、权限与本地打包说明见 《部署到用户本地》。
升级兼容说明:
~/.octopus、OCTOPUS_*环境变量和octopus-hook.js是早期版本留下的内部兼容标识,为避免丢失配置、用量历史、辅助功能授权或已安装 hooks,1.0.0 继续保留;产品名称和所有对外发布物统一使用 LLMPET。
前置条件
git clone https://github.com/myunwang/LLMPET.git
cd LLMPET
npm ci # 按 package-lock.json 安装(国内网络慢可加:ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ npm ci)
npm start # 启动桌宠(首次启动会注册 Claude Code 钩子)
启动后新开的 Claude Code / Codex / DeepSeek Harness 会话会被感知;近期仍活跃的 Codex rollout 与支持版本的 dsh 日志也会静默恢复到会话列表。右键桌宠可切三款皮肤,并分别开关 Codex / dsh 分身。
Windows 说明
$env:ELECTRON_MIRROR='https://npmmirror.com/mirrors/electron/' 再 npm ci)。