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

@anna-jay/opencode-tokenstats

v0.1.2

Published

Shows cumulative input/output tokens and cache hit rate in the OpenCode TUI.

Readme

tokenstats

OpenCode TUI plugin that displays cumulative token usage for the active session in the prompt footer:

IN 12,345 · OUT 1,234 · CACHE 82%

IN includes input, cache reads, and cache writes. OUT includes generated output and reasoning tokens. Cache hit is cache-read tokens divided by all input and cache tokens. Values depend on usage reported by the provider.

The OpenCode TUI plugin API does not expose a slot inside the built-in agent/model/provider label, so tokenstats uses prompt.footer.status beside the composer.

Install

opencode plugin add @anna-jay/opencode-tokenstats

To pin a release, use opencode plugin add @anna-jay/[email protected] after publishing that version.

Publish this scoped package publicly with npm publish --access=public.

Local development

From this repository, copy the plugin into the project-local discovery directory:

npm run dev:copy

OpenCode discovers .opencode/plugins/tokenstat/ automatically. The no-op server entrypoint does not need @opencode/plugin at runtime; the TUI entrypoint imports @opencode/plugin/tui, which OpenCode resolves for local CLI plugins. For local type checking, install dependencies with npm install. Run npm run dev:copy again after editing the plugin files; if the TUI does not reload the plugin automatically, restart OpenCode. The .opencode/ directory is git-ignored.

The plugin appears in both server and TUI plugin views by design: index.ts is a no-op server entrypoint needed for automatic TUI loading, while tui.tsx renders the token counter. These are two entrypoints of the same local package, not two copies of the UI.