An open API service indexing awesome lists of open source software.

https://github.com/anzy-renlab-ai/mypet

Fluffy desktop cat that eats your Claude Code tokens. macOS 13+, SwiftUI, zero deps.
https://github.com/anzy-renlab-ai/mypet

anthropic claude claude-code desktop-companion desktop-pet llm macos menubar-app swiftui tamagotchi

Last synced: 18 days ago
JSON representation

Fluffy desktop cat that eats your Claude Code tokens. macOS 13+, SwiftUI, zero deps.

Awesome Lists containing this project

README

          

# mypet 🐱

> A fluffy desktop cat that eats your Claude Code tokens.
>
> Move your mouse near the cat β€” a wobbly little Claude-cookie follows your cursor. **Double-click**
> the cat to feed it. It chomps one `claude -p` call and bubbles back a Claude
> Code tip, a prompt to try, a 打油诗 (Chinese quatrain), or a tech-news headline.
> Then goes back to sleep.

[![CI](https://github.com/anzy-renlab-ai/mypet/actions/workflows/ci.yml/badge.svg)](https://github.com/anzy-renlab-ai/mypet/actions/workflows/ci.yml)
[![macOS 13+](https://img.shields.io/badge/macOS-13%2B-blue)](https://www.apple.com/macos)
[![SwiftUI](https://img.shields.io/badge/SwiftUI-AppKit-orange)](https://developer.apple.com/swiftui)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![Tests](https://img.shields.io/badge/tests-151%20passing-success)](Tests)
[![Site](https://img.shields.io/badge/site-mypet.renlab.ai-cc785c)](https://mypet.renlab.ai)
[![Ko-fi](https://img.shields.io/badge/donate-ko--fi-FF5E5B)](https://ko-fi.com/alvinanziyan)


double-click the cat, she eats a Claude-cookie, a tip pops up


πŸ‘‰ mypet.renlab.ai

## Why

You pay for Claude Code anyway. The little cat spends *your* subscription
quota β€” no separate Anthropic API key, no server, no telemetry. When you're
not feeding it, it costs **zero CPU** and **zero network**. When you do feed
it, you get one cute interruption and one tiny morsel of useful information.

It's a screensaver that pays rent.

## How it works

```
mouse near + double-click ─► chomp animation ─► claude -p "" ─► πŸ’¬ tip bubble
β”‚
click bubble copies tip + dismisses β—„β”€β”€β”˜
```

1. Move mouse close to the cat β€” a wobbly little cookie sticks to your cursor.
2. A **single click** earns a soft kitten meow (one of three, picked at random).
3. **Double-click** the cat to trigger a feed; it plays a chomp animation and
immediately shows a "let me think…" bubble while it works.
4. `mypet` shells out to your local `claude` CLI β€” same login, same quota.
5. The reply replaces the thinking bubble (with theme badge + token count).
6. Click the bubble to copy the tip; it auto-dismisses after a few seconds.

Cooldown: one feed per minute (the cat tells you when it's still digesting).
No interaction for 10 min β†’ the cat gets quietly hungry. All visual β€” still
zero background work.

## States


10 cat states: idle, eating, purring, hungry, sleepy, dozing, sleeping, clingTop, peekRight, petting

Each state plays its own bundled APNG (3D Pixar-style kitten, generated via
Kling and cleaned through BiRefNet). The Mac app overlays subtle procedural
micro-motion only when it adds something β€” most of the time the APNG carries
the entire performance.

### Feedback cycle (user-triggered)
| State | When | Looks like |
|---|---|---|
| `idle` | default | sitting, slow breath + tail-tip twitch |
| `eating` | feeding | nibbling a Claude-cookie held in both paws |
| `excited` | feed succeeded | sparkly eyes, tail vibrating high |
| `purring` | tip showing | eyes closed in crescent smile, head tilted |

### Sleep progression (passive β€” silent, never grabs attention)
| State | When | Looks like |
|---|---|---|
| `sleepy` | 1min idle | heavy eyelids, slow blink, one droop-and-recover |
| `dozing` | 2.5min idle | sitting upright, head dropped to chest, eyes closed |
| `sleeping` | 5min idle | curled into a fluffy ball on its side, deep breath |

### Mood / engagement
| State | When | Looks like |
|---|---|---|
| `hungry` | 10min no feed | quiet sad sit, glistening eyes, no demand |
| `petting` | hover β‰₯1s on cat | head leans into invisible hand, eyes squint happy |

### Spatial (drag the window to a screen edge)
| State | When | Looks like |
|---|---|---|
| `clingTop` | window near top | kitten hangs upside-down by both front paws |
| `peekRight` | window near right edge | half body peeks out from the right, looking back curiously |
| `peekLeft` | window near left edge | mirrored peekRight |

### Personality moments (rare, idle-only, gated to recent activity)
| State | When | Looks like |
|---|---|---|
| `licking` | rare ambient | kitten licks its right paw (~5 slow licks) |
| `washing` | rare ambient | kitten wipes face with the licked paw |

## Tip themes

Every feed picks one of six themes (weighted toward the Claude Code niche)
so you don't get the same vibe twice in a row:

| Badge | Theme | Weight | What you get |
|---|---|---|---|
| β˜• | `claudeTip` | 30% | Non-obvious Claude Code tip |
| πŸ’‘ | `promptIdea` | 20% | A specific prompt to type into Claude Code now |
| πŸ“° | `techNews` | 18% | One-line tech-news headline |
| πŸ€“ | `til` | 14% | "Today I learned" fact a senior eng would still find surprising |
| πŸ˜† | `devJoke` | 10% | Programmer one-liner |
| πŸ₯Ÿ | `dayouShi` | 8% | η¨‹εΊε‘˜ζ‰“ζ²Ήθ―— (Chinese punny quatrain) |

Click the bubble to copy the tip to your clipboard. The menubar 🐾 dropdown
keeps the last 10 tips under **Recent tips** β€” click any to copy.

## Requirements

- macOS 13 or later
- [Claude Code CLI](https://docs.anthropic.com/claude-code) on your `PATH`
(`claude --version` works)

## Install

mypet is built for Claude Code users (it feeds on your CC tokens), so the
natural way in is to let Claude Code install it.

### Option A β€” paste a prompt into Claude Code (recommended)

> Install mypet β€” a cute 3D desktop kitten that lives in my screen corner and
> feeds on Claude Code tokens. Run `brew install --cask anzy-renlab-ai/tap/mypet`,
> then launch the mypet app.

Claude Code runs the install and opens the app for you.

> **No Claude Code yet?** mypet needs it β€” the feed shells out to your local
> `claude` CLI. Get it first at [claude.com/code](https://docs.anthropic.com/claude-code).

### Option B β€” Homebrew yourself

```bash
brew install --cask anzy-renlab-ai/tap/mypet
```

Updates later with `brew upgrade --cask mypet`.

### Option C β€” pre-built `.app` (manual)

1. Grab the latest `mypet-x.y.z-macos.zip` from
[**Releases**](https://github.com/anzy-renlab-ai/mypet/releases/latest).
2. Unzip β†’ drag `mypet.app` to `/Applications`.
3. **First launch only:** macOS Gatekeeper will say *"developer cannot
be verified"* because the app is ad-hoc signed (no Apple Developer ID).
Right-click `mypet.app` β†’ **Open** β†’ **Open** in the dialog. Or:
```bash
xattr -d com.apple.quarantine /Applications/mypet.app
```
4. Look for the 🐾 paw in your menubar.

### Option C β€” build from source

```bash
git clone https://github.com/anzy-renlab-ai/mypet
cd mypet
swift run mypet
```

### After install

First launch shows a tiny onboarding wizard (detects `claude`, asks about
launch-at-login, plays a demo feed).

The cat sits in the bottom-right of your **primary** display. The menubar
🐾 gives you `Feed now`, `Recent tips`, `Bring cat to this screen`,
`Snap to edge`, `Launch at login`, and `Quit`.

## Tests

```bash
swift test
```

95 tests cover the `claude` subprocess wrapper (binary discovery, timeout,
cancellation, output normalization including multi-line tips, error
classification, concurrency guard, FD-leak check, JSON envelope parsing for
token capture), the feed log (corruption recovery, cooldown, hungry
detection, max-entries cap), the pet state machine, the feed coordinator
(theme rotation + locale-aware prompts + token reporting), and the window
configuration (snap-to-edge, expanded/compact sizes).

## Layout

```
Sources/MyPet/
App/ MyPetApp, AppDelegate, MenubarController
Window/ PetWindow (borderless, transparent, status-bar level, draggable)
Scene/ TurtleView + CuteCatFace (all-vector cat, no SF Symbol)
UI/ OnboardingView, TipBubble, FeedButton
Domain/ ClaudeSubprocess, FeedCoordinator, PetState, LoginItem
Storage/ FeedLog (JSON in Application Support)
```

See [CLAUDE.md](CLAUDE.md) for the architecture cheat-sheet and invariants
that exist to keep mypet stable + cheap (zero-CPU-when-idle, hover-via-Task,
single-in-flight feed, etc.).

## License

Dual-tracked:

- **Source code** ([LICENSE](LICENSE)) β€” MIT. Fork it, ship it, sell it.
- **Cat artwork & audio** ([Sources/MyPet/Resources/sprites/LICENSE](Sources/MyPet/Resources/sprites/LICENSE))
β€” All Rights Reserved. The fluffy kitten is Β© alvin. Personal use of
mypet is fine; re-packaging the cat in another product / training AI on
the sprites / commercial redistribution requires written permission.

See [NOTICE.md](NOTICE.md) for the full attribution.

PRs welcome on the code β€” especially new tip prompts. Skin contributions
welcome but submitted skins are dual-licensed (code MIT, artwork CC-BY-NC
by default unless you specify otherwise).