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

hffmnnj.prompt-cache

v0.1.0

Published

Append-only OpenCode context snapshots with content-free reset diagnostics

Readme

OpenCode prompt-cache projection

hffmnnj.prompt-cache retains trusted Goals, Memory and Clef context snapshots in their original positions and appends changed snapshots. The latest revision from each producer supersedes older revisions. This preserves an append-only request prefix between genuine history changes; it does not guarantee provider cache hits.

Install

Add exactly one projection entry after the plugins that produce transient context:

{
  "plugins": [
    { "package": "[email protected]" }
  ]
}

Replace an existing local opencode-cache-protect/prompt-cache entry rather than loading both. The runtime ID remains opencode.prompt-cache, so existing plugin storage and snapshot keys remain compatible. The package does not register or replace the separate Cache Protect safety guards.

The plugin uses OpenCode's context hook, not a provider transport or unsupported cache field. Its small message-constructor graph is bundled; the plugin API and the constructor graph's Effect runtime are explicit pinned dependencies, so the package does not rely on a source checkout's dependency hoisting. No inference, retries or keepalives are introduced.

Diagnostics

The existing opencode.prompt-cache log includes resetReasons: an empty array when retained snapshots were not reset, otherwise directly observed causes:

  • model_changed: the retained state's model identity differs.
  • system_changed: the system-part hash differs.
  • history_shortened: canonical history is shorter than the retained prefix.
  • history_changed: a retained canonical-history hash differs.
  • owners_removed: a producer was removed while the other prefix checks passed.
  • producers_inactive: no trusted active producer remains.

Several observed changes can be reported together. Reset events also carry fixed six-reason resetCounts, cumulative for this plugin instance and restarted on reload. These counts are not provider cache misses. Logs contain existing session and model IDs, counts and fixed reasons, never prompt text, payload hashes or credentials. The diagnostics do not change system parts, messages, tool schemas, snapshot storage or projection decisions.

Model/provider changes normally select isolated storage keys. A previously unseen key can therefore initialize without a reset; model_changed describes a mismatch within retained state, not every model switch or cold provider request.

Limits and local development

Snapshot retention can grow context faster and cause earlier compaction. Genuine instruction, model and history changes still invalidate the retained prefix; provider expiry and billing behavior are outside this plugin's visibility. Malformed or unsupported layouts retain the existing fail-open behavior.

From a source checkout, run bun install --frozen-lockfile and bun run build:prompt-cache at the repository root. The maintained build updates both the local artifact and this package's bundle and revisioned entrypoint. Check the actual loaded V2 plugin catalog after activation; a standalone import is only a packaging smoke test.