Download / 下载: Latest Release / 最新发布 - Windows installer, MSI, and portable .exe are available there. / 可在这里下载 Windows 安装包、MSI 和便携版 .exe。
简体中文 | English
Claude Pet Companion 是一个独立的 Claude Code 桌面宠物伴侣。它不会替换 Claude Code 内置功能,也不会占用终端状态行;Claude Code 用户级 hooks 会写入运行状态,透明 Tauri 悬浮窗读取状态并播放对应的 spritesheet 动画。
Claude Pet Companion is a standalone desktop pet overlay for Claude Code. It does not replace Claude Code's built-in features and does not use the terminal status line. Instead, Claude Code user-level hooks write runtime state, and a transparent Tauri window reads that state to play matching spritesheet animations.
- Transparent, frameless, always-on-top desktop pet window.
- Right-click menu for bilingual UI, pet switching, Codex pet scan, pet import, scale, always-on-top, and quit.
- One
.execan install hooks, create the/petslash command, and launch the pet. /petin Claude Code launches or focuses the companion./pet <description>starts a Claude Code pet-creation workflow for a recognizable companion pet package.- User-level hooks track running, waiting for permission, failed, review, and idle states.
- Visible prompt bubble when Claude Code is waiting for your permission.
- Compatible with Codex-style pet packages and automatically syncs pets installed under
~/.codex/pets. - Hook installer backs up
~/.claude/settings.jsonbefore writing changes. - Uninstaller only removes handlers owned by this project.
flowchart LR
A["Claude Code user hooks"] --> B["claude-pet-companion.exe --hook"]
B --> C["~/.claude/pet-companion/runtime/state.json"]
D["Tauri + React overlay"] --> C
D --> E["Canvas spritesheet animation"]
F["Claude Code /pet command"] --> G["claude-pet-companion.exe --launch"]
G --> D
Claude Code sends hook input to claude-pet-companion.exe --hook. The executable writes runtime/state.json quickly and exits. The desktop overlay polls that file and renders the matching row from the active pet spritesheet.
- Windows 10 or Windows 11.
- Claude Code.
- Microsoft Edge WebView2 Runtime.
You do not need Node.js or Rust when using a release installer.
Download and run the NSIS installer from a release:
Claude Pet Companion_0.1.0_x64-setup.exe
Then open claude-pet-companion.exe. On first launch it will:
- Create
~/.claude/pet-companion/config.json. - Copy the running executable to
%USERPROFILE%\.claude\pet-companion\bin\claude-pet-companion.exe. - Install Claude Code user-level hooks.
- Create the Claude Code personal command
~/.claude/commands/pet.md. - Launch the transparent desktop pet window.
This stable copy lets portable downloads keep working even if the original file was launched from Downloads or a temporary folder.
The installer keeps your existing Claude settings, including statusLine, plugins, and unrelated hooks.
In Claude Code, type:
/pet
This launches or focuses the pet. If the pet is already open, it will be focused and briefly play the waving state.
With arguments, /pet becomes a pet workflow command:
/pet make a tiny moon rabbit with a brass staff
/pet import %USERPROFILE%\Downloads\my-pet
/pet switch hiyue
/pet sync
Claude Code will use the installed claude-pet-companion skill to create, validate, import, switch, or sync recognizable desktop pet packages.
- Drag the pet window by holding the transparent area.
- Right-click the pet, or click the top-right dot button, to open the control panel.
- Use the panel to switch Chinese/English UI, switch pets, scan Codex pets, import a pet folder, scale the pet, toggle always-on-top, or quit.
Open the pet menu and change Language to either 中文 or English. The choice is saved in:
%USERPROFILE%\.claude\pet-companion\config.json
The prompt bubble, menu labels, status captions, and import dialog title follow the selected language.
| Claude Code situation | Pet state |
|---|---|
| Idle session | idle |
| Prompt submitted or tools running | running |
| Permission prompt or elicitation dialog | waiting |
| Tool failure or permission denied | failed |
| Response finished | review, then idle |
When Claude Code asks for permission, the pet shows a visible bubble telling you to return to the terminal and choose Yes or No.
For PreToolUse permission checks, the bubble can also show the tool name and a compact summary of the command, file, or input being requested. The Allow and Deny buttons write Claude Code's hook response using hookSpecificOutput.permissionDecision, so the terminal prompt can continue from the pet decision. Non-decision notifications can be dismissed from the bubble and will also expire automatically.
The overlay also has a small Codex-like motion layer:
/petlaunch briefly playswaving.- Prompt submission briefly plays
wavingbefore task work. - Dragging the pet uses
running-leftorrunning-right. - Completed responses briefly play
jumpingbefore review. - Long idle periods occasionally play a small
wavingorjumpingflourish.
A pet package is a folder containing:
pet.json
spritesheet.webp
Open the pet menu and choose Import Pet Folder. Imported pets are copied to:
%USERPROFILE%\.claude\pet-companion\pets
Yes. The companion recognizes Codex-compatible pets installed under:
%USERPROFILE%\.codex\pets
On startup, it scans that directory and copies valid packages into:
%USERPROFILE%\.claude\pet-companion\pets
You can also open the pet menu and choose Scan Codex Pets. Valid Codex pets appear in the same pet selector without restarting Claude Code.
From a terminal or from the installed /pet skill workflow, the same operation is available as:
.\claude-pet-companion.exe --sync-codex-petsFrom the installed application folder:
.\claude-pet-companion.exe --uninstallThis removes only this companion's hooks and /pet command. It does not remove unrelated Claude Code settings.
- Node.js 20+.
- Rust stable toolchain.
- Tauri 2 prerequisites for Windows.
- Microsoft Edge WebView2 Runtime.
- Claude Code for end-to-end hook testing.
git clone <your-repo-url> claude-pet-companion
cd claude-pet-companion
npm installnpm run tauri:devInstall hooks during development:
npm run install-hooksUninstall hooks:
npm run uninstall-hooksnpm run tauri:buildArtifacts are generated under:
src-tauri/target/release/claude-pet-companion.exe
src-tauri/target/release/bundle/nsis/
src-tauri/target/release/bundle/msi/
Use a GitHub Release for built binaries. Do not commit generated installers, local config, runtime state, or imported pets to the repository.
Recommended tag format:
v0.1.0
Release build command:
npm install
npm run tauri:buildUpload these artifacts to the GitHub Release:
src-tauri/target/release/bundle/nsis/Claude Pet Companion_0.1.0_x64-setup.exe
src-tauri/target/release/bundle/msi/Claude Pet Companion_0.1.0_x64_en-US.msi
Optional portable binary:
src-tauri/target/release/claude-pet-companion.exe
The portable executable self-installs a stable copy to %USERPROFILE%\.claude\pet-companion\bin\claude-pet-companion.exe on first launch or --install; hooks and /pet point to that copy, not to the developer build path or the user's download folder.
Suggested release notes:
## Claude Pet Companion v0.1.0
### Added
- Transparent always-on-top desktop pet companion for Claude Code.
- Claude Code user-level hooks for idle, running, waiting, failed, and review states.
- `/pet` command integration for launch, import, switch, sync, and pet creation workflows.
- Chinese/English UI switching.
- Codex-compatible pet package import and Codex pet sync from `~/.codex/pets`.
### Install
Download and run `Claude Pet Companion_0.1.0_x64-setup.exe`.Before publishing, verify:
npm run build
cd src-tauri
cargo check
cd ..
npm run tauri:buildThe release executable includes the installer, hook handler, launcher, and state writer:
.\claude-pet-companion.exe --install
.\claude-pet-companion.exe --uninstall
.\claude-pet-companion.exe --launch --state waving --event manual-launch --ttl-ms 3000
.\claude-pet-companion.exe --hook --state waiting --event manual-hook
.\claude-pet-companion.exe --import-pet "$env:USERPROFILE\Downloads\pet-package"
.\claude-pet-companion.exe --set-pet hiyue
.\claude-pet-companion.exe --sync-codex-petsThe Node hook handler remains available for local debugging:
node .\hook\claude-pet-hook.mjs --state waiting --event manual-node-hookPermission prompt:
'{"hook_event_name":"Notification","notification_type":"permission_prompt","message":"Do you want to proceed?","tool_name":"Bash"}' | .\claude-pet-companion.exe --hookTool running:
'{"hook_event_name":"PreToolUse","tool_name":"Bash"}' | .\claude-pet-companion.exe --hookFailure:
.\claude-pet-companion.exe --hook --state failed --event manual-failure --ttl-ms 3000src/ React overlay UI
src-tauri/ Tauri shell and native commands
hook/claude-pet-hook.mjs Node hook handler for development fallback
scripts/install-hooks.mjs Development hook installer
scripts/uninstall-hooks.mjs Development hook uninstaller
config.example.json Example local config
launch-pet.vbs Hidden-window launcher for local release exe
The installer also writes a Claude Code skill to:
%USERPROFILE%\.claude\skills\claude-pet-companion\SKILL.md
That skill defines how /pet <description>, /pet import <folder>, and /pet switch <pet-id> should behave.
Runtime config is created at:
%USERPROFILE%\.claude\pet-companion\config.json
Default pet sources:
%USERPROFILE%\.codex\pets
%USERPROFILE%\.claude\pet-companion\pets
See config.example.json.
Config fields:
| Field | Meaning |
|---|---|
activePetId |
Currently selected pet id. |
language |
UI language, currently zh-CN or en. |
petSources |
Directories scanned for pet.json packages. |
window.scale |
Pet scale, clamped by the UI between 50% and 250%. |
window.alwaysOnTop |
Whether the overlay stays above other windows. |
--sync-codex-pets and the Scan Codex Pets button:
- Scan one level under
%USERPROFILE%\.codex\pets. - Accept folders that contain a readable
pet.jsonand the referenced spritesheet. - Copy each valid package to
%USERPROFILE%\.claude\pet-companion\pets\<id>. - Normalize the copied manifest so
spritesheetPathpoints tospritesheet.webp. - Refresh the running overlay through
runtime/state.jsonwhen invoked from the CLI. - Never modify Codex's original pet package.
pet.json:
{
"id": "hiyue",
"displayName": "Hiyue",
"description": "Optional description",
"spritesheetPath": "spritesheet.webp"
}Spritesheet requirements:
- Size:
1536x1872. - Grid: 8 columns x 9 rows.
- Frame size:
192x208. - Row order:
idle,running-right,running-left,waving,jumping,failed,waiting,running,review.
| Claude Code event | State | Notes |
|---|---|---|
SessionStart, SessionEnd |
idle |
Session starts or ends. |
UserPromptSubmit, UserPromptExpansion |
running |
User input has been submitted. |
PreToolUse, PostToolUse, PostToolBatch |
running |
Tool execution activity. |
SubagentStart, TaskCreated |
running |
Background or delegated work starts. |
PermissionRequest, Notification(permission_prompt), Elicitation |
waiting |
User action is needed. |
PostToolUseFailure, PermissionDenied, StopFailure |
failed |
Error or denied action. |
Stop, SubagentStop, TaskCompleted |
review |
Completed response, then returns to idle. |
- Do not commit
config.json,runtime/,pets/,dist/,node_modules/, orsrc-tauri/target/. - Do not commit private
~/.claude/settings.jsonfiles or secrets. - The installer backs up settings before modifying hooks.
- The uninstaller removes only commands containing
claude-pet-companionorclaude-pet-hook.mjs.
Run:
.\claude-pet-companion.exe --installThen restart Claude Code or start a new session.
Run the installer command again so the /pet command uses the launcher script:
.\claude-pet-companion.exe --installThe command should contain:
!wscript.exe "...\.claude\pet-companion\runtime\launch-pet.vbs"
This launcher starts the GUI outside Claude Code's short-lived command process.
Check the state file:
Get-Content "$env:USERPROFILE\.claude\pet-companion\runtime\state.json"For permission prompts, it should contain waiting and notification:permission_prompt.
For tool approval prompts, it should contain waiting, approval-request, and an approvalId. The installed PreToolUse hook should be synchronous:
async: false
timeout: 130
Use the release executable or installer. Development commands may open terminals, but the release app is built as a Windows GUI subsystem application.
MIT