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-title-updater

v0.1.2

Published

Refresh OpenCode V2 session titles after readable or native context compaction.

Readme

opencode-title-updater

Keep the session title in step with the work.

Long sessions change direction. After OpenCode compacts the context, Title Updater uses the finished summary and previous title to rename the session to match its current focus. When the summary is an opaque native checkpoint, it asks the session's chat model using the session context instead.

Readable summaries use one fresh-context request. Native checkpoints use an auxiliary generation request in the original session, without adding a message to its history.

Install

Add the package to plugins in your global or project opencode.json(c):

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["opencode-title-updater"],
  "agents": {
    "title": {
      "model": "openai/gpt-6.1-sol#low"
    }
  }
}

Already have agents.title.model configured? Keep it. The plugin uses that exact provider, model, and variant. The model above is only an example; use one available through your connected providers.

OpenCode reloads configuration automatically. No server restart is needed.

Requires OpenCode V2 2.2.1 or newer. Plugin ID: hffmnnj.title-updater.

How it works

Context compaction finishes
          │
          ├── Readable summary → Configured title model
          └── Native checkpoint → Session chat model and context
                     │
              Updated session title
  1. Listen for session.compaction.ended, for automatic and manual compactions.
  2. Read the session's previous title.
  3. For a readable summary, ask the configured title model for a short title using only that summary and the previous title. For an opaque native checkpoint with no readable summary, ask the session chat model for a title from its current context instead.
  4. Rename the original session only if the result is valid and the operation is still current.

For readable summaries, V2's experimental.generate.text API has no access to session history, project instructions, or tools. Native checkpoints are not decoded or passed as text: session.generate uses the session's own model and current context, which may include messages arriving after compaction. Authentication stays with OpenCode's provider integration.

Small by design

| What happens | What does not | | --- | --- | | One title request per new, eligible compaction | No plugin-side transcript replay | | The previous title provides continuity | No extra assistant turn in the original session | | Newer compactions supersede older title work | No stale result intentionally overwrites newer work | | Title edits made during generation are respected | No unconditional rename after a slow response | | Failures leave the existing title in place | No guessed model when a readable summary lacks a configured title model | | Unloading cancels pending work | No polling, scheduled jobs, or persistent plugin state |

The package has one runtime dependency: the official @opencode/plugin SDK.

Boundaries

  • Configure a title model for readable summaries. If agents.title.model is absent, the plugin skips that update rather than guessing OpenCode's title-model fallback. Native checkpoints use the session's chat model instead.
  • Native checkpoints remain opaque. With an empty summary and native checkpoint, the plugin asks the session's chat model for a title using its current context. An empty summary without a native checkpoint is skipped. The plugin never decrypts or sends a checkpoint as text.
  • A short, plain-text title is required. Empty, multiline, malformed, or excessively long responses do not replace the title.
  • Manual names are not permanently pinned. Each later compaction may update the current title. A rename made while a title request is running is preserved for that request.
  • Provider usage applies. An eligible compaction makes an additional generation request to the configured title model or, for a native checkpoint, the session's chat model. No automatic plugin retries are added.
  • Experimental V2 API. Stateless generation is experimental in OpenCode. This release is built against @opencode/plugin 2.2.1; future API changes may require an update.

Warnings identify the plugin and failure category without printing summaries, generated titles, or provider error bodies. Remove the package from plugins to disable it.

The final title check and rename are separate API operations: OpenCode does not expose an atomic conditional rename. An edit racing in that small interval cannot be guaranteed to win.

Development

bun install
bun run check
npm pack --dry-run

The tests exercise the plugin's event boundary, exact model selection, request isolation, duplicate events, overlapping requests, manual edits, failures, and cleanup without calling a provider.

License

MIT.