A Digimon V-Pet for Claude Code that eats your prompt cache and digivolves from your work
翻译准备中
游戏TypeScriptGitHub @trongtaiz自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
安装型项目无需部署域名也可验证。个人仓库可通过 GitHub 登录验证,组织仓库可使用上方的仓库验证文件。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A Digimon V-Pet that lives above the Claude Code prompt. It eats your session's prompt cache, fights while Claude works, and digivolves by the Digital Monster Color's rules from what you actually do: turns, tests, commits and how well you look after it.
Every Digimon and evolution chart of the five versions: Digitama Hatchery, Digital Monster Color.
/plugin marketplace add trongtaiz/digi-pet
/plugin install digi-pet@digi-pet
Then /reload-plugins, or start a new session. Your pet hatches from a random
egg (one of the five DMC versions).
digi-pet is a hooks-module plugin: it needs a Claude Code build that loads
plugin hook modules. Notifications use osascript, so they are macOS only;
everything else runs anywhere.
The pet sits in a small Digivice in the band above the prompt. What the band shows follows what Claude is doing:
⏵ Bash npm test 12s).With little room (a long draft in the prompt) the band shrinks to the bare
screen, then a half-size one, then a single line. /digi pane opens a side
pane with the full picture: the Digivice, its six stats as bars, the branches
its stage can take and its evolution so far.
Claude Code caches the conversation for a while after each request (60 minutes on a 1-hour cache, 5 on the default one). Coming back before it expires is cheap; after, the whole context is sent again at full price. The pet's hunger is that clock:
| Since the last request (60 min cache) | The pet |
|---|---|
| under 30 min | full |
| 30 to 45 min | peckish |
| 45 to 55 min | hungry: a toast and a macOS notification |
| 55 to 60 min | starving: another warning, with the minutes left |
| 60 min and over | the cache is cold |
Any prompt feeds it. The thresholds scale with ttlMinutes. The pet does not
get hungry when the cache is not worth keeping warm:
restHours, lunch and evenings by default), unless you
/digi wake it, which keeps it up until that window ends;/digi break 90m, /digi break until 15:30) or after
/digi sleep, until your next prompt;/digi side, or a folder listed in sidePaths),
where it still shows when the cache goes cold (cache 42m left (cold at 10:00));minContextTokens, since a small cache is cheap to
rebuild.It also does not warn you about a cache that will expire during rest hours anyway: feeding it then would only move the expiry into the break.
A cache that goes cold, and is then picked up again the same day, is a care
mistake: the pet is sick for the next three turns, and the mistake counts
against it when it digivolves. Like evolution, the pane counts this stage's
only; /digi stats also gives the total. To keep this fair:
dayStartsHour, so
a late night belongs to the evening before);A context over 85% full is an overfeed, which also counts at evolution time. Turns sent in rest hours are sleep disturbances.
While a turn runs, monsters run in from the left and the pet shoots them down.
That part is for show. The real battles are your checks: tests, builds,
type-checks and linters (npm test, pytest, tsc, cargo test, eslint
and the like).
| A check is red | It goes green in the same turn |
|---|---|
Failures are read from the check's output as well as its exit code, since most
runs are piped through tail. When the output names what failed (FAIL tests/a.test.js, src/a.ts(3,1): error TS…), the battle goes by those names,
so the same broken test seen through another command is the same battle. A
failure another session already lost this week is a known one, and costs no
loss again. A test that was broken before you started costs you one loss, not
one every turn.
Only a check run as a command counts: grep jest or a script in a heredoc
is not one. With several checks in one call (npx jest; npx eslint src), each
is judged by the failures it prints itself. A run against other code than your
work (after git stash, on an old commit or a remote branch checked out, or in
a worktree made in the same command) is no battle.
Wins this stage show top right. The win ratio counts this stage's battles only, starts clean at each digivolution, and decides its later evolutions.
Each subagent Claude runs joins the fight as a small Digimon in front of the
pet, its task written above it: Koromon for a general-purpose agent, Tokomon
for Explore, Tsunomon for Plan, Tanemon or Pagumon for any other type. Up to
three stand on the field, and +n counts the rest. When the subagent is done
the ally cheers and leaves; if it failed, it lies grey a moment first. One
still running between turns waits on the pet's own screen.
Allies are for show. What counts toward growth is the summon: each Agent call that returns without an error, whether or not an ally was drawn for it.
Six stats grow from your work. Past 20 points in a day a stat grows a quarter as fast, so no single marathon day makes the pet.
| Stat | Grows from |
|---|---|
| STA | time Claude spends working |
| INT | research: reads, searches, web lookups |
| ATK | lines written (Edit and Write) |
| DEF | checks that pass |
| SPD | parallel tool calls and quick turns |
| SYN | your prompts, pats (/digi pet, three a day) and a streak of active days |
The pet hatches from an egg, then goes Baby I, Baby II, Rookie, Champion, Ultimate and Mega. Each stage lasts a while before it can digivolve (at normal pace; an active day is one with at least five turns):
| Stage | Before it can digivolve |
|---|---|
| Egg | 3 turns |
| Baby I | 25 turns |
| Baby II | 2 active days and 100 turns |
| Rookie | 5 active days |
| Champion | 10 active days and 30 trophies |
| Ultimate | 21 active days, 60 trophies and 10 summons |
| Mega | 14 active days, then a jogress |
A trophy is a commit or an opened pull request; a summon is a subagent.
Pull requests count on any forge whose CLI or MCP server opens them: GitHub
(gh), GitLab (glab, or git push -o merge_request.create), Gitea and
Forgejo (tea, fj), Azure DevOps (az repos pr create) and Gerrit (a push
to refs/for/).
pace makes every stage last a quarter as long (fast) or twice as long
(slow).
Which Digimon it becomes is the Digital Monster Color's own chart. The counts since the pet entered its stage pick the branch: care mistakes, training (turns where Claude used tools, up to 12 a day), overfeeds, sleep disturbances, battles and win ratio. Becoming an Ultimate or a Mega takes an 80% win ratio. Under 40% it never happens; between 40% and 80% there is a chance that rises with the ratio, rolled once a day.
Two house rules sit on top of the chart:
git push --force, --no-verify,
git reset --hard, rm -rf of anything but temp or build folders) and
interrupted turns are chaos. Five or more per day of a stage sends the pet
down the Virus branch where there is one./digi shows the counts and what the next stage still needs. /digi pane
lists the branches: each Digimon the stage can become, the counts its rule asks
for (ticked when met), ▸ on the one the counts lead to now, and the chaos
that would send it down the Virus branch. /digi log lists every digivolution
so far.
A Mega with 15 battles this stage and an 80% win ratio can fuse with the
partner its chart names: /digi jogress. A few Ultimates (Kimeramon) can too,
once their stage has lasted, besides digivolving by their own rule. When both
ways are open, the pet does not pick for you: it waits out that day for
/digi evolve or /digi jogress, and with no pick it digivolves on its own
the next day. Each new pet hatches from one of the
five DMC version eggs at random, and each egg leads to a different chart.
| Command | |
|---|---|
/digi or /digi stats | Stats, hunger, and what the next evolution needs |
/digi pane | Open the side pane: the Digivice, stats, branches and evolution log |
/digi log | Evolution history |
/digi pet | Pat it (the first three a day raise SYN) |
/digi evolve | Digivolve now, when a jogress is also open and the pet waits for a pick |
/digi jogress | Fuse with a partner, where the chart allows |
/digi sleep | Sleep until your next prompt |
/digi wake | Wake it: ends a sleep or a break, and keeps it up through the rest window it is in |
/digi break 90m / until 15:30 / off | A one-off rest window |
/digi side [off] | Mark this session as side work: no hunger |
/digi sim <species> [state] / sim off | Preview any species and state |
/digi debug ttl <min> / off | Shorten the cache TTL to watch hunger play out |
Set them with claude plugin configure digi-pet@digi-pet:
| Option | Default | |
|---|---|---|
ttlMinutes | 60 | Your cache TTL: 60 on a 1-hour cache, 5 on the default one |
restHours | 12:00-14:00,18:00-08:00 | Nap windows, local time |
dayStartsHour | 4 | A late night counts as the evening before |
sidePaths | Globs whose sessions are side sessions | |
minContextTokens | 20000 | Below this the cache is cheap to rebuild; no hunger |
notify | true | macOS notifications when hungry or starving |
pace | normal | fast, normal or slow growth |
reducedMotion | false | Draw everything still |
In the desktop app the band and the pane are drawn as pictures, redrawn as the pet changes: a web page sets rows of text apart and draws block glyphs at other widths, so the pixels would not meet. The pet's screen, the fight and the pane play their loops as the terminal's do; the tool row under the pet is still, and so is a picture too big for the desktop to take, such as a wide field of allies.
bun install
claude plugin test plugin # tests
claude plugin validate plugin
bun run preview # preview/index.html: every state, rendered
bun scripts/preview.ts --html --readme # redraw the images in docs/images
To run your working copy, add the folder as a marketplace:
/plugin marketplace add /path/to/digi-pet.
The code is MIT (see LICENSE). The Digimon sprites, names and evolution data
are not: they belong to Bandai / Toei, and digi-pet is an unofficial fan
project. See NOTICE.md.