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

@moritakaaz/opencode-apc

v1.2.2

Published

Opencode plugin for aggressive automatic context pruning - triggers compression at 15k tokens to save costs

Downloads

761

Readme

@moritakaaz/opencode-apc

An opencode plugin that wraps @tarquinen/opencode-dcp with aggressive auto-compression defaults. Triggers context pruning at 7k tokens to maximize token savings.

Installation

opencode plugin @moritakaaz/opencode-apc@latest --global

What it does

This plugin automatically manages your conversation context by:

  • Compressing stale conversation content into high-fidelity summaries
  • Triggering compression early (7k tokens) to save costs
  • Deduplicating repeated tool calls
  • Pruning errored tool inputs after 2 turns
  • Nudging the model to compress every 3 turns with strong force

On first run, it creates dcp.jsonc config files (global and project-level) with aggressive defaults. Existing configs are never overwritten unless they were generated by APC (detected via _apcVersion field) and have an outdated version — in that case, they are automatically upgraded.

Configuration

The plugin writes .opencode/dcp.jsonc with these defaults:

| Setting | Value | Purpose | |---------|-------|---------| | maxContextLimit | 7000 | Triggers compression early | | minContextLimit | 3500 | Floor for compression target | | nudgeFrequency | 3 | Nudge every 3 turns | | nudgeForce | "strong" | Assertive nudging | | deduplication | enabled | Remove duplicate tool calls | | purgeErrors | turns: 2 | Prune errored inputs after 2 turns |

To customize, edit .opencode/dcp.jsonc in your project — the plugin won't overwrite it.

Git and .opencode/ directory

The plugin creates a .opencode/dcp.jsonc file in your project. This file is safe to commit — it only contains DCP configuration and helps keep settings consistent across machines or collaborators.

The plugin also generates a .opencode/.gitignore that excludes runtime files (node_modules/, package.json, etc.), so only dcp.jsonc ends up tracked by git.

TL;DR: You can git add .opencode/ without worry. Only the config file will be committed.

Requirements

  • opencode with plugin support (@opencode-ai/plugin >=1.4.3)
  • Node.js with ESM support

Development

npm install
npm run build    # tsc -> dist/
npm test         # node:test unit tests

Error Handling

The plugin is designed to be resilient:

  • If config files can't be written (permission denied, disk full), a warning is logged but the plugin continues
  • If an existing config is malformed or missing required fields, a warning is logged but it's never overwritten (schema-only configs created by DCP are silently accepted)
  • If @tarquinen/opencode-dcp fails to load, the plugin returns empty hooks so opencode doesn't crash

CI

GitHub Actions runs build + tests on Node 20 and 22 for every push/PR to master.

License

ISC