wal-memory_skill

This skill helps you preserve OpenClaw session state across crashes with a two-file WAL, enabling cold boot recovery and context retention.
  • Python

2.5k

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

3 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill wal-memory

  • _meta.json275 B
  • SKILL.md3.9 KB

Overview

This skill provides a two-file WAL (Write-Ahead Log) memory system for OpenClaw agents to survive session rollovers, gateway disconnects, provider outages, and context compaction. It installs a lightweight logger, a GOALS.md structure, and a cold-boot recovery hook so the agent can resume with intent and recent actions. The goal is to eliminate agent amnesia between sessions and give reliable, human-readable recovery checkpoints.

How this skill works

A small logger script appends timestamped entries to STATE.log for every meaningful action. GOALS.md captures the current mission, sprint tasks, and architecture decisions and is read on every cold boot. On startup the agent reads GOALS.md, tails the last 20 lines of STATE.log, and resumes from the most recent entries. STATE.log auto-rotates at 5MB and should be kept out of source control.

When to use it

  • When an OpenClaw agent must persist intent and recent actions across session crashes or gateway disconnects
  • When provider outages or context compaction risk losing action-level detail
  • When you need a simple, auditable trail of what the agent did without relying on provider context windows
  • When setting up heartbeat safety to detect precise crash timestamps
  • When you want a human-editable mission file (GOALS.md) to guide recovery logic

Best practices

  • Log only meaningful state changes (ACTION, DEPLOY, AGENT, TASK, FIX, STARTUP, HEARTBEAT, ERROR)
  • Do not log sensitive data (passwords, API keys, tokens) — STATE.log is plaintext
  • Keep GOALS.md short (under ~30 lines) and update it at milestones or session ends
  • Include a HEARTBEAT entry at the start of each heartbeat to mark safe flush points
  • Add STATE.log to .gitignore and rotate or archive logs off-host if storing long term

Example use cases

  • Agent restarts after a gateway disconnect: cold-boot hook reads GOALS.md and last 20 log lines to resume work
  • Context compaction by the provider: GOALS.md preserves intent while STATE.log supplies recent action history
  • Post-outage forensic: reconstruct recent activities and decisions for debugging or audits
  • Continuous deployment tracking: log DEPLOY entries to correlate agent actions with production changes
  • Scheduled maintenance windows: HEARTBEAT entries show exactly when the agent went offline

FAQ

Copy scripts/state-log.js to ~/clawd/scripts/state-log.js and test by invoking it to create STATE.log in ~/clawd/.

How do I perform a cold boot recovery?

On startup read memory/GOALS.md, then run tail -n 20 ~/clawd/STATE.log to see recent actions, and resume from the last log entry.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
wal-memory skill by openclaw/skills | VeilStrat