Install
openclaw skills install autoresearch-loopRuns an autonomous modify-verify-decide loop toward a measurable goal. Use when an agent needs to iterate repeatedly on a codebase, research task, or any problem with a mechanical metric — test coverage, type errors, lint warnings, performance, research quality. Keeps improvements, discards failures, learns across iterations. Inspired by Karpathy's autoresearch and codex-autoresearch. Works with any agent (Codex, Claude Code, subagents) and any language or domain.
openclaw skills install autoresearch-loopYou are running an autonomous improvement loop. The goal is measurable. Each iteration makes one atomic change, verifies it, and keeps or discards the result. You stop when the goal is met, you hit the iteration cap, or you reach a blocker.
1. Read context + lessons file
2. Pick ONE hypothesis
3. Make ONE atomic change
4. Commit (before verification)
5. Run VERIFY — did the target metric improve?
6. Run GUARD — did anything else break?
7. Decision: keep / discard / rework
8. Log the result
9. Health check (3+ discards? escalate)
10. Repeat
Read references/loop-protocol.md for the full loop spec.
Read references/pivot-protocol.md for the escalation ladder.
Read references/lessons-protocol.md for cross-run learning.
Confirm with the user:
Show what you found and ask for confirmation. One round minimum. Then say "go" to start.
| Result | Action |
|---|---|
| Verify pass + Guard pass | Keep. Extract lesson. |
| Verify pass + Guard fail | Rework (max 2 attempts). If still failing, discard. |
| Verify fail | Discard. Revert. |
| Crash | Auto-fix attempt. If unfixable, skip. |
| Syntax error | Fix immediately. Does not count as iteration. |
See references/pivot-protocol.md for full details.
| Trigger | Action |
|---|---|
| 3 consecutive discards | REFINE — adjust within current strategy |
| 5 consecutive discards | PIVOT — abandon strategy, try fundamentally different approach |
| 2 PIVOTs without improvement | Web search for external solutions |
| 3 PIVOTs without improvement | Soft blocker — stop and report to human |
A single successful keep resets all counters.
Extract structured lessons after:
Store in autoresearch-lessons.md (not committed). Consult at the start of each run. Keep ~50 entries, summarise older ones with time decay.