npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tokengotchi

v0.3.0

Published

An idle auto-battler fueled by your real AI coding token usage. Your work powers your hero.

Readme

Tokengotchi

An idle RPG that runs on your AI coding tokens. You code; a little hero spends the energy fighting through floors, leveling up, and finding loot. Come back from a session to see what it cleared while you were heads-down.

Tokengotchi

npx tokengotchi

One command. It reads the usage your AI agent already writes to disk, turns it into energy, and opens the game in your browser. Nothing leaves your machine.

Live demo & video » · runs locally · free · no pay-to-win

What it does

  • Reads your local usage from Claude Code, Codex, and Gemini (Cursor is experimental) — the same logs ccusage reads.
  • Turns tokens into combat energy and auto-battles an idle dungeon: floors, bosses, gold, XP, and gear drops.
  • Three classes — Vibe Coder (crit), Refactorer (tank), Architect (balanced). Swap anytime.
  • Loot from Common to Legendary, auto-equipped, with a hero that visibly evolves as it levels — gaining a weapon, an aura, wings, a crown, orbiting orbs.
  • Attack styles unlock as you climb: melee → ranged → multi-shot → beam.
  • Prestige ranks (Bronze → Mythic) for a permanent multiplier and the long climb, through themed zones with milestone rewards.
  • A lot of code-driven "juice" — hit flashes, crits, knockback, damage numbers, particles, screen shake.

Opens as a chromeless app window by default (park it next to your editor), or install it as a PWA. The UI is responsive down to a thin side strip.

"Wait, doesn't this reward me for burning tokens?"

No — that was the main thing to get right. Rewards are streak-weighted, so showing up consistently beats raw volume. It's PvE only, so you're racing floors, not anyone's spend. And it's free with no pay-to-win. The point is to make the work you're already doing a bit more fun, not to get you to spend more. (There's an optional sub-linear daily taper you can switch on if you want it even stricter.)

Options

npx tokengotchi              # real usage, opens in an app window
npx tokengotchi --mock       # fake usage, for a quick look
npx tokengotchi --tab        # a normal browser tab instead of an app window
npx tokengotchi --port=7070  # change the port
npx tokengotchi --no-open    # don't auto-open anything
npx tokengotchi --once       # one sync, print a summary, exit

Your save lives at ~/.tokengotchi/save.json.

How it works

Tokengotchi never calls a provider API. Your AI agent already writes token counts to local log files as you work — it reads those, advances a cursor so it never double-counts, converts the delta into energy, resolves a combat session, and replays it in a PixiJS view over a local WebSocket.

| Tool | Reads from | |---|---| | Claude Code | ~/.claude/projects/**/*.jsonl | | Codex | ~/.codex/sessions/**/rollout-*.jsonl | | Gemini CLI | ~/.gemini/tmp/**/chats/*.{json,jsonl} | | Cursor | local state.vscdb — experimental; needs Node ≥22.5 or npm i better-sqlite3 |

Adding another tool is one small adapter in src/readers/.

Free & open

The whole game is free — no accounts, no telemetry, no paywall. If you want to chip in, there's a Support button in the app (it never buys anything in-game):

  • Ko-fi — https://ko-fi.com/danzin
  • Buy Me a Coffee — https://buymeacoffee.com/danzin

Development

git clone https://github.com/DanZinov/tokengotchi
cd tokengotchi
npm install
npm run demo        # build the client + run with mock usage
npm test            # unit tests (deterministic, seeded)
npm run typecheck

The game math — conversion, combat, loot, progression, prestige — lives in src/engine/ as pure, tested functions. Readers are in src/readers/, the CLI and local server in src/cli/, and the PixiJS client in src/client/. Tuning lives in src/engine/constants.ts. Everything is drawn from Pixi primitives, so it runs with zero downloaded assets.

PRs welcome — new tool readers, balance tweaks, and art especially.

License

MIT