Skip to main content

What Is Loop Engineering?

info

This content was developed with AI assistance and is regularly reviewed for accuracy.

Snapshot: October 2026. Model names, prices, and product features change monthly; What's New in AI is the maintained chronology.

Loop engineering is the practice of designing the system that prompts an AI agent, on a schedule or in response to a trigger, instead of typing every prompt by hand. Your job stops being "write a good brief" and becomes "design a process that finds the work, briefs the agent, checks the result, and decides what to do next." This guide explains where the idea came from, how it relates to the skills you already have, which product features implement it in 2026, and when a loop is the wrong tool.

Learning focus​

By the end of this guide, you'll understand:

  • What loop engineering is and why it emerged in 2026
  • How it relates to prompt engineering and context engineering
  • Which first-party primitives implement a loop today
  • When a loop is the right tool, and when it is not

The shift: from holding the tool to building the loop​

For roughly two years, working with an AI coding agent looked like this: you wrote a careful prompt, read what came back, then wrote the next prompt. The agent was a tool, and you were holding it the entire time, one turn after another.

By mid-2026, agents could run multi-step work on their own for long stretches. So the valuable skill moved up a level. Instead of being the person who prompts the agent, you design the system that prompts it for you: something that finds the next task, hands it to the agent, checks whether the result is acceptable, writes down what happened, and then decides the next move.

Several 2026 vendor and consultancy blogs credit Addy Osmani with popularising the term by June 2026, building on observations from Peter Steinberger and from Anthropic's Boris Cherny, who leads Claude Code. Cherny's summary, as widely quoted in those posts:

"I don't prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops."

The attribution is secondary and the term has no formal definition yet, but the sentence captures the whole idea. The agent is no longer something you hold turn by turn. It is a process you start and supervise.

Prompt, context, loop​

Loop engineering did not replace the earlier skills; it wraps them. Think of three layers that build on each other:

LayerThe question it answersExample
Prompt engineeringWhat do I ask?A brief: "Write a function that validates email addresses, with tests."
Context engineeringWhat does the model need to know?Giving it the codebase, the style guide, the failing test output, and the right connectors.
Loop engineeringWho decides what to ask, when, and whether the answer is good enough?A system that pulls the next ticket, briefs the agent, runs the tests, and retries or escalates.

A loop still contains briefs, and it still needs good context. The new part is the control system around them: the scheduling, the evaluation, and the decision about what happens next. Practitioners call that control system, together with the prompts, tools, and agents it coordinates, a harness.

What a loop actually does​

Strip away the jargon and every loop runs the same five-beat cycle:

  1. Find the work. Pull the next task from a queue, an inbox, a schedule, or a trigger.
  2. Do the work. Brief the agent with the task and the right context.
  3. Check the work. Run tests, score against a rubric, or verify against a goal.
  4. Record what happened. Log the result so the next iteration (and you) can see it.
  5. Decide what's next. Stop, retry, escalate to a human, or pick up the next task.

The next guide, Anatomy of an Agent Loop, breaks these beats into the concrete components you will build.

The first-party names in 2026​

You do not need a framework to build a loop. The pieces now ship inside the tools, and knowing their names lets you read the docs. In Claude Code, /loop re-runs a prompt on an interval for the life of a session, and /goal sets a completion condition that a separate check evaluates after every turn until it is met or judged impossible. Routines run a prompt in the cloud on a schedule, an API call, or a GitHub event, using the connectors you already have. Stop hooks let you insert your own check before a session is allowed to end, and budget flags cap what a run may spend. Codex Automations and the scheduled tasks in the Claude and ChatGPT apps are the same idea in other products (reported). Every one of those features is a loop component with a product name; the skill is choosing and combining them.

When a loop is the right tool​

Loops shine when work is repetitive, verifiable, and should not require you to sit there:

  • A queue of small, well-defined coding tasks that each have tests
  • Monitoring something on a schedule and producing a digest
  • Triaging incoming items (tickets, emails, alerts) against clear rules
  • Any "do this every night or every hour" job you would otherwise do by hand

When a loop is the wrong tool​

Be honest about this. Most of the failures people hit come from looping work that should not be looped:

  • One-off tasks. If you will do it once, brief the agent directly. Building a loop is overhead.
  • Work with no way to check the result. If you cannot verify success automatically, or with a quick human glance, the loop cannot tell good output from bad and will confidently repeat mistakes.
  • High-stakes, irreversible actions. Sending money, deleting data, emailing customers: keep a human in the loop before these happen.
  • Fuzzy goals. If you cannot describe "done", the loop cannot decide when to stop.

A good rule of thumb: if you cannot write the stop condition and the success check, you are not ready to write the loop yet. Often the right answer is a plain workflow or a single scheduled prompt, and When a Workflow Beats a Loop is the recipe for making that call.

Key takeaways​

  • Loop engineering means designing the system that prompts the agent, not prompting it yourself.
  • It wraps prompt and context engineering inside an autonomous process, and the whole assembly is called a harness.
  • Every loop follows the same cycle: find work, do it, check it, record it, decide what's next.
  • In 2026 the components have product names: /loop, /goal, Routines, Stop hooks, budget flags.
  • Loops fit repetitive, verifiable, unattended work; they are a poor fit for one-offs, unverifiable output, and irreversible actions.

Next steps​

Continue to: Anatomy of an Agent Loop to learn the six components every reliable loop needs.