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

recursive-claw

v0.2.0

Published

RLM-native ContextEngine plugin for OpenClaw — zero information loss, massive cost reduction

Readme


Conversation history doesn't belong in the context window. recursive-claw keeps it external in SQLite and gives the model tools to query what it needs, when it needs it. No compaction. No summarization. Nothing is ever lost.

Based on MIT's Recursive Language Models paradigm.

Why

| | Legacy / lossless-claw | recursive-claw | |---|---|---| | History in context | Summaries + tail (grows with conversation) | Tail only (constant) | | Information loss | Compaction discards detail at every depth | Zero. Ever. | | Token cost per turn | Scales with history length | Flat (~2K tokens) | | 50K-token history | ~50K tokens per turn | ~2K + sub-query on demand | | Cross-session | Lost or degraded | Fully queryable |

Install

openclaw plugins install recursive-claw

That's it. Zero config needed. SQLite auto-created, Haiku sub-queries, $0.10/turn budget cap.

How it works

Every message is stored in SQLite with FTS5 full-text search. assemble() returns only the system prompt, a fresh tail (last 20 messages), and a context manifest. The model queries history on demand.

┌──────────────────────────────────────┐
│         OpenClaw Agent Turn          │
│                                      │
│   System prompt                      │
│   + Fresh tail (last 20 messages)    │
│   + Manifest: "847 messages stored"  │
│   + 6 retrieval tools                │
│                                      │
│   History stays in SQLite ──────────►│──── rc_grep("auth decision")
│   Model queries on demand            │◄─── "JWT with RS256, 15-min access tokens"
└──────────────────────────────────────┘

Tools

| Tool | What it does | |------|-------------| | rc_peek | View messages at a position in history | | rc_grep | Full-text search or regex across all stored messages | | rc_slice | Extract a contiguous range by message index | | rc_query | Ask a question — dispatches to cheap sub-agent for focused answer | | rc_timeline | Structural overview: time periods, message counts, index ranges | | rc_repl | Run JavaScript in a sandboxed REPL with all retrieval functions |

rc_query is where the cost savings live. It greps for relevant messages, feeds them to a cheap model (Haiku at $1/$5 per 1M tokens), and returns a focused answer. The main model never sees the raw history.

Configuration

Works with zero config. Customize when you need to:

| Option | Default | Description | |--------|---------|-------------| | mode | "tools" | "tools" or "repl" | | freshTailCount | 20 | Messages kept in context window | | databasePath | auto | SQLite database path | | subQuery.defaultProvider | "anthropic" | anthropic, openai, google, openrouter | | subQuery.defaultModel | "claude-haiku-4-5" | Model for retrieval sub-queries | | subQuery.maxBudgetPerQuery | 0.05 | USD cap per sub-query | | subQuery.maxBudgetPerTurn | 0.10 | USD cap per turn |

Environment variables (RC_MODE, RC_PROVIDER, RC_MODEL, RC_BUDGET_PER_TURN, etc.) override config for quick testing.

Status & Roadmap

What's tested and working:

  • Tools mode (rc_peek, rc_grep, rc_slice, rc_query, rc_timeline, rc_repl) — verified E2E against OpenClaw 2026.3.13
  • Anthropic provider (Haiku) for sub-queries — live tested
  • SQLite storage with FTS5 — cross-session persistence verified
  • 147 automated tests (unit, integration, E2E with planted-fact retrieval)

What's configured but not yet live-tested:

  • OpenAI, Google, and OpenRouter providers — routing logic tested with mocks, not yet verified with real API calls
  • REPL mode code block interception — currently works via rc_repl tool call, native repl block execution planned

Coming next:

  • Block-level storage — group messages into conversational blocks for better retrieval context
  • Workspace context externalization — move SOUL.md, AGENTS.md, and other workspace files out of the system prompt and into queryable storage
  • Formal benchmarks — token usage, cost, retrieval accuracy, and latency comparisons against legacy and lossless-claw
  • Research paper formalizing the results

Contributions and feedback welcome — open an issue.

Based on

recursive-claw implements the paradigm from Recursive Language Models (Zhang, Kraska, Khattab — MIT CSAIL, 2025). Context stays external. The model programs its way to what it needs.

License

MIT