agent-wal
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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/bowen31337/agent-walAgent 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 <entry_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/<agent_id>.wal.jsonl
Buffer files: ~/clawd/memory/wal/<agent_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}
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-bowen31337-agent-wal": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
Terse
Skill by bowen31337
Identity Resolver
Skill by bowen31337
agent-self-governance
Self-governance protocol for autonomous agents: WAL (Write-Ahead Log), VBR (Verify Before Reporting), ADL (Anti-Divergence Limit), VFM (Value-For-Money), and IKL (Infrastructure Knowledge Logging). 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, (6) before claiming a task is done — verify it, (7) periodic self-check — am I drifting from my persona? (8) cost tracking — was that expensive operation worth it? (9) discovering infrastructure — log hardware/service specs immediately.
rsi-loop
Recursive Self-Improvement (RSI) loop for EvoClaw agents. Provides a structured observe→analyze→synthesize→deploy pipeline that enables agents to detect their own failure patterns and generate concrete improvement proposals (new skills, routing fixes, SOUL.md updates, memory improvements). Use when: (1) logging a task outcome (success/fail/quality), (2) running periodic self-improvement analysis, (3) reviewing or deploying improvement proposals, (4) integrating RSI into EvoClaw hub/edge agents via MQTT, (5) checking agent health score, (6) any mention of "self-improvement", "recursive improvement", "fix my own mistakes", "improvement loop", or "agent evolution". Core EvoClaw primitive.
clawchain
ClawChain RPC client for EvoClaw agents. Connects to Substrate-based blockchain, queries on-chain agent data, submits transactions, and enables agents to participate in on-chain governance and reputation tracking. Use when working with ClawChain L1 blockchain, agent DIDs, token economics, or agent reputation systems.