Modern Creator
Matthew Berman · YouTube

Only the best are using them

How a new viral tweet revealed the next tier of AI engineering: designing loops that prompt your agents, so you never have to.

Posted
1 months ago
Duration
Format
Tutorial
educational
Views
33.8K
1.9K likes
Big Idea

The argument in one line.

The next tier of AI engineering is not writing better prompts to your coding agents -- it is designing loops that contain a trigger and a verifiable goal, and that prompt your agents autonomously until the goal is met.

Who This Is For

Read if. Skip if.

READ IF YOU ARE…
  • You use Claude Code, Cursor, or a similar AI coding tool daily and want to understand where agentic workflows are heading.
  • You are curious why viral tweets from OpenAI and Anthropic engineers talk about loops instead of prompts.
  • You want a conceptual map of agentic engineering before the technique becomes mainstream and widely documented.
SKIP IF…
  • You are not yet using AI coding agents at all -- the video assumes baseline familiarity with tools like Claude Code or Cursor.
  • You want a deep implementation tutorial; this is an orientation-level explainer, not a step-by-step build guide.
TL;DR

The full version, fast.

Loop engineering replaces the manual prompt-wait-prompt cycle with an autonomous system that has only two components: a trigger (an event, a schedule, or a human saying go) and a verifiable goal (tests pass, or an LLM judges completion). The host demos a Cursor automation that fires on every PR open, reviews and fixes the code, and commits back -- all without human involvement. The technique is real and already in use at OpenAI and Anthropic, but costs are steep (one engineer logged $1.3M in monthly token usage), and defining a precise, verifiable end state for open-ended features remains the hardest unsolved problem.

Free for members

Chat with this breakdown — free.

Sign in and you get 23 free chat messages on us — ask for the hook, quote a framework, find the exact transcript moment, generate a markdown action plan. Bring your own key when you want unlimited.

Create a free account →
Chapters

Where the time goes.

00:0000:55

01 · The viral meta shift

Peter Steinberger's 5M-view tweet and a viral Boris Cherny interview both land on the same phrase: design loops, not prompts.

00:5601:50

02 · What is a loop?

Loops replace the manual prompt-wait-prompt cycle. A loop needs only a trigger and a verifiable goal; the agent runs autonomously until that goal is met.

01:5002:45

03 · Deterministic vs. nondeterministic goals

Goals can be verified mechanically (tests pass) or by an LLM judge (feature complete). The RL parallel: verifiable reward is the core requirement.

02:4503:34

04 · Live demo: Cursor PR automation

A working Cursor automation triggers on every PR open, reviews code, fixes issues, commits back, ensures all tests and CI pass -- no human in the loop.

03:3405:46

05 · Three trigger types and complexity scale

Triggers are events, schedules (cron), or human kick-off. Loops can be enriched with skills and open-ended goals -- complexity scales accordingly.

05:4707:12

06 · Sponsor: here.now

Sponsored segment for here.now, an agent-native web publishing tool that lets AI agents deploy directly to the web.

07:1308:38

07 · Claude Code /loop command

Live demo of Claude Code's built-in /loop command: set an interval and a goal, the agent kicks off and iterates until the spec is met.

08:3810:57

08 · Two big criticisms

Hard to set up for open-ended goals (requires a complete upfront spec) and extremely expensive -- $1.3M/month for one engineer at a major AI lab.

10:5712:12

09 · Loops vs. automations

The critical distinction: an automation executes; a loop decides. A loop has an internal evaluation step that determines if the goal was reached.

12:1212:59

10 · The endpoint: AI designing its own factory

Today humans set the goal. The logical endpoint is AI with taste that sets its own direction -- triggering recursive self-improvement without human input.

Atomic Insights

Lines worth screenshotting.

  • Stop prompting your coding agents. Design the loops that prompt them.
  • A loop only needs two things: a trigger and a verifiable goal.
  • Deterministic goals (all tests pass, no errors) are far easier to loop against than amorphous goals like build this feature.
  • The three trigger types are: an event (PR opens), a schedule (cron), or a human saying go.
  • Claude Code has a built-in /loop command that runs any prompt on a recurring interval until a goal is met.
  • Loop engineering is currently limited to engineers with infinite or very large token budgets -- almost exclusively at OpenAI and Anthropic.
  • One engineer at a top AI lab logged $1,300,000 in monthly token usage -- that is the cost floor for loop engineering at scale today.
  • Token costs follow the same diffusion curve as every prior technology: what is expensive today will be cheap tomorrow.
  • The hardest part of loop engineering is not building the loop -- it is writing a complete, precise spec for the end state before the loop starts.
  • A loop differs from an automation in one way: the loop has a decision point inside it that determines whether the goal was reached.
  • Engineers are bifurcating into those designing loops and those still manually prompting agents.
  • The logical endpoint is an AI that sets its own goals, designs its own factory, and triggers recursive self-improvement without human direction.
