Openclaw-superpowers agent-self-recovery
Detects when the agent is stuck in a loop and escapes systematically. Use when you notice repeated failures or loss of direction.
install
source · Clone the upstream repo
git clone https://github.com/ArchieIndian/openclaw-superpowers
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ArchieIndian/openclaw-superpowers "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/openclaw-native/agent-self-recovery" ~/.claude/skills/archieindian-openclaw-superpowers-agent-self-recovery && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ArchieIndian/openclaw-superpowers "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/openclaw-native/agent-self-recovery" ~/.openclaw/skills/archieindian-openclaw-superpowers-agent-self-recovery && rm -rf "$T"
manifest:
skills/openclaw-native/agent-self-recovery/SKILL.mdsource content
Agent Self-Recovery
State file:
~/.openclaw/skill-state/agent-self-recovery/state.yaml
Signs You're Stuck
- Tried the same approach 3+ times with the same result
- Making changes that feel random rather than targeted
- Lost track of the original goal
- Taking longer than expected on a 'simple' step
Recovery Protocol
Step 1: Stop
Stop making changes. No more quick tries.
Step 2: Write State
Write to the state file:
: what were you trying to do?what_trying
: append this latest approach to the listwhat_tried
: name the pattern (see Step 3)loop_type
: increment by 1attemptsstatus: recovering
: current timestamp (first time only)started_at
Step 3: Name the Loop
Pick the
loop_type:
— trying the same fix with minor changessame-fix-variations
— each fix reveals a new dependencycascading-dependencies
— unclear what the actual error isunclear-error
— lost track of original requirementlost-goal
Step 4: Break the Loop
If
loop_type: unclear-error → use systematic-debugging first.
If loop_type: lost-goal → re-read the original requirement.
If genuinely blocked → document clearly, ask the user. Update state status: escalated.
If context too large → use context-window-management.
If truly lost → use task-handoff, ask user to redirect. Update state status: escalated.
Step 5: Resume with a New Approach
Choose a genuinely different approach. Update state
last_approach, append to what_tried.
On success: update state status: recovered.