Skip to content
Back to search

autonomous-agent-loops

SkillWorks with Claude CodeGitHub

"Autonomous agent loop patterns: sequential pipelines, persistent REPL sessions, parallel spec-driven generation, PR automation, cleanup passes, and RFC-driven DAG orchestration. Choose pattern by complexity: simple (sequential) → medium (PR loop, infinite agents) → advanced (DAG with merge queue). Trigger phrases: 'autonomous loop', 'agent loop', 'parallel agents', 'multi-pass refinement', 'continuous integration loop'."

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/djc00p--autonomous-agent-loops/badge.svg)](/listings/djc00p--autonomous-agent-loops)

HTML

<a href="/listings/djc00p--autonomous-agent-loops"><img src="/api/listings/djc00p--autonomous-agent-loops/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

**Choose your pattern by complexity:**

1. **Sequential Pipeline** (simple) — chain `claude -p` calls for linear workflows 2. **Persistent REPL** (simple) — interactive sessions with history 3. **Spec-Driven Parallel** (medium) — deploy N agents from spec, manage waves 4. **PR Automation Loop** (medium) — PR creation, CI fix, auto-merge 5. **De-Sloppify Pass** (add-on) — cleanup step after any implementation 6. **RFC-Driven DAG** (advanced) — multi-unit parallel work with dependency graph

---

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 100 lines
  1. ---
  2. name: autonomous-agent-loops
  3. description: "Autonomous agent loop patterns: sequential pipelines, persistent REPL sessions, parallel spec-driven generation, PR automation, cleanup passes, and RFC-driven DAG orchestration. Choose pattern by complexity: simple (sequential) → medium (PR loop, infinite agents) → advanced (DAG with merge queue). Trigger phrases: 'autonomous loop', 'agent loop', 'parallel agents', 'multi-pass refinement', 'continuous integration loop'."
  4. metadata: {"clawdbot":{"emoji":"\ud83d\udd04","requires":{"bins":["gh","git","node"],"env":["CLAW_SESSION","CLAW_SKILLS"]},"os":["linux","darwin","win32"],"version":"1.0.2"}}
  5. ---
  6. # Autonomous Loops — Patterns for Agent Automation
  7. > ## ⚠️ Security & Consent — READ FIRST
  8. >
  9. > **This skill teaches unattended repository automation.** It can create branches, open pull requests, retry CI failures, and merge code without a human in the loop. That power is dangerous in the wrong hands and on the wrong target.
  10. >
  11. > **Before using any pattern in this skill, you MUST:**
  12. >
  13. > 1. **Get explicit, informed consent from the repository owner.** "I want to automate PRs" is not consent for "merge my production code at 3 AM without review."
  14. > 2. **Default to dry-run.** All patterns below start in `--disable-commits` / no-write mode. Only flip the switch when you understand what each flag does.
  15. > 3. **Use protected branches + least-privileged credentials.** The GitHub token this loop uses must not have admin/org-owner scopes. A scoped fine-grained PAT scoped to one repo is the minimum.
  16. > 4. **Set hard limits.** Every loop must have `--max-runs`, `--max-cost`, and `--max-duration`. Without these, a runaway loop will burn budget or destroy state.
  17. > 5. **Never loop on production.** Run on a fork, a scratch repo, or a clearly-labeled branch. The main branch should be merged by a human.
  18. > 6. **Audit your inputs.** Specs, directory listings, and captured diffs may contain secrets, customer data, internal paths, or proprietary code. Never pipe those into an external agent command without scrubbing them first.
  19. >
  20. > **Patterns in this skill that touch the network, filesystem, or git remotes will refuse to run unless the corresponding safety flags are explicitly set.** If a pattern silently merges or pushes, that is a bug — file an issue.
  21. >
  22. > See `references/security-checklist.md` for the full audit before first use.
  23. ---
  24. Running agents in loops enables spec-driven development, CI/CD-style pipelines, and iterative refinement without human intervention between steps. **Used correctly**, this is a productivity multiplier. **Used carelessly**, it can drain a bank account, leak secrets, or rewrite a production codebase.
  25. ## Quick Start
  26. **Choose your pattern by complexity:**
  27. 1. **Sequential Pipeline** (simple) — Chain `claude -p` calls for linear workflows
  28. 2. **Persistent REPL** (simple) — Interactive sessions with history
  29. 3. **Spec-Driven Parallel** (medium) — Deploy N agents from spec, manage waves
  30. 4. **PR Automation Loop** (medium) — PR creation, CI fix, auto-merge
  31. 5. **De-Sloppify Pass** (add-on) — Cleanup step after any implementation
  32. 6. **RFC-Driven DAG** (advanced) — Multi-unit parallel work with dependency graph
  33. ## Pattern Spectrum
  34. | Pattern | Setup | Complexity | Default Mode | Best For |
  35. |---------|-------|-----------|--------------|----------|
  36. | Sequential Pipeline | Bash script | Low | Dry-run | Daily tasks, scripted workflows |
  37. | REPL | Node/CLI | Low | Read-only | Interactive development |
  38. | Parallel Agents | Agent loop | Medium | Dry-run | Content generation, spec variations |
  39. | PR Loop | Shell script | Medium | `--disable-commits` | Iterative multi-day projects |
  40. | De-Sloppify | Add-on to any | Optional | Dry-run | Quality cleanup after implementation |
  41. | DAG Orchestration | Python/Node | High | Dry-run | Large features, parallel units, merge coordination |
  42. ## References
  43. - `references/security-checklist.md` — **Read before any first use**
  44. - `references/sequential-pipeline.md` — Basic `claude -p` loops with examples
  45. - `references/persistent-repl.md` — Session persistence + secrets-handling rules
  46. - `references/parallel-agents.md` — Spec-driven deployment with worktree isolation
  47. - `references/pr-automation.md` — Continuous PR loop with consent gates and CI gates
  48. - `references/de-sloppify.md` — Quality cleanup pattern
  49. - `references/dag-orchestration.md` — RFC-driven multi-unit coordination + merge-conflict recovery
  50. ## Key Principles
  51. 1. **Isolation** — Each loop iteration gets fresh context (no bleed-through)
  52. 2. **Context Persistence** — Use files (SHARED_TASK_NOTES.md) to bridge iterations
  53. 3. **Exit Conditions** — Always set max-runs, max-cost, max-duration, or completion signal
  54. 4. **No Blind Retries** — Capture error context for next iteration (and redact secrets first)
  55. 5. **Separate Concerns** — Different loop patterns for different problem sizes
  56. 6. **Default Deny** — Network writes, git pushes, and merges require explicit opt-in flags
  57. ## Decision Matrix
  58. ```text
  59. Is this a single focused change?
  60. ├─ Yes → Sequential Pipeline
  61. └─ No → Do you have a spec/RFC?
  62. ├─ Yes → Do you need parallel work?
  63. │ ├─ Yes → DAG Orchestration
  64. │ └─ No → PR Automation Loop
  65. └─ No → Do you need many variations?
  66. ├─ Yes → Parallel Agents + Spec
  67. └─ No → Sequential Pipeline + De-Sloppify
  68. ```
  69. ## Anti-Patterns
  70. ❌ Infinite loops without exit conditions
  71. ❌ No context bridge between iterations
  72. ❌ Retrying the same failure without capturing error context
  73. ❌ Negative instructions instead of cleanup passes
  74. ❌ All agents in one context window (reviewer should never be the author)
  75. ❌ Ignoring file overlap in parallel work
  76. ❌ Auto-merge without explicit human approval on every merge
  77. ❌ Skipping the security checklist before first use
  78. ---
  79. **Adapted from everything-claude-code by @affaan-m (MIT)**
