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

@parad0x_labs/openclaw-context-capsule

v1.6.0

Published

Self-contained OpenClaw context engine that compresses older agent session history into a bounded extractive capsule, preserving decisions, tasks, errors, files, links, and durable facts while keeping recent messages verbatim.

Readme

context-capsule — OpenClaw ContextEngine plugin

Self-contained OpenClaw context engine that reduces prompt tokens in long agent sessions. It keeps the recent tail verbatim and converts older history into a bounded, model-readable extractive capsule.

The capsule preserves high-value older context:

  • decisions and constraints
  • open tasks and requested work
  • errors and failed attempts
  • files, commands, and links
  • open questions and durable facts

It also keeps a zlib-compressed payload and Merkle root for auditability, but the LLM is given the extractive capsule, not opaque compressed bytes.

Safety and limits

  • Lossy by design. Older messages are not preserved verbatim in the model prompt. Exact wording, nuance, and low-priority details can be lost.
  • Recent context remains verbatim. keepRecentMessages controls how many latest messages stay untouched.
  • Best-effort vault scan. Text content is scanned for common secrets and PII before compression or model injection. This is useful defense-in-depth, not a formal guarantee.
  • No external runtime dependency. The plugin uses only Node built-ins (zlib and crypto) and makes no network, file-system, or on-chain calls.

Activation

// openclaw.json
{
  "plugins": {
    "slots": {
      "contextEngine": "context-capsule"
    }
  }
}

Config options

| Key | Default | Description | | --- | ---: | --- | | minMessages | 20 | Sessions shorter than this pass through unchanged. | | keepRecentMessages | 10 | Recent messages kept verbatim after compression. | | maxCapsuleTokens | 700 | Hard cap for the injected extractive capsule. | | capsuleTokenRatio | 0.08 | If OpenClaw provides a model token budget, cap the capsule to this fraction of the budget. | | minCompressTokens | 900 | Estimated transcript-token floor before compression activates. |

{
  "plugins": {
    "entries": {
      "context-capsule": {
        "minMessages": 20,
        "keepRecentMessages": 10,
        "maxCapsuleTokens": 700,
        "capsuleTokenRatio": 0.08,
        "minCompressTokens": 900
      }
    }
  }
}

Packaging

The npm/ClawHub package ships compiled dist/ JavaScript. It does not require TypeScript support from the host runtime.

npm run typecheck
npm test
npm pack --dry-run

When to use

Use this for long-running local or hosted model sessions where resending the full conversation is too expensive or pushes the model toward context overflow.

Do not use it for workflows where old transcript wording must remain exact. For that, keep normal OpenClaw history or use a retrieval system that can quote the original source.