Skills whisper-context
Official Whisper Context skill for OpenClaw. Cuts context tokens via delta compression + caching, and adds long-term memory across sessions.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/alinxus/usewhisper" ~/.claude/skills/clawdbot-skills-whisper-context && rm -rf "$T"
manifest:
skills/alinxus/usewhisper/SKILL.mdsource content
Whisper Context (OpenClaw Skill)
Reduce OpenClaw API spend by shrinking the context you send to the model (delta compression + caching), while keeping long-term memory across sessions.
This skill provides a minimal Node-based helper (
whisper-context.mjs) that OpenClaw agents can run to:
- Retrieve packed context for a user/session (
) withquery_context
andcompress: truecompression_strategy: "delta" - Persist the latest turn into long-term memory (
)ingest_session - Write/search memories (
,memory_write
)memory_search - Run Oracle search/research (
)oracle_search - Fetch cost analytics (
)get_cost_summary - Inspect/warm cache (
,cache_stats
)cache_warm
Install (ClawHub)
npx clawhub@latest install whisper-context
ClawHub installs the skill folder into your OpenClaw skills workspace (typically
~/.openclaw/workspace/skills/).
Setup
Set environment variables (where OpenClaw reads env for your agent):
WHISPER_CONTEXT_API_URL=https://context.usewhisper.dev WHISPER_CONTEXT_API_KEY=YOUR_KEY WHISPER_CONTEXT_PROJECT=openclaw-cost-optimization
Notes:
is optional (defaults toWHISPER_CONTEXT_API_URL
).https://context.usewhisper.dev
can be a project slug/name.WHISPER_CONTEXT_PROJECT- If the project does not exist yet, the helper will auto-create it in your org on first use.
- For best memory behavior, use stable
anduser_id
values (don’t hardcode them globally; derive them per user/session in your agent).session_id
Usage
All commands print JSON to stdout.
Global flags
: override--project <slugOrName>WHISPER_CONTEXT_PROJECT
: override--api_url <url>WHISPER_CONTEXT_API_URL
: request timeout (default: 30000)--timeout_ms <n>
Tips for real agents (to actually slash spend)
- Always call
first and inject the returnedquery_context
instead of re-sending your entire chat history.context - Keep
,compress: true
, andcompression_strategy: "delta"
(the defaults in this helper) to maximize token savings.use_cache: true - Use stable
anduser_id
so memory works across sessions and cache keys stay effective.session_id
Query packed context
node whisper-context.mjs query_context \ --query "What did we decide about the retriever cache?" \ --user_id "user-123" \ --session_id "session-123"
Ingest a completed turn
node whisper-context.mjs ingest_session \ --user_id "user-123" \ --session_id "session-123" \ --user "..." \ --assistant "..."
If your message text is large or hard to shell-escape, pass JSON via stdin:
echo '{ "user": "....", "assistant": "...." }' | node whisper-context.mjs ingest_session --session_id "session-123" --turn_json -
Security / Privacy Notes
sends both user and assistant text to the Context API (so it can build memory and improve retrieval).ingest_session- The helper only reads local files if you explicitly pass
(or stdin via@path
).- - Treat your
like a secret; don’t commit it to git.WHISPER_CONTEXT_API_KEY
Write a memory
node whisper-context.mjs memory_write \ --memory_type "preference" \ --content "User prefers concise answers." \ --user_id "user-123"
Search memories
node whisper-context.mjs memory_search \ --query "preferences" \ --user_id "user-123"
Oracle search / research
node whisper-context.mjs oracle_search --query "How does delta compression work?" --mode search node whisper-context.mjs oracle_search --query "Design a plan..." --mode research --max_steps 3
Cost summary
node whisper-context.mjs get_cost_summary \ --start_date "2026-01-01T00:00:00.000Z" \ --end_date "2026-02-01T00:00:00.000Z"
Cache stats (prove your savings)
node whisper-context.mjs cache_stats
Cache warm (optional)
node whisper-context.mjs cache_warm --queries "retriever cache,l1 query cache,delta compression" --ttl_seconds 3600
Agent Integration Pattern
- Before calling the model: run
and prepend the returnedquery_context
(if present) to your prompt.context - After replying: run
with the user + assistant messages to persist memory.ingest_session
Troubleshooting
: export the env var where OpenClaw runs commands.Missing WHISPER_CONTEXT_API_KEY
: verify your API key and that it has access to the project/org.HTTP 401/403
: verifyHTTP 404 Project not found
(slug/name) exists.WHISPER_CONTEXT_PROJECT