Skip to main content

A pixel-art virtual pet plugin for Claude Code

Project description

Claude Code Pet Companion

A pixel-art virtual pet plugin for Claude Code that makes programming more fun! Your pet lives in your editor, watches you code, and evolves as you progress.

Pet Companion Version License

Features

  • Pixel Art Pet: A cute 64x64 pixel pet that animates and reacts to your coding
  • Emotional Intelligence: Pet mood changes based on your coding success/failure
  • XP & Leveling: Gain XP as you code, level up, and unlock new abilities
  • Evolution System: Pet evolves through 7 stages (Egg → Baby → Child → Teen → Adult → Elder → Ancient)
  • Achievements: Unlock achievements for coding milestones
  • Interactive Care: Feed, play with, and put your pet to sleep
  • Draggable UI: Move your pet anywhere on your screen

Quick Start

  1. Install the Plugin

    claude --plugin-dir /path/to/claude-pet-companion
    
  2. Meet Your Pet

    /pet:status
    
  3. Start Coding! Your pet gains XP automatically as you write code, edit files, and run commands.

Commands

Command Description
/pet:status View your pet's stats and progress
/pet:feed Feed your pet (bonus during meal hours!)
/pet:play Play with your pet to increase happiness
/pet:sleep Toggle sleep mode to restore energy

How It Works

Activity Tracking

The pet monitors your coding activity through Claude Code hooks:

Activity XP Effects
Write file +10 Happiness +2
Edit file +10 Happiness +2
Bash success +5 Happiness +1
Fix error +25 Special bonus!
Session complete +50 Happiness +15

Care System

Your pet has three core stats that decay over time:

  • Hunger 🍖 - Feed your pet to restore
  • Happiness 😊 - Play to keep your pet happy
  • Energy ⚡ - Sleep to restore energy

Meal Time Bonuses

Feed during these hours for bonus XP:

  • Breakfast: 7-9 AM (+15 hunger, +20 XP)
  • Lunch: 12-2 PM (+15 hunger, +20 XP)
  • Dinner: 6-8 PM (+15 hunger, +20 XP)

Evolution Path

Level Stage Size New Abilities
1 Egg 32x32 -
10 Child 64x64 Particle effects
20 Teen 80x80 Speech bubbles
30 Adult 96x96 Double XP weekends
50 Elder 128x128 Custom accessories
75 Ancient 160x160 Legendary aura

Project Structure

claude-pet-companion/
├── .claude-plugin/
│   └── plugin.json           # Plugin manifest
├── skills/
│   ├── pet-core/             # Core pet management
│   ├── emotion-tracker/      # Activity & emotion tracking
│   └── pet-commands/         # User commands
├── agents/
│   └── pet-companion.md      # Pet personality
├── hooks/
│   └── hooks.json            # Event tracking hooks
├── webview/
│   ├── index.html            # Pet UI
│   ├── css/                  # Pixel art styles
│   ├── js/                   # Rendering & interaction
│   └── assets/sprites/       # Pixel art sprites
├── scripts/
│   ├── update_state.py       # Hook state updates
│   └── launch_panel.py       # Webview launcher
└── data/
    ├── default_state.json    # Initial state
    ├── achievements.json     # Achievement definitions
    └── evolution_paths.json  # Evolution data

Configuration

Pet settings in plugin.json:

{
  "settings": {
    "data_dir": "data",
    "state_file": "pet_state.json",
    "meal_times": {
      "breakfast": [7, 9],
      "lunch": [12, 14],
      "dinner": [18, 20]
    },
    "sleep_hours": [22, 6]
  }
}

Achievements

Unlock achievements by reaching milestones:

Achievement Requirement Reward
Hello World Create 1 file 50 XP
Bug Squasher Fix 100 errors 500 XP
Speed Coder 10 consecutive successes 150 XP
Night Owl Code past midnight 200 XP
Growing Up First evolution 500 XP

Development

Running the Webview

python scripts/launch_panel.py --webview

Checking Pet State

python scripts/launch_panel.py --status
python scripts/launch_panel.py --json

Adding Custom Sprites

  1. Create pixel art at the appropriate resolution
  2. Export as JSON with the format in assets/sprites/base_pet.json
  3. Add to the sprites directory

Modifying Pet Personality

Edit agents/pet-companion.md to customize how your pet responds!

Technical Details

  • Language: Python 3+ for backend, vanilla JavaScript for frontend
  • Storage: JSON file persistence
  • Rendering: HTML5 Canvas with pixel-perfect scaling
  • Animation: requestAnimationFrame at 8 FPS (authentic pixel art feel)

Contributing

Contributions welcome! Areas for enhancement:

  • New evolution paths and sprites
  • Additional achievements
  • Sound effects
  • More pet personalities
  • Multi-pet support

License

MIT License - feel free to use and modify!

Credits

Created for the Claude Code plugin ecosystem.


Happy coding! 🐾✨

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_pet_companion-1.0.0.tar.gz (51.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_pet_companion-1.0.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file claude_pet_companion-1.0.0.tar.gz.

File metadata

  • Download URL: claude_pet_companion-1.0.0.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for claude_pet_companion-1.0.0.tar.gz
Algorithm Hash digest
SHA256 08dfa69f4a524cbddf2e7c377ee6b02c8ea820d28faf0ea04d9bdda3500dbe31
MD5 00e5b5fb5764a2ac1e7360fd2f3def1d
BLAKE2b-256 ef283abb914b24d3b16a76d4362f251299af88b5add768f3d3ef86382b9383d5

See more details on using hashes here.

File details

Details for the file claude_pet_companion-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_pet_companion-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 74b3440b6c2943af3c30c5eadbf662fa229f494cce9fd5c0404af545d161cdff
MD5 4cab9b8dcdd598911f6d1b7d34fed6c5
BLAKE2b-256 18e316958fcea1d53c65661b7013c1e42688a545c1f41df35f9ac224fdc0b119

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page