README.md · README · 146 lines
  1. # 🔄 Autonomous Agent Loops
  2. [![ClawHub Skill](https://img.shields.io/badge/ClawHub-Skill-blue)](https://clawhub.ai/djc00p/skills/autonomous-agent-loops) [![Agent Skill](https://img.shields.io/badge/Agent-Skill-blue)](#) [![Automation](https://img.shields.io/badge/Automation-D54309.svg)](https://en.wikipedia.org/wiki/Automation) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  3. **Autonomous Agent Loops** is a catalog of patterns for running agents in loops — enabling spec-driven development, CI/CD-style pipelines, and iterative refinement without a human in the loop between steps.
  4. **Used correctly, this is a productivity multiplier. Used carelessly, it can drain a bank account, leak secrets, or rewrite a production codebase.**
  5. ---
  6. ## ⚠️ Security & Consent — Read First
  7. This skill teaches unattended repository automation. It can create branches, open pull requests, retry CI failures, and merge code without a human in the loop. That power is dangerous in the wrong hands and on the wrong target.
  8. **Before using any pattern in this skill, you MUST:**
  9. 1. **Get explicit, informed consent from the repository owner.** *"I want to automate PRs"* is not consent for *"merge my production code at 3 AM without review."*
  10. 2. **Default to dry-run.** All patterns below start in `--disable-commits` / no-write mode. Only flip the switch when you understand what each flag does.
  11. 3. **Use protected branches + least-privileged credentials.** The GitHub token this loop uses must not have admin/org-owner scopes. A scoped fine-grained PAT for one repo is the minimum.
  12. 4. **Set hard limits.** Every loop must have `--max-runs`, `--max-cost`, and `--max-duration`. Without these, a runaway loop will burn budget or destroy state.
  13. 5. **Never loop on production.** Run on a fork, a scratch repo, or a clearly-labeled branch. The main branch should be merged by a human.
  14. 6. **Audit your inputs.** Specs, directory listings, and captured diffs may contain secrets, customer data, internal paths, or proprietary code. Never pipe those into an external agent command without scrubbing them first.
  15. > **Patterns in this skill that touch the network, filesystem, or git remotes will refuse to run unless the corresponding safety flags are explicitly set.** If a pattern silently merges or pushes, that is a bug — file an issue.
  16. Full audit before first use: `references/security-checklist.md`
  17. ---
  18. ## 🚀 Quick Start
  19. **Choose your pattern by complexity:**
  20. 1. **Sequential Pipeline** (simple) — chain `claude -p` calls for linear workflows
  21. 2. **Persistent REPL** (simple) — interactive sessions with history
  22. 3. **Spec-Driven Parallel** (medium) — deploy N agents from spec, manage waves
  23. 4. **PR Automation Loop** (medium) — PR creation, CI fix, auto-merge
  24. 5. **De-Sloppify Pass** (add-on) — cleanup step after any implementation
  25. 6. **RFC-Driven DAG** (advanced) — multi-unit parallel work with dependency graph
  26. ---
  27. ## 📊 Pattern Spectrum
  28. | Pattern | Setup | Complexity | Default Mode | Best For |
  29. |---|---|---|---|---|
  30. | Sequential Pipeline | Bash script | Low | Dry-run | Daily tasks, scripted workflows |
  31. | REPL | Node/CLI | Low | Read-only | Interactive development |
  32. | Parallel Agents | Agent loop | Medium | Dry-run | Content generation, spec variations |
  33. | PR Loop | Shell script | Medium | `--disable-commits` | Iterative multi-day projects |
  34. | De-Sloppify | Add-on to any | Optional | Dry-run | Quality cleanup after implementation |
  35. | DAG Orchestration | Python/Node | High | Dry-run | Large features, parallel units, merge coordination |
  36. ---
  37. ## 🧭 Decision Matrix
  38. ```text
  39. Is this a single focused change?
  40. ├─ Yes → Sequential Pipeline
  41. └─ No → Do you have a spec/RFC?
  42. ├─ Yes → Do you need parallel work?
  43. │ ├─ Yes → DAG Orchestration
  44. │ └─ No → PR Automation Loop
  45. └─ No → Do you need many variations?
  46. ├─ Yes → Parallel Agents + Spec
  47. └─ No → Sequential Pipeline + De-Sloppify
  48. ```
  49. ---
  50. ## 📐 Key Principles
  51. 1. **Isolation** — each loop iteration gets fresh context, no bleed-through
  52. 2. **Context Persistence** — use files (`SHARED_TASK_NOTES.md`) to bridge iterations
  53. 3. **Exit Conditions** — always set max-runs, max-cost, max-duration, or a completion signal
  54. 4. **No Blind Retries** — capture error context for the next iteration, and redact secrets first
  55. 5. **Separate Concerns** — different loop patterns for different problem sizes
  56. 6. **Default Deny** — network writes, git pushes, and merges require explicit opt-in flags
  57. ---
  58. ## 🚫 Anti-Patterns
  59. | Anti-pattern | Why it hurts |
  60. |---|---|
  61. | Infinite loops without exit conditions | Runaway budget and state destruction |
  62. | No context bridge between iterations | Each iteration re-derives what the last one learned |
  63. | Retrying the same failure without capturing error context | Same loop, same failure, same cost |
  64. | Negative instructions instead of cleanup passes | The model needs something to fix, not something to avoid |
  65. | All agents in one context window | The reviewer should never be the author |
  66. | Ignoring file overlap in parallel work | Concurrent agents write the same file |
  67. | Auto-merge without explicit human approval on every merge | Unreviewed code reaches the main branch |
  68. | Skipping the security checklist before first use | The most dangerous pattern is the one nobody audited |
  69. ---
  70. ## 📚 References
  71. * `references/security-checklist.md` — **read before any first use**
  72. * `references/sequential-pipeline.md` — basic `claude -p` loops with examples
  73. * `references/persistent-repl.md` — session persistence and secrets-handling rules
  74. * `references/parallel-agents.md` — spec-driven deployment with worktree isolation
  75. * `references/pr-automation.md` — continuous PR loop with consent gates and CI gates
  76. * `references/de-sloppify.md` — quality cleanup pattern
  77. * `references/dag-orchestration.md` — RFC-driven multi-unit coordination and merge-conflict recovery
  78. ---
  79. ## 📦 Install
  80. ```bash
  81. clawhub install autonomous-agent-loops
  82. ```
  83. Or clone this repo and add the skill folder to your agent's skills path.
  84. ### Repository layout
  85. ```
  86. SKILL.md # entry point, pattern spectrum, decision matrix
  87. references/
  88. security-checklist.md # pre-flight audit — read first
  89. sequential-pipeline.md # basic claude -p loops
  90. persistent-repl.md # session persistence + secrets handling
  91. parallel-agents.md # spec-driven deployment, worktree isolation
  92. pr-automation.md # PR loop with consent and CI gates
  93. de-sloppify.md # quality cleanup pattern
  94. dag-orchestration.md # RFC-driven coordination + conflict recovery
  95. LICENSE # MIT-0 / MIT
  96. README.md # this file
  97. ```
  98. ### Versions
  99. Releases track the published ClawHub versions.
  100. | Version | ClawHub |
  101. | --- | --- |
  102. | 1.0.2 | [autonomous-agent-loops v1.0.2](https://clawhub.ai/djc00p/skills/autonomous-agent-loops) |
  103. ---
  104. **Adapted from [everything-claude-code](https://github.com/affanm/everything-claude-code) by [@affaan-m](https://github.com/affaan-m) (MIT).**
  105. **Published by [@djc00p](https://github.com/djc00p)**

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.