Takeaway

What loop engineering actually means for how you build.

WHAT TO LEARN

The transition from manually prompting AI agents to designing loops that prompt them autonomously is already underway -- the constraint today is cost and the ability to write a complete, verifiable spec.

  • A loop only requires a trigger and a verifiable goal -- everything else is optional complexity layered on top of that two-part foundation.
  • Deterministic goals (tests pass, no errors) are dramatically easier to loop against than open-ended goals, which require you to define the complete end state upfront before the loop starts.
  • The three trigger types -- event, schedule, human kick-off -- are exhaustive; every loop you will ever design maps to one of them.
  • Claude Code's /loop command lets any agent-based workflow run continuously on an interval until a specified goal is met, without custom infrastructure.
  • The cost barrier is real and steep today, but follows the same historical diffusion curve as every prior computing technology -- loop engineering will become affordable.
  • The critical distinction between a loop and an automation is internal decision-making: a loop evaluates whether its goal was reached and decides to continue or stop; an automation just executes.
  • The future endpoint is AI that sets its own goals rather than executing yours -- designing the factory that designs the factory, leading toward recursive self-improvement.
Glossary

Terms worth knowing.

Loop engineering
The practice of designing an autonomous system with a trigger and a verifiable goal that repeatedly prompts a coding agent and evaluates its output until the goal is met, replacing the manual prompt-wait-respond cycle.
Trigger
The event that starts a loop. The three types are: an external action (such as a pull request opening), a scheduled time (cron job), or a human manually initiating it.
Deterministic goal
A loop completion condition that can be checked by a machine with no ambiguity -- for example, all tests passing or a function executing without errors.
Nondeterministic goal
A loop completion condition that requires a language model to judge whether the goal was reached, used when the end state is too abstract to verify mechanically.
Automation (vs. loop)
An automated sequence of prompts or code that executes without evaluating whether a goal was reached. A loop contains an internal decision step that determines completion; an automation does not.
Recursive self-improvement
A theoretical state in which an AI system can autonomously identify goals, design the processes to reach them, and improve its own capabilities without a human setting the direction.
Resources

Things they pointed at.

Quotables

Lines you could clip.

00:18
Here's your monthly reminder that you shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents.
Tight, viral-grade reframe with zero setup needed -- already proved it at 5M viewsTikTok hook↗ Tweet quote
08:59
Boy, is looping expensive.
Punchy one-liner that lands the cost caveat before most viewers expect itIG reel cold open↗ Tweet quote
10:05
Only the top one percent of 1% are using these techniques like loop engineering.
Strong aspirational/exclusivity hook for tech audiencesTikTok hook↗ Tweet quote
11:30
The difference between a loop and an automation is that a loop has some decision inside the loop.
Clean, self-contained definition that resolves a common confusionnewsletter pull-quote↗ Tweet quote
The Script

Word for word.

Read-along

Don't just watch it. Burn it in.

See every word as it's spoken — crank it to 2× and still catch all of it. The same dual-channel trick behind Amazon's Kindle + Audible.

