Install
openclaw skills install agent-resilienceAgent resilience patterns for surviving context loss, capturing critical details, and self-improvement. Use when: starting complex/long sessions, asked to 'r...
openclaw skills install agent-resiliencePatterns for surviving context loss, capturing corrections, and continuously improving.
The Law: Chat history is a buffer, not storage. Files survive; context doesn't.
Trigger — scan every message for:
If any appear:
memory/SESSION-STATE.mdThe urge to respond is the enemy. Write before replying.
Active working memory for the current task. Create at memory/SESSION-STATE.md:
# Session State
**Task:** [what we're working on]
**Key decisions:** [decisions made]
**Details:** [corrections, names, values captured via WAL]
**Next step:** [what happens next]
Reset when starting a new unrelated task.
When context reaches ~60%, start logging every exchange to memory/working-buffer.md:
# Working Buffer
**Status:** ACTIVE — started [timestamp]
## [time] Human
[their message]
## [time] Agent
[1-2 sentence summary + key details]
Clear the buffer at the START of the next 60% threshold (not continuously).
Auto-trigger when session starts with a summary tag, or human says "where were we?":
memory/working-buffer.md — raw danger-zone exchangesmemory/SESSION-STATE.md — active task stateNever ask "what were we discussing?" — read the buffer first.
Before saying "done", "complete", "finished":
Text changes ≠ behavior changes. When changing how something works, identify the architectural component and change the actual mechanism.
Try 10 approaches before asking for help or saying "can't":
"Can't" = exhausted all options. Not "first try failed."
When updating behavior/config based on a lesson:
Score the change first (skip if < 50 weighted points):
Ask: "Does this let future-me solve more problems with less cost?" If no, skip it.
Forbidden: complexity for its own sake, changes you can't verify worked, vague justifications.
For long/complex tasks:
memory/SESSION-STATE.md with task + context