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

@esuyo/esuyo-opencode-session

v2.0.11

Published

OpenCode TUI sidebar showing token usage across a session and its subagents, plus live TPS/AVG/TTFT/GAP throughput in the prompt footer with optional JSONL stats logging.

Readme

Session Summary

One plugin, three live views for the OpenCode terminal:

  • Sidebar usage — what this session has cost: tokens, money, cache behaviour, and how much of the work was done by subagents. Everything it shows covers the whole session family — the session you are looking at plus every subagent it started.
  • Details page — the full breakdown in the main panel: per-agent, per-model and per-subagent splits, slowest step, retries, and provider errors.
  • Footer throughput — how fast it is running: TPS live | AVG | TTFT | GAP in the prompt footer, with per-step JSONL logging.

The sidebar is a hard fork of opencode-plugin-session-token-summary by Nick Braun (@njbraun).

The throughput line is a hard fork of Tarquinen/oc-tps by Tarquinen (@Tarquinen).

See Credit.

What you get

Sidebar: what it cost

A token panel in the sidebar — input, output, reasoning, cache write and cache read tokens, the cache hit rate, a total, and the cost. Assistant turns are shown next to the title.

Cost you can trust — when the provider reports a cost, it is shown as reported. When it reports nothing (quota plans, subscription plans, Claude Pro, Copilot), the cost is estimated from OpenCode's own model catalog at published API rates, and the label says so: $ cost, $ est. cost, or $ cost incl. est. for a session that mixes both.

An expandable Session Summary block — tool calls and failures, files touched, subagent split, model split, what the prompt cache saved you, truncated/errored/retried steps, session age, and how long the agents were actually busy.

Details page: the full breakdown

One click replaces the main panel with the complete breakdown: tokens, cost, activity with how long each tool ran, per agent, per model and per subagent, how deep the session family goes, the slowest step, the retries, and the last provider error.

Footer: how fast it runs

A live throughput line in the prompt footer — TPS live | AVG | TTFT | GAP, ported from @esuyo/esuyo-opencode-tks. Live tokens/sec over the last 5s streaming window, the session-average tokens/sec and time-to-first-token across completed model steps, and the gap since the previous final completion. Every completed model step is also appended as one JSON object per line (numeric metadata only, never prompt text) to ~/.local/share/opencode/esuyo-opencode-tks.log (ESUYO_TPS_LOG overrides, /dev/null disables).

Nothing here costs an extra request. Every number is derived from the session and message data the panel already reads, so expanding the block or opening the page is instant.

Requirements

OpenCode 2 (>=2.0.28). This is a terminal plugin, so it is configured in cli.json, not in opencode.json.

For OpenCode 1, use the original upstream plugin instead: this fork does not support the V1 terminal API.

Install

From npm — this fork is published as @esuyo/esuyo-opencode-session:

opencode plugin add @esuyo/esuyo-opencode-session

From GitHub — OpenCode also accepts a Git package specifier, which is how you run changes that are not in a release yet:

opencode plugin add github:8perezm/esuyo-opencode-session

Pin a branch or tag if you want a fixed version, for example github:8perezm/esuyo-opencode-session#main.

Do not install the unscoped opencode-plugin-session-token-summary: that is the upstream original, which this project is a fork of. Having both installed renders two copies of the block.

From a local checkout — useful if you want to edit it or run an unreleased version:

git clone https://github.com/8perezm/esuyo-opencode-session.git
cd esuyo-opencode-session
npm ci

Then put the checkout directory in the plugins array of ~/.config/opencode/cli.json, alongside any plugins you already have:

{
  "$schema": "https://opencode.ai/v2/cli.json",
  "plugins": [
    "/absolute/path/to/esuyo-opencode-session"
  ]
}

Use the directory, not tui.tsx: OpenCode 2 resolves the tui entrypoint from a directory and skips direct-file TUI entries. Restart the TUI if the panel does not appear.

If the sidebar itself is hidden, that is an OpenCode setting, not a plugin one — see session.sidebar in cli.json.

Docs

Credit and license

The sidebar is a hard fork of opencode-plugin-session-token-summary by Nick Braun (@njbraun), who wrote the sidebar panel, the cost estimation against OpenCode's model catalog, and the subagent aggregation that this project is built on. The original MIT license and his copyright notice are kept untouched in LICENSE.

The TPS | AVG | TTFT throughput line is derived from Tarquinen/oc-tps at commit 89bf5b8 (v0.0.10). The upstream project declared no license; original work remains attributed to its author.

MIT, same as the original — see LICENSE.