Agent Wal
/install agent-wal
Agent WAL (Write-Ahead Log)
Write important state to disk before responding. Prevents the #1 agent failure mode: losing corrections and context during compaction.
Core Rule
Write before you respond. If something is worth remembering, WAL it first.
When to WAL
| Trigger | Action Type | Example |
|---|---|---|
| User corrects you | correction |
"No, use Podman not Docker" |
| You make a key decision | decision |
"Using CogVideoX-2B for text-to-video" |
| Important analysis/conclusion | analysis |
"WAL/VFM patterns should be core infra not skills" |
| State change | state_change |
"GPU server SSH key auth configured" |
| User says "remember this" | correction |
Whatever they said |
Commands
All commands via scripts/wal.py (relative to this skill directory):
# Write before responding
python3 scripts/wal.py append agent1 correction "Use Podman not Docker for all EvoClaw tooling"
python3 scripts/wal.py append agent1 decision "CogVideoX-5B with multi-GPU via accelerate"
python3 scripts/wal.py append agent1 analysis "Signed constraints prevent genome tampering"
# Working buffer (batch writes during conversation, flush before compaction)
python3 scripts/wal.py buffer-add agent1 decision "Some decision"
python3 scripts/wal.py flush-buffer agent1
# Session start: replay lost context
python3 scripts/wal.py replay agent1
# After applying a replayed entry
python3 scripts/wal.py mark-applied agent1 \x3Centry_id>
# Maintenance
python3 scripts/wal.py status agent1
python3 scripts/wal.py prune agent1 --keep 50
Integration Points
On Session Start
- Run
replayto get unapplied entries - Read the summary into your context
- Mark entries as applied after incorporating them
On User Correction
- Run
appendwith action_typecorrectionBEFORE responding - Then respond with the corrected behavior
On Pre-Compaction Flush
- Run
flush-bufferto persist any buffered entries - Then write to daily memory files as usual
During Conversation
For less critical items, use buffer-add to batch writes. Buffer is flushed to WAL on flush-buffer (called during pre-compaction) or manually.
Storage
WAL files: ~/clawd/memory/wal/\x3Cagent_id>.wal.jsonl
Buffer files: ~/clawd/memory/wal/\x3Cagent_id>.buffer.jsonl
Entries are append-only JSONL. Each entry:
{"id": "abc123", "timestamp": "ISO8601", "agent_id": "agent1", "action_type": "correction", "payload": "Use Podman not Docker", "applied": false}
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-wal - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-wal触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Agent Wal 是什么?
Write-Ahead Log protocol for agent state persistence. Prevents losing corrections, decisions, and context during conversation compaction. Use when: (1) recei... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1162 次。
如何安装 Agent Wal?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-wal」即可一键安装,无需额外配置。
Agent Wal 是免费的吗?
是的,Agent Wal 完全免费(开源免费),可自由下载、安装和使用。
Agent Wal 支持哪些平台?
Agent Wal 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Wal?
由 bowen31337(@bowen31337)开发并维护,当前版本 v1.0.1。