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

caveopen

v1.0.2

Published

Caveman, Cavekit v4, and Cavemem for OpenCode

Readme

caveopen

OpenCode Made with Cowork npm version CI NPM License

caveopen is an OpenCode plugin that brings the caveman ecosystem to OpenCode users. It ports three Claude Code tools — caveman, cavekit, and cavemem — into a single TypeScript plugin that integrates natively with OpenCode's hook system.

[!NOTE] This is an unofficial community port. For the original Claude Code versions, see the upstream repositories linked above.

Install

npx caveopen init

The CLI patches your opencode.json, copies skills, commands, and agents into the right locations, and registers the plugin.

✓ registered   caveopen → opencode.json
✓ configured   cavemem MCP → opencode.json
✓ added        13 skills
✓ added        12 commands
✓ added        3 agents

Options

npx caveopen init --project          # install to .opencode/ instead of ~/.config/opencode/
npx caveopen init --modes caveman    # install specific modules only
npx caveopen init --dry-run          # preview without writing anything

Modules

caveman — token-compressed output

A port of caveman that injects the caveman compression ruleset directly into OpenCode's system prompt on every session. The model drops filler phrases, articles, pleasantries, and hedging while preserving all technical content, code blocks, and exact error messages — no per-session setup required.

~75% fewer output tokens. Full technical accuracy.

Without caveman

"Sure! I'd be happy to help you with that. The issue you're experiencing is most likely caused by your authentication middleware not properly validating the token expiry. Let me take a look and suggest a fix."

With caveman

"Bug in auth middleware. Token expiry check use < not <=. Fix:"

Caveman mode persists across turns and supports multiple compression levels (lite, full, ultra). Token savings accumulate in ~/.caveman/.caveman-history.jsonl and are viewable with /caveman-stats.

cavekit — spec-driven development

A port of cavekit v4 that adds spec-driven development (SDD) to OpenCode. The /ck:init command bootstraps a project by copying FORMAT.md — the canonical encoding reference that /ck:spec, /ck:build, and /ck:check all read from. All three skills are included and work the same as the upstream Claude Code versions.

Skills read SPEC.md directly from disk on demand. No ambient spec context is injected into the system prompt — that approach caused the model to hallucinate connections between open tasks and unrelated prompts.

cavemem — persistent session memory

A port of cavemem that bridges its SQLite memory store into OpenCode's plugin lifecycle. On each new session, prior-session summaries for the same working directory are fetched and injected into the system prompt. Tool calls and turn output are observed and stored as the session progresses, building a memory that carries context forward across sessions. Each session's directory comes from the SDK session object — subagent sessions get their own directory correctly, not the plugin process cwd.

[!NOTE] Requires cavemem to be installed separately. The other two modules work without it. When cavemem is absent, this module silently no-ops.

The store lives at ~/.cavemem/memory.db.


Commands

caveman

| Command | Description | | ----------------------------------- | --------------------------------------------------------- | | /caveman [lite\|full\|ultra\|off] | Activate or change caveman mode (default: full) | | /caveman-stats | Lifetime token-savings stats for the current session | | /caveman-commit | Generate a caveman-compressed conventional commit message | | /caveman-review | Ultra-compressed code review — one line per finding | | /caveman-compress <file> | Compress a CLAUDE.md or memory file in-place | | /caveman-help | Quick-reference for all caveman commands |

cavekit

| Command | Description | | -------------------------------------------------- | --------------------------------------------------- | | /ck:init | Copy FORMAT.md to project root (or global config) | | /ck:spec [idea\|from-code\|amend §X.n\|bug: ...] | Create or amend SPEC.md | | /ck:build [§T.n\|--next\|--all] | Implement spec tasks with a validation loop | | /ck:check [§V\|§I\|§T\|--all] | Drift-detect SPEC.md vs. code (read-only) | | /ck:audit [--trim] | Full codebase audit against spec | | /ck:eval [§T.n\|--diff] | Evaluate spec coverage and quality |

cavecrew agents

Three compressed-output subagents available inside OpenCode sessions:

| Agent | Role | | ----------------------- | --------------------------------------------------------------------- | | cavecrew-investigator | Read-only code locator — returns file:line table for symbol lookups | | cavecrew-builder | Surgical 1–2 file edit — typos, single-function rewrites, renames | | cavecrew-reviewer | Diff reviewer — one-line findings, severity-tagged, no scope creep |


Configuration

Opt into specific modules

{
  "plugin": [["caveopen", { "modes": ["caveman", "cavekit"] }]]
}

modes accepts an array of caveman, cavekit, and cavemem. Default is all three. The CLI flag --modes caveman,cavekit accepts a comma-separated string and converts it to array form automatically.

Override agent models

{
  "agents": {
    "cavecrew-builder": { "model": "anthropic/claude-haiku-4-20250514" }
  }
}

Default caveman mode

Caveman defaults to full on every new session. Change the level at any time with /caveman <level>, or deactivate with /caveman off.


How it works

Each module registers TypeScript hooks into OpenCode's plugin lifecycle. The three modules compose cleanly — same-key handlers chain (a → b), output mutations accumulate:

CaveOpenPlugin
  ├── caveman  → experimental.chat.system.transform, chat.message, command.execute.before, event
  ├── cavekit  → command.execute.before, config
  └── cavemem  → experimental.chat.system.transform, chat.message, tool.execute.after, event

System prompt injections land in system[0]/system[1] — the slots that OpenCode's applyCaching() always marks for prompt caching on Anthropic models. The caveman ruleset and cavemem context are loaded once per session and served from cache on every subsequent turn.


Use modules separately

Each module is available via a subpath import. Use this when you want only one module, or to compose them manually into your own plugin:

import { CavemanPlugin } from "caveopen/caveman";
import { CavekitPlugin } from "caveopen/cavekit";
import { CavememPlugin } from "caveopen/cavemem";

// hook factories for manual composition
import { cavemanHooks } from "caveopen/caveman";
import { cavekitHooks } from "caveopen/cavekit";
import { caveMemHooks } from "caveopen/cavemem";

Related