Skip to content

Xiaooolong/code-pet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Pet

A desktop pet that reacts to Claude Code in real time.

A hand-drawn stick figure lives in a transparent always-on-top window and animates based on what Claude is doing — thinking, writing code, reading files, running commands, and more.

English 中文

demo

animations

How It Works

Claude Code hooks fire on events (PreToolUse, UserPromptSubmit, etc.) → hook script writes state to ~/.claude-pet/status.json → Tauri backend polls the file → SVG frontend animates.

State Trigger Animation
idle Claude idle Sipping tea, steam rising
thinking User sends message Scratching head, ? ! floating
coding Edit / Write Typing on keyboard, </> { } floating
reading Read / Glob / Grep Holding a book, wow aha floating
running Bash Running in place, sweat drops
celebrate Task completed Jumping, sparkle stars + confetti
error Tool failed Shaking, explosion + smoke
user_typing Keyboard input Catching falling characters

Quick Start

Option 1: Download pre-built installer (recommended)

Download the latest installer from Releases, then install hooks:

powershell.exe -ExecutionPolicy Bypass -File scripts/install-hooks.ps1

Restart Claude Code — done!

Option 2: Build from source

Prerequisites: Windows 10/11, Rust, Tauri v2 CLI, Claude Code

# Build & run
cd code-pet
cargo tauri dev

# Install hooks
powershell.exe -ExecutionPolicy Bypass -File scripts/install-hooks.ps1

# Restart Claude Code — done!

Interaction

  • Drag — move the pet around
  • Click — triggers a reaction
  • Right-click — Theme / Speed / Size / Reset Position / Quit

Uninstall

powershell.exe -ExecutionPolicy Bypass -File scripts/uninstall-hooks.ps1

Tech Stack

Tauri v2 (transparent window) + SVG (procedural animation, zero assets) + Claude Code Hooks (event-driven state)

License

MIT

About

A desktop pet that reacts to Claude Code in real time — sips tea, codes, runs, panics, and celebrates as your AI pair programmer works.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors