Masko and Petdex Alternatives: Building a Custom Rive Companion for Claude Code
By the Charmotion team · Updated · How we write guides

For a custom Claude Code desktop companion, Masko and Petdex are ready-made options, while a Rive character gives you the own-design route: one .riv file with a state machine, a mood input driven by Claude Code hooks, and a window you control.
Key takeaways
- Masko is a generator with credit-based pricing; Petdex is an open-source gallery of pixel pets that a desktop app floats on screen.
- Neither documents native Rive (.riv) export as of December 2026, so a Rive character is the route to your own drawing with state logic.
- A Rive companion needs one mood number per state, fed by Claude Code hook events through a small local bridge.
- An Electron window can float the character over the desktop, and Rive's runtimes play the same .riv file in each app.
- Start with one finished character image and four or five moods, then add states only when the companion needs them.
What do Masko and Petdex each give you for Claude Code?
If you want a companion that reacts while Claude Code works, two ready-made options exist, and both are worth knowing before you build your own. This guide covers Masko and Petdex alternatives for a custom Claude Code desktop companion: where each one stops, and how a Rive character with a state machine can take over the parts you need to control.
| Tool | What it is | How it reaches Claude Code | Output you get |
|---|---|---|---|
| Masko | AI tool that generates mascots and logos and animates them, through a web Studio, a REST API and an MCP server | The Masko Code desktop app runs a state machine (idle, working, attention, thinking) and hooks into Claude Code. The MCP server can be called from Claude Code, Codex or Cursor. | Transparent WebM, HEVC .mov, a stacked MP4 for Android and a plain MP4. Canvas exports are MaskoAnimationConfig JSON (version 2.0). |
| Petdex | Open-source gallery of animated pixel pets, with a desktop app that floats a chosen pet on screen | In the app's Settings, each coding agent is connected with one click, and the app writes the hook files itself. Claude Code is on the supported list. | A pet pack with pet.json and a spritesheet. Codex-format sheets use an 8x9 or v2 8x11 grid of 192x208 frames. |
Pricing differs a lot. Masko's Studio lists a single image at $0.125 and a 5-second animation at $1.25 (as of December 2026), and new accounts start with $2.63 in credits. Masko's own pages say credit packs start at $15 with no subscription, while some third-party reviews describe a monthly plan, so check masko.ai before you commit. Petdex does not document pricing (as of December 2026), so check petdex.dev for current terms.
Where do Masko and Petdex fall short for a custom companion?
Both products do their core job well: a pet on your screen that reacts to a coding agent. The gaps appear when the character must be your own design, follow your rules, or run inside your own product.
- Your file, in a runtime. Masko animates an uploaded image without redrawing it, which is useful. But Masko does not document native Rive (.riv) export (as of December 2026), so its outputs are video and JSON rather than a runtime file you drive from code.
- Named states. Masko's state machine is its own engine and format. Petdex packs are spritesheets that play frames on a fixed grid. Neither exposes a named mood value that your code sets directly.
- Licensing. The Petdex gallery is described as open source, but Petdex does not document the desktop app's licence (as of December 2026). Check the repository before you bundle it into a product.
- Your own surface. A pet floating over the desktop suits a personal tool. A companion inside your app, website or dashboard needs a runtime you embed.
Masko is closer to a custom build than Petdex, because its canvas export keeps nodes, edges and transitions. It is still Masko's format, so you depend on Masko's tools to change it.
How do Claude Code events drive a Rive character?
Claude Code hooks run your own command, HTTP endpoint, MCP tool or prompt at points in a session, such as before or after a tool call, when a notification fires or when Claude stops. Those events are your signals. The companion only needs a map from each signal to a state.
Use one number property called mood in the Rive file, and give each state its own value. Charmotion's documented mood numbers are a useful convention: idle 0, happy 1, wave 2, thinking 3, sad 4, loading 5, listening 6, talking 7, sleeping 8, attention 9. You can use your own numbers, but write the table down once and keep it in the repository.
| Claude Code moment | Mood number | Character state |
|---|---|---|
| Before a tool call starts | 5 | loading |
| Claude is planning or reasoning | 3 | thinking |
| After a tool call reports an error | 4 | sad |
| A notification fires and input is needed | 9 | attention |
| Claude stops after finishing work | 1 | happy |
| No activity | 0 | idle |
Keep the mapping small. Five or six states cover most sessions, and every extra state is one more thing to design, test and explain to a coding assistant later. The Rive side is covered in how Rive state machines work.
How do you build the companion step by step?
This is the full path from a character image to a companion that floats on the desktop. It takes one designer, one developer and about a day for a first version.
- Pick one character image. Use a finished, front-facing character with visible eyes and mouth on a transparent background. Avoid groups, sketches and busy scenes.
- Build the Rive file. Make one artboard with a state for each mood and a state machine that switches between them. Add a number input or a data-bound number named
mood. See Rive state machine inputs for the setup. - Write a local bridge. A small Node process receives the hook payloads from Claude Code and turns each event into a mood number. Keep it on the same machine, since the companion runs there too.
- Wire the hooks. Add the hook entries to Claude Code's settings. The hooks page lists the file locations and the exact event names, so copy them from there rather than from a blog post.
- Float the view and test every mood. Show the Rive view in a transparent Electron window, run a real session, and check each mood against the event that should trigger it.
What does the bridge and Rive view code look like?
The bridge is plain JavaScript. It maps event names to mood numbers and falls back to idle for anything unknown:
const MOOD_BY_EVENT = {
'tool-start': 5,
'tool-error': 4,
'notification': 9,
'stop': 1
};
function moodFor(eventName) {
return MOOD_BY_EVENT[eventName] ?? 0;
}In Electron, the main process calls moodFor and sends the number to the renderer over inter-process communication. The renderer writes it to the Rive view. The Electron docs describe the main and renderer split (Electron documentation).
For the web view, the Rive React runtime loads the file with the useRive hook, which returns the component to render and the Rive instance. Pass the state machine name in the options:
import { useRive } from '@rive-app/react-canvas';
const { RiveComponent, rive } = useRive({
src: 'companion.riv',
stateMachines: 'CharacterStateMachine',
autoplay: true
});
return RiveComponent;Do not build the mood setter on useStateMachineInput. The React runtime's docs mark that hook as deprecated in favour of the newer data binding hooks, so read the current hooks list in the Rive React runtime docs before you write the setter. For the broader setup, see how to use Rive in React and Next.js.
How do you float the companion on the desktop?
The window is the part most people skip. A companion that sits in a normal frame looks like an app, not a pet. Electron exposes window options such as transparency, so you can create a borderless window that shows only the character.
const { BrowserWindow } = require('electron');
const win = new BrowserWindow({
width: 240,
height: 240,
transparent: true,
frame: false
});
win.loadFile('companion.html');Rive's WASM runtime loads from the default unpkg CDN or from your own server, so self-hosting the runtime keeps the companion working offline (Rive WASM runtime docs). Test the window on each operating system you ship. Petdex lists macOS, Linux and Windows for its own app, and a custom build needs the same check.
Rive's runtimes are open source and play any .riv file, so the same character file can later run in a website or a mobile app. On Rive's Free plan, exported files play a Rive splash screen, so review Rive pricing and commercial use before you ship.
Which route should you pick for a Claude Code companion?
- Petdex if you want a pixel pet running in minutes and you accept its spritesheet format and its open licence questions.
- Masko if you want generated art, talking clips or a Studio workflow, and you accept its credit pricing and its output formats.
- A Rive companion if the character must be your exact drawing, must run inside your own product, and must react to events you define.
For a broader view of alternatives, see Rive alternatives, and for how an animated assistant can map to chat events, see AI Elements persona vs a custom Rive character.
If you would rather start from one finished image than build the rig yourself, Charmotion turns a character image into a Rive file with a CharacterStateMachine, a CharacterViewModelMachine with a number property named mood, and paste-ready web, React and SwiftUI code. Characters have no one-shot triggers, so a success shows as happy and an error as sad, which matches the mapping above. Plans and credits are on the pricing page.
Disclosure: Charmotion is our product.
Build a custom Rive companion for Claude Code
- Pick one character image. Use one finished, front-facing character with visible eyes and mouth on a transparent background. Avoid groups, sketches and busy scenes.
- Build the Rive file. Make one artboard with a state per mood, a state machine that switches between them, and a number input or data-bound number named mood.
- Write a local bridge. Run a small Node process that receives Claude Code hook payloads and converts each event into a mood number on the same machine.
- Wire the hooks. Add the hook entries to Claude Code's settings, copying the file locations and event names from the official hooks page.
- Float the view and test. Show the Rive view in a transparent Electron window, run a real session and confirm that each mood appears for the event it maps to.
Frequently asked questions
Can Masko export a .riv file for Rive?
Masko does not document native Rive (.riv) export (as of December 2026). Its documented outputs are transparent WebM, HEVC .mov, a stacked MP4 for Android, a plain MP4 and a canvas JSON export. Check masko.ai for newer formats before you plan a Rive pipeline around it.
Does a Petdex pet work with agents other than Claude Code?
The Petdex homepage lists ChatGPT (Codex), Claude Code, Gemini CLI, OpenCode, Qoder, Kimi Code, CodeBuddy and OMP as supported agents. Its desktop app reacts to whichever connected agent is active. Confirm each agent's connection steps on its Petdex agent page before you rely on it.
Can the same companion run with Codex or Cursor?
Masko's MCP server and REST API can be called from Claude Code, Codex or Cursor. A custom bridge works with any agent that exposes hooks or events, but you need to check each agent's own hook documentation and write its event names into the mapping table.
Do I need a paid Rive plan to build the companion?
You can build and test a .riv file on Rive's Free plan, but exported files play a Rive splash screen there. Rive's runtimes are open source and play any .riv file. See the Rive pricing guide for the current plan details before you ship.
Sources
- Masko, Masko
- Masko canvas export format, Masko
- Petdex, Petdex
- Petdex README, GitHub (crafter-station)
- Claude Code hooks, Anthropic
- Rive React runtime, Rive