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

opencode-token-saver

v0.1.1

Published

Safe Token Saver guidance and child-session no-progress watchdog for OpenCode/OpenChamber.

Readme

Token Saver for OpenCode and OpenChamber

This adapter preserves Token Saver's safe token-efficiency guidance while leaving OpenCode's native compaction, planning, tool calls, and tool output untouched. It additionally uses the public OpenCode event hook to abort only a child session that has had no observed progress for 120,000 ms. Root/main sessions are never armed or aborted.

Install

Install the published package into OpenCode/OpenChamber's shared plugin directory:

npx --yes opencode-token-saver

It copies the package's self-contained plugin file to the configured OpenCode plugin directory and tells you when a restart is needed. This is the recommended one-command install for OpenCode and OpenChamber.

For current OpenCode and OpenChamber 1.x, the native installer is also available:

opencode plugin opencode-token-saver --global

On a fresh 1.18.x cache, the native installer can download the package but report a dependency-install error on its first run; retrying the same command normally finishes it. The npx installer above avoids that path.

For the OpenChamber-bundled OpenCode binary on macOS:

/Applications/OpenChamber.app/Contents/Resources/opencode-cli/opencode plugin opencode-token-saver --global

Newer OpenCode v2 uses its updated command form:

opencode plugin add opencode-token-saver

For local development without publishing, pass this package directory to the same 1.x installer:

opencode plugin "$(pwd)" --global

index.js is self-contained and can also be copied directly into the shared OpenCode plugin directory:

mkdir -p ~/.config/opencode/plugins
cp index.js ~/.config/opencode/plugins/token-saver.js

OpenCode and OpenChamber share the OpenCode engine and configuration directory, so one global installation covers both. Restart or start a new OpenCode/OpenChamber session after installing or copying it.

Controls and safety

  • TOKEN_SAVER_ENABLED=false, 0, off, or no returns no active hooks.
  • TOKEN_SAVER_STALL_TIMEOUT_MS accepts a positive millisecond override; the default is 120000.
  • Child status comes from session.created / session.updated info.parentID. Unknown IDs are checked through client.session.get before any timer is armed.
  • Message, part/tool lifecycle, todo, and permission progress reset a child timer. Idle, error, and deletion clear it.
  • Abort errors are contained and cannot crash the host. The adapter does not prove a particular host runtime delivered an event or killed a live child; its replay proves the plugin's client abort decision for the recorded event shape.

Run the portable test suite with npm test (it uses Node's built-in test runner).