About agent-self-recovery
A recovery procedure for agents that are repeating attempts or losing sight of a task goal. It records the current state, identifies the stuck pattern, and directs the agent to try a different approach, seek help, or hand off the task.
Key features
- 01Detects repeated attempts and lost goals
- 02Records attempts and state in a file
- 03Classifies common stuck patterns
- 04Selects recovery steps by problem type
- 05Escalates blocked tasks for assistance
Use cases
- 01Repeated fixes produce the same result
- 02Each attempted fix reveals another dependency
- 03Debugging when the error is unclear
- 04Refocusing an agent that lost the original request
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ archieindian/ openclaw-superpowers --skill agent-self-recoveryAfter installing, type/agent-self-recoveryin Claude Code to confirm it loaded.
Bundled filesSTATE_SCHEMA.yaml
Details
From the project READMEAgent 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_trying: what were you trying to do?what_tried: append this latest approach to the listloop_type: name the pattern (see Step 3)attempts: increment by 1status: recoveringstarted_at: current timestamp (first time only)
Step 3: Name the Loop
Pick the loop_type:
same-fix-variations— trying the same fix with minor changescascading-dependencies— each fix reveals a new dependencyunclear-error— unclear what the actual error islost-goal— lost track of original requirement
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.