A new coding meta just dropped. Over this past weekend, everybody started talking about loops.
The two main characters in the world of AI coding talked about it at the same time, Peter Steinberger and Boris Cherny. Here is an interview from Boris that went absolutely viral.
I don't prompt Quad anymore.
I have loops that are running. They're the ones that are prompting Quad and kinda figuring out what to do. My job is to write loops.
And here's Peter's tweet sitting at 5,000,000 views in less than twenty four hours. Here's your monthly reminder that you shouldn't be prompting coding agents anymore.
You should be designing loops that prompt your agents. So what is a loop? Why is suddenly everybody talking about it, and why are there only a handful of people in the entire world who know actually what it is and how to use it?
This is the future of software engineering, but most people won't be able to do it today. But if you wanna be at the absolute frontier of coding, I'm gonna show you how.
And if you like when I explain the latest in engineering strategy, like this video and subscribe. It very much does help.
Thank you in advance. And by the way, this video is sponsored by Here dot Now. More on them later.
Alright. So what is a loop? If you've ever done agentic engineering or vibe coding before, you know the workflow.
You prompt your agent. Your agent writes the code for you. You wait for it to be done, and then you prompt it again.
Loops are what change this. Rather than you telling your agent what to do, you are designing the loop, which really just means specifying some end state, a goal.
You're giving your agent a goal, and the agent will not only start itself, but will continue until that goal is met. And I know this sounds very theoretical, but stick with me. I'm going to show you actual loops.
So a loop really only needs two things. It needs some kind of trigger and some kind of goal.
The goal must be verifiable in some way. That verification can come in the form of test passing or for more abstract goals, you can have an LLM determine if it reached the goal or not. And if you're thinking this sounds a lot like reinforcement learning, exactly.
With reinforcement learning, you need some kind of verifiable reward, meaning the agent or the AI or the model, it knows when it successfully reached that goal. And just like RL, it can be done with deterministic goals.
So when all the tests pass or this function executes properly and there are no errors or nondeterministic goals.
When an agent or an AI decides, hey, I think the goal has been completed. Okay.
So we have the trigger and we have the goal. Let me show you what it actually looks like in practice. In Cursor, there's this tab called automations.
Click that, and you can set up a new automation. I've already set one up, and I've said every time I open up a PR in Astro Hub, which is my new project I've been working on more on that soon, I want this automation to trigger. Now there is a difference between an automation and a loop, and I'll explain that in a moment.
But when that trigger happens, whenever a PR opens, then I give the agent the instruction to review the PR and look for any potential issues, fix them automatically, and commit back to the same PR. Make sure all tests pass, and if they don't, fix them.
Make sure all other CI is green. So those are the goals of this loop. And that's it.
That's my loop. And loops are really as simple as that. Loops get more complicated when the goal becomes more amorphous.
Rather than all the tests passing, which is a very deterministic and clean way to know if the goal has been achieved or not, you might wanna say, okay. The goal is build this feature in my product.
But how do you actually define what the end state of that feature is? You basically have to write all of it. You have to determine the full spec up front.
And for a lot of people, including myself, that is very difficult because part of building a feature is exploring it, figuring out what parts I need, what parts I don't, building it, iterating.
That entire process, I am extremely involved in. And with loop engineering, you're basically saying, I'm removing myself.
I'm giving the loop the end goal of this completed feature, and then I'm walking away. Now let me show you some other possible triggers because it's not just if a PR is opened.
One very common trigger for loops is a schedule. So if I click here, we can look at a schedule. This is also known as a cron job.
Basically, some recurring thing that happens on some given time frame. So every thirty minutes, every hour, every day, every week, whatever it is, you want something to run, a loop to start on that schedule.
All of these other ones are based on certain actions that happen, so there really are only three total types of triggers. One, some kind of action happens like a PR opens. Two, it's a schedule that happens, so every 30 minutes.
And three, a human kicks it off. That is still very much a trigger.
So you can type out everything that you want in that end state and just say go, and it'll continue to loop, continue to write code, continue to iterate until it reaches that end goal. And that's it.
You can get very complex with your loops. You can give skills to your loops. You can even code it to get smarter as it iterates through the loop.
All of these things are possible and just add complexity to looping, but the most basic definition of a loop is still some trigger and some goal. And by the way, with loops, you're gonna be producing so much more code and so many more software products than you ever thought possible, and you need a way to publish them just as quickly.
And that's where the sponsor of this video comes in, Now. Hear.
Now is one of my favorite products to tell you about because, one, it is awesome and I actually use it, and, two, it has actually inspired the way that I think about the future of the Internet. So if you haven't heard about it before, hear.now is the easiest way to give publishing ability to your agent.
Whether you use Cloud Code or Codex or OpenClaw or Hermes, all you have to do is tell your agent to go to hear.now and install the skill.
Or you just come to this page right here, click the copy setup button, paste it into your agent, and it just knows how to do it. Then at that point, your agent can publish anything to the web on your behalf. And they also recently launched private storage, so you don't need to always just publish everything publicly.
You can have your agent store pretty much anything on here.now. And then even more recently, they launched custom URLs. So rather than only having a here.now URL, you can use your custom domain with here.now and publish directly to it.
And the best part, it's completely free right now. So go check it out. I'm gonna link all of it down below, but tier.now.
It's super easy. So now back to the video. Alright.
So if you're using Claude code, here is how to use loops, and they literally have a feature called slash loop. So you just start typing slash loop, and it says run a prompt or slash command on a recurring interview. So loop five minutes and then whatever you want.
So you could say loop every five minutes, reach feature parity with Google. Obviously, that's ridiculous, and I'm gonna have a trillion dollar token bill at the end of the month, but that's how you do it. And you can set any goal you want.
So here's a more realistic example. Slash loop every five minutes, compare what we have built with our full spec, spec.md.
It could be anything, whatever product you have a vision for, and continue building until we complete the full spec. So every five minutes, it's gonna kick off an agent.
That agent is going to determine what is left to build and start building it. And it's just gonna keep kicking off agents and keep looping until it finally reaches that goal.
Now we can have a single loop that does that. We can remove every five minutes and just say loop. Just continue until you reach that final goal.
And that would be the human kicking off the loop. Now there are lots of caveats to loops and really a lot of criticism that, at least for now, is quite valid. Number one, it is very difficult to set up.
The most basic forms of loops, which I just showed you, are quite easy, actually. But if you start thinking that you're gonna build this entire code factory that builds entire products for you and continues to loop indefinitely and shipping features at speeds you've never imagined, that part is very difficult.
Defining what the end state of something that doesn't have a deterministically verifiable goal is much more difficult and ripe for the agent to continue to burn tokens indefinitely, and you have to be really careful about that. And that leads to the second biggest criticism.
Boy, is looping expensive. The more that you abstract the human away from writing the actual code, the more tokens you're using.
The more tokens you're using, the more expensive your AI bill is gonna be at the end of the month. Now it's not always going to be that way. What's expensive today is cheap tomorrow.
That has been proven time and time again throughout the history of technology. As tech diffuses, we find ways to make the production of that tech more efficient, and thus the price gets driven down.
And that is definitely what we're gonna see here. But today, it is still very expensive.
And at the same time that a lot of people are talking about how expensive it is and companies are trying to cut their bills, the idea of introducing loop engineering becomes completely crazy to most people.
So I know this stuff is very expensive, but it is also just as important to know what's going on even if you're not using it today. And that also brings me to the point that there is this huge bifurcation of people in engineering right now where only the top one percent of 1% are using these techniques like loop engineering.
Because not only are they enabled to try these new techniques, but also they're given infinite or very high token budgets, which only a few companies in the entire world can really afford. Now we talked about Peter Steinberger and Boris Churney, respectively, from OpenAI and Anthropic.
Both companies give their employees infinite tokens. That's why they're able to experiment.
But that's also why Peter Steinberger showed about a few weeks ago, he had $1,300,000 in monthly token usage. Not many people can afford that.
So loop engineering is definitely not for everybody and certainly not today, but this is absolutely the future of engineering.
We will continue to build the software factory that builds the software.
We as engineers will gradually and then suddenly no longer even be writing prompts to our agents to go write software for us. We will be designing these factories that allow the agents to run autonomously.
Now two last things I wanna talk about. One, I mentioned earlier in the video there is a distinction between automation and loops.
They're very related, but the difference between a loop and an automation is that a loop has some decision inside the loop.
It is deciding if it reached the goal or not. It is not just executing a series of prompts. It is not just executing a few lines of code.
With a loop, You are specifically giving the loop the ability to determine if it reached its goal or not. That's the difference. And once again, thank you to Heardot now for sponsoring this video.
I'm gonna drop a link to them down below. Give your agent the instructions. It is so easy.
Go check them out. They've been a fantastic partner. Now here's where it gets wild to think about.
Will the human be required in the loop forever or not? Right now, humans are required in the loop. That is because we are still deciding what the goal is, what direction should we be headed.
And when I say we, I mean myself and my agents, my loops, whatever it is. I am saying here's the direction we should go in. Go.
But there's a world in which we can imagine in which I am no longer setting the direction. I am no longer setting the goal. AI has taste, and it's able to decide what features to build, what products to build, what companies to build.
And really what we're describing is AI is able to design its own factory. That is the point at which we have recursive self improvement, a topic that I just made a long video about.
Anthropic just put out a full essay all about recursive self improvement. Check out the video right here.
The Hook

