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

acp-headroom-opencode

v0.2.5

Published

Headroom tool-output compression for OpenCode — compresses oversized tool results via a local Headroom proxy and lets the model retrieve originals back by hash.

Readme

acp-headroom-opencode

Headroom tool-output compression for OpenCode — same sent-view architecture as acp-headroom-pi.

Install

npm i -g acp-headroom-opencode
// ~/.config/opencode/opencode.json
{ "plugin": ["acp-headroom-opencode"] }

Requires a local Headroom proxy (auto-spawned when reachable tooling exists):

uv tool run --from "headroom-ai[proxy]" headroom proxy --port 8787

What it does

  • Sent-view compression (experimental.chat.messages.transform): completed tool results older than the last user message and ≥ 4000 chars are compressed before the LLM call; your current-turn working set is never touched.
  • System prompt injection (experimental.chat.system.transform): teaches the model the marker formats and the retrieval tools.
  • Compaction self-heal (experimental.session.compacting): session summaries are instructed to preserve retrieval hashes, so nothing becomes unrecoverable after compaction.
  • Tools: headroom_retrieve(hash) pulls back exact originals; headroom_search(query) full-text search across all saved originals; headroom_compress(text) compress on demand; headroom_status() reports savings with real provider-reported token usage.
  • Fail-open: proxy down ⇒ everything passes through uncompressed.

Slash command

/headroom-status is registered by the plugin itself and renders instantly with zero LLM involvement (empty-template command + command.execute.before interception). /headroom-search and /headroom-retrieve remain prompt-based on purpose — their output belongs in the model's context.

Config

HEADROOM_PROXY_URL=http://127.0.0.1:8787   # proxy base URL
HEADROOM_MIN_CHARS=4000                    # min result size
HEADROOM_AUTOSTART=0                       # disable auto-spawn

Folded-range state persists per session at ~/.local/share/opencode/storage/plugin/acp-headroom/<sessionID>.json (XDG-aware; HEADROOM_RANGES_DIR overrides), so context stays compressed across restarts.

Cost model — read this before using acp_compress heavily

Range compression rewrites history, which invalidates the provider's prompt cache for that call — each fold event bills the full tail once. The economics:

  • Low-frequency, large batches (the intended use): one invalidation, then every later call saves ~60% input at warm cache — pays back in a few turns.
  • Repeated small folds: multiple full-price calls for near-zero savings.

Rules of thumb: fold only fully-consumed stretches, batch ranges in one call, and leave the recent working set alone. The GC safety net evicts old summaries automatically at 95% of the window, so summary overhead never compounds.

MIT © wentaonb123