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

@madsoftwaredev/opencode-stats

v0.1.2

Published

OpenCode V2 TUI plugin for token speed and session-wide turn and step counts.

Downloads

487

Readme

@madsoftwaredev/opencode-stats

An OpenCode V2 TUI plugin by MAD Software. It adds three inline statistics to the session prompt footer:

44.4 tok/s · 3 turns · 8 steps
  • Token speed matches OpenCode's turn-wide calculation: output and reasoning tokens divided by the sum of time.streamed - time.created across assistant steps in the latest completed step's turn. Input tokens and each step's streamed-to-completed tail are excluded. The previous measurement stays visible while a new response streams. Before one exists, it shows — tok/s.
  • Turns count session execution groups started by a user or synthetic input. Inputs queued during one execution count as one turn; legacy sessions without idle boundaries count each input as a turn. The running turn is included.
  • Steps count assistant model steps, including a running step. Both counts cover the full session history, not just the messages currently visible in the TUI. Counts show — briefly while history loads.

Install

opencode plugin add @madsoftwaredev/opencode-stats

Restart the TUI to load the plugin. It runs in the terminal, so it does not need a server-side entry in opencode.json.

Configure

The three statistics are independently configurable in ~/.config/opencode/cli.json. Replace the package's string entry with the object form, preserving your other plugins:

{
  "plugins": [
    {
      "package": "@madsoftwaredev/opencode-stats",
      "options": { "speed": true, "turns": true, "steps": true }
    }
  ]
}

Each option is an independent boolean and defaults to true when omitted. Open Configure footer stats in the command palette, or run /stats in the TUI, to toggle any statistic. Choices are saved across TUI restarts and take precedence over cli.json defaults. Choose Reset to configured defaults in the same menu to follow the file again. When all three are off, the plugin adds nothing to the footer. Outside a session, it shows no statistics.

Develop

From the monorepo root, run the focused unit tests with:

bun test ./packages/stats/stats.test.js