Skip to content
Skillpedia
Agents280k · #141

autonomous-loops

Helps your agent create complex, autonomous workflows. It lets the agent perform tasks in steps, independently, to achieve a goal.

What it does

This tool helps create automated workflows so that AI can perform programming tasks repeatedly without your intervention at each step. It offers different ways to organize these tasks, from simple sequences to more complex systems with multiple agents.

When to use it

  • ✓Automating repetitive code development tasks.
  • ✓Organizing a programming project into smaller, sequential steps.
  • ✓Building continuous development pipelines, similar to CI/CD.

Example of what to ask your AI

“Create a workflow to implement a new feature, test it, and then clean up the code.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/affaan-m/ECC/blob/main/skills/autonomous-loops/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/affaan-m/ECC/blob/main/skills/autonomous-loops/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You define a series of commands or steps for the AI to follow in order. Each step can be a specific task, like writing code, testing, or reviewing, and the AI executes them one after another.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add affaan-m/ECC --skill autonomous-loops

Or download just the file:

curl -L https://raw.githubusercontent.com/affaan-m/ECC/main/skills/autonomous-loops/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Autonomous Loops Skill

Compatibility note (v1.8.0): autonomous-loops is retained for one release. The canonical skill name is now continuous-agent-loop. New loop guidance should be authored there, while this skill remains available to avoid breaking 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:

#!/bin/bash
# daily-dev.sh — Sequential pipeline for a feature branch

set -e

# Step 1: Implement the feature
claude -p "Read the spec in docs/auth-spec.md. Implement OAuth2 login in src/auth/. Write tests first (TDD). Do NOT create any new documentation files."

# Step 2: De-sloppify (cleanup pass)
claude -p "Review all files changed by the previous commit. Remove any unnecessary type tests, overly defensive checks, or testing of language features (e.g., testing that TypeScript generics work). Keep real business logic tests. Run the test suite after cleanup."

# Step 3: Verify
claude -p "Run the full build, lint, type check, and test suite. Fix any failures. Do not add new features."

# Step 4: Commit
claude -p "Create a conventional commit for all staged changes. Use 'feat: add OAuth2 login flow' as the message."

Key Design Principles

  1. Each step is isolated — A fresh context window per claude -p call means no context bleed between steps.
  2. Order matters — Steps execute sequentially. Each builds on the filesystem state left by the previous.
  3. Negative instructions are dangerous — Don't say "don't test type systems." Instead, add a separate cleanup step (see De-Sloppify Pattern).
  4. Exit codes propagate — set -e stops the pipeline on failure.

Variations

With model routing:

# Research with Opus (deep reasoning)
claude -p --model opus "Analyze the codebase architecture and write a plan for adding caching..."

# Implement with Sonnet (fast, capable)
claude -p "Implement the caching layer according to the plan in docs/caching-plan.md..."

# Review with Opus (thorough)
claude -p --model opus "Review all changes for security issues, race conditions, and edge cases..."

With environment context:

# Pass context via files, not prompt length
echo "Focus areas: auth module, API rate limiting" > .claude-context.md
claude -p "Read .claude-context.md for priorities. Work through them in order."
rm .claude-context.md

With --allowedTools restrictions:

# Read-only analysis pass
claude -p --allowedTools "Read,Grep,Glob" "Audit this codebase for security vulnerabilities..."

# Write-only implementation pass
claude -p --allowedTools "Read,Write,Edit,Bash" "Implement the fixes from security-audit.md..."

…
FAQ

What's the difference between the loop types?

Loops vary in complexity. A 'Sequential Pipeline' is a simple list of tasks. An 'Infinite Agentic Loop' uses multiple agents working together in parallel, following a more elaborate plan.

Can I use different AI models for each step?

Yes, you can configure it to use different models (like Opus or Sonnet) depending on the complexity or type of task in each step of your workflow.

What happens if a step fails?

If a step fails and the system is set up correctly (using `set -e`), the entire task sequence will stop, preventing subsequent steps from running with errors.

Details

Original description by the author

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.

repo: affaan-m/ECC

Popularity

GitHub stars
280k
Ranking position
#141
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills