License: MIT δΈζ AI Agent Hermes
Design autonomous agent feedback cycles instead of hand-prompting each step.
Inspired by Rahul's "Loops: What Every AI Engineer Needs to Know in 2026" β and the core insight from Peter Steinberger (OpenClaw) and Boris Cherny (Claude Code): stop prompting your agents. Start designing loops.
| Feature | Description |
|---|---|
| 5-Stage Framework | DISCOVER β PLAN β EXECUTE β VERIFY β ITERATE |
| 6 Components | Automations, Worktrees, Skills, Plugins, Subagents, Memory |
| Single-Agent Loop | One agent runs the full cycle on focused tasks |
| Fleet Loop | Orchestrator + specialists + subagents for complex goals |
| Closed Loop | Self-verifying cycle with stop conditions β pays off today |
| Project Context | VISION.md / ARCHITECTURE.md / RULES.md per project |
| Skill Compounding | Knowledge accumulates across loop runs |
| 5 Agent Killers | Diagnose loop failures: Context Collapse, No Self-Correction, No Verifier, No Guardrails, No Memory |
| Tiered Routing | Route tasks by complexity β cheap model for grunt work, expensive model for verification |
| Worker + Verifier | Independent context separation β verifier must never share worker's history |
| Memory as Rules | Extract general rules from failures instead of raw logs |
βββββββββββββββββββββββββββββββββββ
β LOOP CONTROLLER β
β (orchestrator / cron trigger) β
ββββββββββββ¬βββββββββββββββββββββββ
β
ββββββββββββΌβββββββββββ
β GOAL + CONTEXT β
β (what done means) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ
β 1. DISCOVER + PLAN β
β (decompose, route) β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ
β 2. WORKER (ctx A) β
β execute -> produce β
ββββββββββββ¬βββββββββββ
β output
ββββββββββββΌβββββββββββ
β 3. VERIFIER (ctx B) β
β independent check β
β no shared history β
ββββββββββββ¬βββββββββββ
β
ββββββββββββΌβββββββββββ
β 4. GATE β
β pass? fail? β
ββββββββ¬βββββββ¬ββββββββ
β β
PASS FAIL
β β
ββββββββΌβ ββββΌβββββββββββββββ
β DONE β β 5. DIAGNOSE β
βββββββββ β root cause β
β extract rule β
β new approach β
ββββ¬ββββββββββββββββ
β back to EXECUTE
βββββββββββββββββββ
Critical rule: Worker and Verifier must be independent API calls. A verifier that inherits the worker's context inherits its blind spots.
- Hermes Agent (or any LLM agent framework)
- Git (for worktrees)
- A test suite in your project (pytest, npm test, go test)
load loop-engineering
# Create project context docs touch VISION.md ARCHITECTURE.md RULES.md # Set up parallel worktrees bash scripts/setup-worktrees.sh /path/to/project experiments hotfix # Run a dev loop bash scripts/dev-loop.sh /path/to/project 5
cronjob action=create \ name=my-project-dev-loop \ workdir=/path/to/project \ schedule="0 3 * * *" \ prompt="Follow the 5-stage loop..."
bash scripts/skill-compounder.sh my-project /path/to/project \ "Lesson Title" "What we learned this run"
loop-engineering-skill/
βββ SKILL.md # Hermes skill definition
βββ README.md # English documentation
βββ README.zh-TW.md # Traditional Chinese
βββ LICENSE # MIT license
βββ scripts/
βββ dev-loop.sh # Write β test β fix β verify
βββ setup-worktrees.sh # Git worktrees for parallel agents
βββ skill-compounder.sh # Post-loop knowledge accumulation
Old way (prompting): You β Prompt β Agent β Output β You review β Fix β Repeat
New way (looping): You set goal β Loop runs β Agent discovers β Plans β Executes β Verifies β Iterates β Done
Prompt engineers ask AI for output. Loop engineers design systems that produce verified outcomes.
Most people blame the model when a loop fails. The real problem is loop design.
| # | Killer | Symptom | Fix |
|---|---|---|---|
| 1 | Context Collapse | Step 12 forgets what Step 1 wanted | Decompose into sub-loops with clean scope |
| 2 | No Self-Correction | Hits error β retries same approach β hits again | Add diagnostic step β never retry blindly |
| 3 | No Verifier | "Finished" β correct, no independent check | Worker and verifier in separate contexts |
| 4 | No Guardrails | Agent can delete files, spend money freely | Define action boundaries in RULES.md |
| 5 | No Memory | Every run starts from zero, repeats mistakes | Extract general rules from failures, not logs |
Don't use your best model for every task. Route by complexity:
| Task Type | Model Tier |
|---|---|
| Architecture decisions, hard bugs, multi-file reasoning, final verification | Best (Fable 5, Opus) |
| Medium reasoning, code generation, review | Mid (Sonnet 4, DeepSeek V4 Flash) |
| Data extraction, reformatting, boilerplate, simple edits | Cheap (Haiku, MiniMax) |
Most loop iterations are cheap β verification is where you spend.
- Single-agent medium task: 50K-200K tokens
- Fleet loop + 3 specialists: 500K-2M tokens
- Scheduled daily loop: millions of tokens per week
Use cheap frontier models (DeepSeek V4 Flash, Kimi, MiniMax) for loops. Reserve expensive models for critical verification passes.
- project-context/camera-market β C2C photography marketplace with full loop setup
- project-context/polymarket-bot β Live trading bot with nightly dev loop cron
- engineering/codex β Codex CLI delegation for coding tasks
MIT β see LICENSE.