The bait, then the rug-pull.

Over one weekend, two of the most-followed engineers in AI posted the same idea at the same time: stop prompting your coding agents and start designing the loops that prompt them. One tweet hit five million views in under twenty-four hours. The host unpacks why -- and who is actually using this technique today.

Frameworks

Named ideas worth stealing.

01:50model

Loop = Trigger + Verifiable Goal

  1. Trigger (event / schedule / human)
  2. Verifiable goal (deterministic or LLM-judged)

The minimal definition of a loop. Everything else -- skills, self-improvement, complex specs -- is additive complexity on top of this two-part foundation.

Steal forAny autonomous agent workflow -- use as a checklist before deploying a loop to catch missing termination conditions
05:02list

Three Trigger Types

  1. Action-based (PR opens, webhook fires)
  2. Schedule-based (cron, every 30 min)
  3. Human kick-off (type a goal and say go)

Exhaustive taxonomy of what can start a loop. Every possible loop trigger falls into one of these three categories.

Steal forDesigning new loops -- map your use case to one of these three before building
CTA Breakdown

How they asked for the click.

FROM THE DESCRIPTION
Frame Gallery

Visual moments.

Watch next

More from this channel + related breakdowns.

15:48
Matthew Berman · Tutorial

You Aren't Using Codex Like Me

Eleven power-user habits from someone who has logged over a thousand hours in OpenAI's Codex CLI — model tiers, thread delegation, safety hooks, and remote control from a phone.

July 14th
08:54
Matthew Berman · Review

GPT-5.6 is FINALLY HERE (WOAH)

A 'dot' release plays out like a full generational leap: two five-to-seven-day unsupervised coding runs, a sponsor benchmark, and a live pricing and capability standoff against a rawer, higher-ceiling rival model.

July 9th