affaan-m/everything-claude-code/autonomous-loops
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Patterns and architectures for autonomous Claude Code loops — from simple sequential pipelines to RFC-driven multi-agent DAG systems. Retained for compatibility only: when new autonomous loop guidance is needed, use continuous-agent-loop instead.
Install
npx vskill@latest install affaan-m/everything-claude-code/autonomous-loopsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Autonomous Loops Skill
Compatibility note (v1.8.0):autonomous-loopsis retained for one release.The canonical skill name is nowcontinuous-agent-loop. New loop guidanceshould be authored there, while this skill remains available to avoidbreaking existing workflows.
Patterns, architectures, and reference implementations for running Claude Code autonomously in loops. Covers everything from simple claude -p pipelines to full RFC-driven multi-agent DAG orchestration.
When to Use
- Setting up autonomous development workflows that run without human intervention
- Choosing the right loop architecture for your problem (simple vs complex)
- Building CI/CD-style continuous development pipelines
- Running parallel agents with merge coordination
- Implementing context persistence across loop iterations
- Adding quality gates and cleanup passes to autonomous workflows
Loop Pattern Spectrum
From simplest to most sophisticated:
| Pattern | Complexity | Best For | |
|---|---|---|---|
| Sequential Pipeline | Low | Daily dev steps, scripted workflows | |
| NanoClaw REPL | Low | Interactive persistent sessions | |
| Infinite Agentic Loop | Medium | Parallel content generation, spec-driven work | |
| Continuous Claude PR Loop | Medium | Multi-day iterative projects with CI gates | |
| De-Sloppify Pattern | Add-on | Quality cleanup after any Implementer step | |
| Ralphinho / RFC-Driven DAG | High | Large features, multi-unit parallel work with merge queue |
1. Sequential Pipeline (claude -p)
The simplest loop. Break daily development into a sequence of non-interactive claude -p calls. Each call is a focused step with a clear prompt.
Core Insight
If you can't figure out a loop like this, it means you can't even drive the LLM to fix your code in interactive mode.
The claude -p flag runs Claude Code non-interactively with a prompt, exits when done. Chain calls to build a pipeline:
Key Design Principles
- Each step is isolated — A fresh context window per
claude -pcall means no context bleed between steps. - Order matters — Steps execute sequentially. Each builds on the filesystem state left by the previous.
- Negative instructions are dangerous — Don't say "don't test type systems." Instead, add a separate cleanup step (see De-Sloppify Pattern).
- Exit codes propagate —
set -estops the pipeline on failure.
Variations
With model routing:
With environment context:
With `--allowedTools` restrictions:
2. NanoClaw REPL
ECC's built-in persistent loop. A session-aware REPL that calls claude -p synchronously with full conversation history.
How It Works
- Loads conversation history from
~/.claude/claw/{session}.md - Each user message is sent to
claude -pwith full history as context - Responses are appended to the session file (Markdown-as-database)
- Sessions persist across restarts
When NanoClaw vs Sequential Pipeline
| Use Case | NanoClaw | Sequential Pipeline | |
|---|---|---|---|
| Interactive exploration | Yes | No | |
| Scripted automation | No | Yes | |
| Session persistence | Built-in | Manual | |
| Context accumulation | Grows per turn | Fresh each step | |
| CI/CD integration | Poor | Excellent |
See the /claw command documentation for full details.
3. Infinite Agentic Loop
A two-prompt system that orchestrates parallel sub-agents for specification-driven generation. Developed by disler (credit: @disler).
Architecture: Two-Prompt System
The Pattern
- Spec Analysis — Orchestrator reads a specification file (Markdown) defining what to generate
- Directory Recon — Scans existing output to find the highest iteration number
- Parallel Deployment — Launches N sub-agents, each with:
- The full spec
- A unique creative direction
- A specific iteration number (no conflicts)
- A snapshot of existing iterations (for uniqueness)
- Wave Management — For infinite mode, deploys waves of 3-5 agents until context is exhausted
Implementation via Claude Code Commands
Create .claude/commands/infinite.md:
Invoke:
Batching Strategy
| Count | Strategy | |
|---|---|---|
| 1-5 | All agents simultaneously | |
| 6-20 | Batches of 5 | |
| infinite | Waves of 3-5, progressive sophistication |
Key Insight: Uniqueness via Assignment
Don't rely on agents to self-differentiate. The orchestrator assigns each agent a specific creative direction and iteration number. This prevents duplicate concepts across parallel agents.
4. Continuous Claude PR Loop
A production-grade shell script that runs Claude Code in a continuous loop, creating PRs, waiting for CI, and merging automatically. Created by AnandChowdhary (credit: @AnandChowdhary).
Core Loop
Installation
Warning: Install continuous-claude from its repository after reviewing the code. Do not pipe external scripts directly to bash.
Usage
Cross-Iteration Context: SHARED_TASK_NOTES.md
The critical innovation: a SHARED_TASK_NOTES.md file persists across iterations:
Claude reads this file at iteration start and updates it at iteration end. This bridges the context gap between independent claude -p invocations.
CI Failure Recovery
When PR checks fail, Continuous Claude automatically:
- Fetches the failed run ID via
gh run list - Spawns a new
claude -pwith CI fix context - Claude inspects logs via
gh run view, fixes code, commits, pushes - Re-waits for checks (up to
--ci-retry-maxattempts)
Completion Signal
Claude can signal "I'm done" by outputting a magic phrase:
Three consecutive iterations signaling completion stops the loop, preventing wasted runs on finished work.
Key Configuration
| Flag | Purpose | |
|---|---|---|
--max-runs N | Stop after N successful iterations | |
--max-cost $X | Stop after spending $X | |
--max-duration 2h | Stop after time elapsed | |
--merge-strategy squash | squash, merge, or rebase | |
--worktree <name> | Parallel execution via git worktrees | |
--disable-commits | Dry-run mode (no git operations) | |
--review-prompt "..." | Add reviewer pass per iteration | |
--ci-retry-max N | Auto-fix CI failures (default: 1) |
5. The De-Sloppify Pattern
An add-on pattern for any loop. Add a dedicated cleanup/refactor step after each Implementer step.
The Problem
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/autonomous-loops/SKILL.md
Popularity
- Repository stars
- 109,581
- Repository forks
- 14,296
- Repository npm downloads, 7 days
- 1,792
- 7-day trend score
- 75
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 16 Mar 2026, 7 months ago.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/affaan-m/everything-claude-code/autonomous-loops)