Back to writing

AI "loops" are not cron jobs

2026·07·132 min

Gergely Orosz recently asked on twitter what "loop engineering" was

Gergely Orosz asking what loop engineering means and requesting examples

"AI Loop" is a new buzz word and nobody seems to know what it means. The person that popularized the term also hasn't elaborated on it. I generally find buzzwords distasteful but AI "loops" do seem to describe something that there wasn't a good word for before.

So given that, I was annoyed when the responses were all describing "cron jobs" and event triggered workflows. We already have words for those, we don't need "loop" to describe them.

Loops are prompts that tell the LLM to repeat some process until it reaches some condition, just like a for loop.

Here are some examples:

Continually profile and implement optimizations in this repo. Only accept optimizations that result in >3% improvement. Once youve had 3 failing attempts in a row stop.

Watch ci until it completes, fix it if it fails.

The classic loop is the "Ralph Loop".

Read PLAN.md, complete then mark off every task with a checkbox. Stop when all tasks are marked as completed.

If you want to get fancy, you can make loops have multiple stages

Watch ci until it completes, fix it if it fails. Once ci is green, merge, pull and checkout main.

So here is the definition: A loop is a prompt that sets the agent off to do some task repeatedly with a well defined end condition.

Loops can be triggered by events or cron jobs but loops are not agents that are triggered by events or cron jobs.