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-active-context

v0.1.0

Published

Active Context Manager — model-driven context compression for OpenCode (MIT)

Readme

opencode-active-context

Active Context Manager for OpenCode — model-driven context compression with a clean MIT implementation.

The model decides when and what to compress — not a hard limit.

Install

opencode plugin opencode-active-context@latest --global

Or add to your opencode config:

{
    "plugin": ["opencode-active-context@latest"]
}

Important: Disable OpenCode's built-in auto-compaction — ACM handles context management itself.

{ "compaction": { "auto": false } }

How It Works

ACM gives the model a compress tool. When context grows, the model compresses consumed ranges into summaries. The model is 100% responsible for deciding when and what to compress.

Tools

| Tool | Description | |------|-------------| | compress | Replace a contiguous message range with a summary block | | decompress | Restore a compressed block's original content | | search_context | Search compressed block summaries by keyword | | acm_status | Inspect context usage, compressible ranges, and block details | | acm_context_recap | System tool — injects compression summaries as tool-results |

Nudge System

When context grows beyond the threshold, ACM injects a nudge showing:

  • Context usage breakdown (tool / summaries / text / code)
  • Compressible ranges grouped by conversation turn
  • Compression philosophy and HOW TO COMPRESS rules

The nudge frequency adapts to the model's context window (5% of limit, halved after first nudge if model doesn't compress).

Configuration

Config file: ~/.config/opencode/acm.jsonc

{
    "enabled": true,
    "debug": false,
    "notification": "detailed",
    "compress": {
        "permission": "allow",
        "maxContextLimit": "55%",
        "minContextLimit": "45%",
        "nudgeFrequency": 5,
        "protectedTools": ["skill"],
        "keepEmbedMaxChars": 2000,
        "maxSummaryLength": 10000,
        "minCompressRange": 2000
    },
    "gc": {
        "promotionThreshold": 5,
        "maxBlockAge": 15,
        "maxOldGenSummaryLength": 3000
    }
}

KEEP/REF Markers

Summaries can reference original content without retyping it:

  • [[KEEP:m00065]] — auto-expanded to original message content inline (truncated to keepEmbedMaxChars)
  • [[REF:m00065|description]] — compact link [→ m00065: description]

Commands

ACM provides an /acm slash command:

| Command | Description | |---------|-------------| | /acm context | Token usage breakdown | | /acm stats | Cumulative compression statistics |

Storage

| What | Path | |------|------| | State | $XDG_DATA_HOME/opencode/storage/plugin/acm/{sessionId}.json | | Config | ~/.config/opencode/acm.jsonc | | Logs | ~/.config/opencode/logs/acm/ |

License

MIT — see LICENSE.