Write-Ahead Log protocol for agent state persistence. Prevents losing corrections, decisions, and context during conversation compaction. Use when: (1) receiving a user correction — log it before responding, (2) making an important decision or analysis — log it before continuing, (3) pre-compaction memory flush — flush the working buffer to WAL, (4) session start — replay unapplied WAL entries to restore lost context, (5) any time you want to ensure something survives compaction.
Write important state to disk before responding. Prevents the #1 agent failure mode: losing corrections and context during compaction.
Write before you respond. If something is worth remembering, WAL it first.
| Trigger | Action Type | Example |
|---|---|---|
| User corrects you | INLINECODE0 | "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 |
All commands via scripts/wal.py (relative to this skill directory):
CODEBLOCK0
replay to get unapplied entriesappend with action_type correction BEFORE respondingflush-buffer to persist any buffered entriesbuffer-add to batch writes. Buffer is flushed to WAL on flush-buffer (called during pre-compaction) or manually.
WAL files: ~/clawd/memory/wal/<agent_id>.wal.jsonl
Buffer files: INLINECODE13
Entries are append-only JSONL. Each entry:
CODEBLOCK1
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 agent-wal-1776419934 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 agent-wal-1776419934 技能
skillhub install agent-wal-1776419934
文件大小: 4.24 KB | 发布时间: 2026-4-17 19:15