Setup & Installation
Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:
What This Skill Does
A Node-based helper for OpenClaw agents that reduces context token usage via delta compression and caching. Before each model call, agents query packed context; after replying, they ingest the turn to build persistent memory across sessions.
Combining delta compression, caching, and cross-session memory in a single script lets agents cut token spend without restructuring their prompting logic.
When to use it
- Cutting LLM API costs on long-running agent workflows
- Persisting user preferences and past decisions across sessions
- Retrieving only relevant prior context for a specific query
- Tracking token savings and API spend with cost analytics
- Pre-warming cache for predictable high-traffic agent queries
Example Workflow
Here's how your AI assistant might use this skill in practice.
User asks: What did we decide about the retriever cache in our last session?
- 1Run query_context with the user's question and session ID to retrieve compressed prior context
- 2Inject the returned context into the model prompt instead of the full conversation history
- 3Call the model and receive a response
- 4Run ingest_session with the user and assistant messages to persist the turn to long-term memory
Agent answers using compressed prior context; the turn is stored and available for future sessions
Requirements
Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.