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

@jeffreyjyz/opencode-context

v0.1.1

Published

Context-window breakdown for opencode: a /context dialog plus a context_breakdown tool showing where the window went (system prompt, tool definitions, thinking, tool I/O, messages), delta.app style.

Readme

@jeffreyjyz/opencode-context

Context-window breakdown for opencode. /context opens a dialog showing where the window went — system prompt, tool definitions, thinking, tool inputs and outputs (split per tool), user and assistant messages — with a stacked bar and a measured used / limit header, in the style of delta.app's Context Window. A context_breakdown tool returns the same numbers as markdown so a model can ask for them itself.

Install

Add it to the plugins array in ~/.config/opencode/opencode.json and restart (or /reload) opencode:

{
  "plugins": ["@jeffreyjyz/opencode-context"]
}

For local development point at the checkout instead — an absolute path is treated as a local plugin:

{
  "plugins": ["/Users/you/dev/cmdcode-tools/opencode-context"]
}

A symlink under ~/.config/opencode/plugins/ is also picked up. After bun run build in the checkout, the root index.js / tui.js shims load dist/.

Use

  • /context — opens the breakdown for the current session.
  • context_breakdown — the model calls it and gets the breakdown as markdown.

How it works

Two halves of one package, because they run in different processes:

| half | file | job | | --- | --- | --- | | server | src/index.ts | measures the assembled system prompt and tool definitions on every request (their sizes only) and registers the tool | | TUI | src/tui.tsx | the /context slash command and the dialog |

The message store holds no system prompt or tool schemas, so the server half records their byte sizes in $XDG_CACHE_HOME/opencode-context/<session>.json (one small JSON per session; no prompt text) and the dialog reads them. The rest of the breakdown comes straight from opencode's live data — the replayable context (session.context, post-compaction), the model's context limit, and the agent instructions as a fallback.

Units: each row shows UTF-8 bytes (delta's size column) and the header shows the provider's measured tokens over the model limit. Per-row percentages are share of the byte total.

Development

bun install
bun test
bun run typecheck
bun run build

Notes

  • The System Prompt and Tool Definitions rows need one request to have happened in the session (that is when they are measured); before that the System Prompt row falls back to the agent instructions and Tool Definitions is hidden.
  • Only sizes are cached, never prompt or tool text.
  • The install cache for a published version can lag npm; see the ecosystem notes in AGENTS.md before publishing.