Skip to main content
A loop is like a compact engine: a set of cooperating parts that let a system improve itself autonomously. At the foundation of every effective loop are two essentials — a clear goal and a scorekeeper — which everything else builds on. This lesson gives a concise tour of the six components that make loops reliable and scalable. Each component will be explored in detail in later lessons.
Every loop must start with a clear goal and a scorekeeper. Those two items form the base that everything else builds on.
The six components strengthen the loop, make it safer, and allow it to run without constant human supervision. Part one — Automation Automation is the engine that repeats the work: try, test, fix, save — again and again — until the goal is met. Automation can be a CI/CD pipeline, a scheduled job, or an agent that performs deterministic steps. Without automation, you only have a single manual attempt — not a loop. Typical automation features include idempotent tasks, retries, and deterministic inputs to ensure reproducibility. Part two — Worktrees A worktree is a safe, isolated copy of the repository used for experiments. It lets the loop try changes without risking the main branch or disrupting ongoing development. If an attempt fails, the worktree can be discarded and the primary codebase remains intact. In Git, git worktree creates an additional working directory sharing repository metadata while keeping working files separate — ideal for sandboxed changes and parallel attempts.
The image illustrates the concept of worktrees, showing "Main Code (Origin)" for the main codebase and "Worktree (Sandbox)" for a separate copy.
Part three — Skills Skills are reusable units of know-how the loop can load on demand. Think of a skill as a compact instruction card or callable module that captures the “what to do,” the rules or steps to follow, and when to apply them. Skills keep behavior consistent across iterations and prevent the automation from becoming a monolithic, hard-to-manage blob. Well-designed skills are small, testable, and composable.
The image illustrates a concept of skill development, featuring a "Skill Card" with steps like "What to do," "Rules/Steps," and "When to use," connected to a loop of "Try," "Test," and "Fix."
Part four — Connectors and plugins Connectors are adapters the loop uses to interact with external systems (for example: GitHub, Slack, issue trackers, or cloud storage). A plugin is a packaged bundle that can include multiple connectors, skills, and helper tools. Together they give the loop “hands” to act beyond its local files and interact with external services in a controlled, auditable way. Part five — Subagents Subagents are focused helpers the main loop delegates small, targeted tasks to — for example, searching a large codebase, running a specific test suite, or validating a change. Each subagent returns concise results so the main loop can keep its state compact and decisions traceable. Subagents reduce complexity by isolating responsibilities and enabling parallel workstreams.
The image illustrates the interaction between a "Main Loop" and a "Sub-Agent," showing a request/task flow for searching a codebase, followed by a short answer response.
Part six — Memory Memory is the persistent state the loop keeps across sessions: the goal, the last score, recent attempts, and next steps. Memory allows the loop to pause and resume without starting over, enabling multi-step improvements over time. A compact, well-indexed memory makes it easier to reason about progress, audit decisions, and recover from errors. Quick reference table Recap
  • Automations repeat the work reliably.
  • Worktrees provide safe, disposable sandboxes.
  • Skills supply compact, reusable knowledge.
  • Connectors and plugins enable controlled external interactions.
  • Subagents handle narrow, independent responsibilities.
  • Memory preserves state across sessions for continuity.
A later lesson will examine each component in depth and show patterns for designing and composing them to build robust, auditable loop-engineering systems. Further reading and references

Watch Video