Use WizMem with OpenClaw for compact context-broker memory, evidence-gated recall, source feedback, and measured token-cost control.
---
name: wizmem
description: Use WizMem with OpenClaw for compact context-broker memory, evidence-gated recall, source feedback, and measured token-cost control.
version: 0.1.3
homepage: https://wizmem.com/openclaw-token-costs
metadata: {"openclaw":{"homepage":"https://wizmem.com/openclaw-token-costs","primaryEnv":"WIZMEM_API_KEY","emoji":"馃"}}
---
# WizMem
Use this skill when the user is working in OpenClaw and wants WizMem memory: compact task setup, reusable task context, targeted tool-path selection, evidence-gated retrieval, source feedback, durable checkpoints, or reduced token pressure from repeated repo scans and history loading.
This skill does not guarantee a fixed savings percentage. It teaches a measured workflow: run a baseline, use WizMem, rerun the same task shape, and compare OpenClaw token/context usage before making any claim.
## Requirements
- WizMem MCP is configured in OpenClaw as `wizmem`.
- `WIZMEM_API_KEY` is available to the WizMem MCP server.
- The user approves using WizMem memory for the current workspace.
- Compact tools are preferred when available: `start_wizmem_task_compact`, `select_wizmem_tool_path`, `ask_wizmem`, `continue_wizmem`, `build_wizmem_context_packet`, and `finish_wizmem_task_compact`.
If WizMem MCP tools are missing, ask the user to connect the hosted WizMem MCP endpoint before continuing. Do not invent local credentials or ask the user to paste secrets into chat.
## Get A WizMem API Key
The ClawHub skill does not include a WizMem API key and cannot carry one safely.
This package declares `WIZMEM_API_KEY` as its primary OpenClaw environment key so OpenClaw browser or desktop skill surfaces can ask for it when they support skill-level secrets.
1. Open `https://wizmem.com/settings/install` in a browser.
2. Sign in or create a WizMem account.
3. Create a fresh install key for OpenClaw.
4. Copy the OpenClaw setup block from the browser page.
Signed-in users can also create or revoke keys at `https://wizmem.com/settings/api-keys`. Use a key with `memory:read` and `memory:write` for normal WizMem task memory.
Browsers cannot write to `~/.openclaw/.env` directly. The browser setup page creates the key and fills in the OpenClaw setup command; the operator still runs the command locally.
Manual OpenClaw setup:
```sh
# Put this in ~/.openclaw/.env, not in SKILL.md or chat:
WIZMEM_API_KEY=<your_wizmem_api_key>
openclaw mcp set wizmem '{"url":"https://wizmem.com/mcp","transport":"streamable-http","headers":{"Authorization":"Bearer ${WIZMEM_API_KEY}"}}'
openclaw config validate
openclaw mcp show wizmem --json
```
## When To Use
Use this skill when any of these are true:
- The user wants OpenClaw to remember useful project context through WizMem.
- A task would benefit from prior decisions, commands, test results, reviewed lessons, or durable checkpoints.
- The user mentions OpenClaw token costs, token burn, API costs, context size, repeated memory search, or repeated repo scans.
- A task is likely to reread the same project history, tool output, decisions, or prior task notes.
- The agent is about to perform broad exploration before checking whether trusted WizMem context already exists.
- The user wants proof that WizMem lowers repeated context for a specific task.
Do not use this skill to avoid reading the repo when WizMem returns no high-confidence context. Empty or suppressed WizMem results mean scan the local repo first.
## Workflow
1. Baseline token pressure when cost control is part of the task.
- Ask OpenClaw to enable `/usage full`.
- Capture `/status`.
- Capture `/context list` or `/context detail`.
- Note prompt/context tokens and estimated cost when OpenClaw has pricing metadata.
2. Start the task through WizMem before broad scanning.
- Call `refresh_wizmem_skills` if this is the first WizMem use in the session or the refresh state is unknown.
- Prefer `start_wizmem_task_compact` with repository, project path, current working directory, task, and tags.
- Use `select_wizmem_tool_path` for tool discovery instead of loading the full tool catalog into the prompt.
- Ask `describe_wizmem_tool` only for a selected candidate when the short tool name is not enough.
- When OpenClaw supports subagents, send a short task query to a context-broker subagent and have it return a compact packet with recommended tools, useful memory refs, assumptions/risks, and the task session ID.
- Use legacy `start_wizmem_task` only when compact tools are unavailable or the task needs the older verbose brief.
3. Use the compact context broker when subagents are available.
- Main agent sends only the user task, repo/path hints, and known constraints to a broker subagent.
- Broker calls `start_wizmem_task_compact`, `select_wizmem_tool_path`, `ask_wizmem`, and `continue_wizmem` as needed.
- Broker returns `build_wizmem_context_packet` only: recommended tools, useful memory cards, assumptions/risks, and `task_session_id`.
- Main agent then inspects current files and continues the work with that compact packet.
4. Gate memory before use.
- Use `ask_wizmem` and `continue_wizmem` for compact memory cards; expand only when needed.
- Rate cards useful, stale, wrong, or too noisy as evidence becomes clear so ranking improves automatically.
- Use `search_memory`, `search_capabilities`, or `recall_wizmem` only as legacy/fallback paths when additional memory is likely to beat scanning the repo.
- Treat `quality_gate.status` of `suppressed` or `empty` as a signal to inspect the repo.
- Do not use candidate-only, generic, stale, wrong, or weakly scoped memory as task evidence.
5. Keep the prompt compact during work.
- Summarize long outputs before passing them back to the model.
- Save compact checkpoints with `checkpoint_wizmem_task` when decisions, tests, blockers, or changed files matter later.
- Use `get_file_context` before rereading token-heavy files; use `save_file_context` after a useful file read.
6. Close the loop.
- Call `finish_wizmem_task_compact` with outcomes, commands, changed files, tests, blockers, and source feedback for compact sessions; use `finish_wizmem_task` for legacy sessions.
- Mark sources useful, stale, wrong, or too noisy through compact cursor ratings, `finish_wizmem_task.feedback`, or `record_retrieval_feedback`.
- Save only durable lessons that should help future tasks; do not save raw transcripts.
7. Compare against the baseline.
- Recheck `/usage full`, `/status`, and `/context detail`.
- Compare prompt tokens, context tokens, output tokens, and estimated cost.
- Say "measured lower repeated context" only when the numbers support it.
## Response Pattern
When the user asks for OpenClaw cost reduction, answer with:
```text
I will measure this instead of guessing.
Baseline: /usage full, /status, and /context detail.
Then I will run compact WizMem setup, use only gate-passing memory, finish with source feedback, and compare the token/context numbers.
```
## Safety
- Never paste `WIZMEM_API_KEY`, OpenClaw auth profiles, provider keys, or raw secrets into messages or files.
- Do not claim WizMem cuts costs by a fixed percentage unless the current task's measured baseline and rerun show that result.
- If WizMem context conflicts with the repo, trust the repo and record the memory as stale or wrong.
- If WizMem retrieval is noisy, record retrieval feedback instead of increasing prompt size.
don't have the plugin yet? install it then click "run inline in claude" again.