Transcription
There's a new idea that the top AI users and programmers in the world are all talking about. Loop engineering, or sometimes it's simply referred to as loops.
In particular, Boris Cherney, who created Claude Code, and Peter Steinberger, who created OpenClaw, have both been talking about this, saying that this is now how they program. They don't just prompt a chatbot, and they definitely don't write code by hand, but instead they create these loops where the AI prompts itself. They're saying that this is the future, but at the same time, it's pretty confusing.
So in this video, we're gonna break down exactly what loops are, how to use them, what they're good for, what they're not as good for, and a bunch of real-world use cases along with a demo so you can see exactly how to start using this yourself. So at a high level, here's what a loop looks like. And I should mention that loops are usually talked about with regards to coding, but they can also be used for a ton of other things. Like content creation or research or teaching yourself a new skill. And we'll cover all of those too. But that being said, they do still all go through these coding tools like Claude Code or Codex. But you don't have to be technical to do this. So if a terminal window scares you, don't worry, it's totally cool.
So to show you this visually, this is what the old way looked like. You as the human would write a prompt, send it to the agent. It would program something, do something, produce the output. Send it back to you, you read it, write the next prompt, then it produces it again, and you just repeat forever. So you're iterating, but this is slow and there are better ways now.
So here's what the new method looks like. You start with the goal. This is set by the human once. Then it goes into discovery. So the agents now find what needs doing. They plan it out, they break it into clear steps, they execute on it, and this is where they can work in parallel. You can spin out 15 different agents who each go and do one thing. Then you have the verification step where a verification agent checks, did this accomplish our goal? If it did, ship it. If it didn't, then it iterates and does it again. Now, even when you ship it, if you want, you can add in a step where once it's shipped, an agent looks at it and goes, okay, we shipped that. What should we do next? And then it iterates again. The other key piece here is memory. Which lives outside of the conversation and keeps track of what is going on, what steps have been completed so that the agents can successfully iterate.
And then another way to look at it that's a little bit more concrete is here is an example workflow. You have the orchestrator agent that overlooks everything, so it knows what's going on and gives out tasks to the individual agents. So you'd have each of these specialists run their own discovery through ShipLab. Loop, what we just talked about down here, but then they all come together to create the finished product.
There are two types of loops, an open loop and a closed loop. An open loop is much more broad, and you're basically telling the agent, you go out there, see what we should do, and then just go and do it. Now that's really cool because the agent can discover its own things that you wouldn't even think of, but it burns massive tokens because it can go in any direction that it wants. And even once it's done with one direction, it'll go in another, and it'll just keep on going. So say if you work at Meta and you have unlimited limited budget, then this is great. But otherwise, I would recommend the closed loop, which is where you start with that bounded goal that we talk about. You see the path first, so you understand what sorts of things the agents might do. There's a clear evaluation at each step, and this keeps budget fairly normal, fairly constrained, so it's not going to get too expensive. Obviously, that's going to vary depending on how much you want to do with your agent, but it shouldn't be too bad.
So with that in mind, I want to talk about what does this look like in the real world, not some random one-off coding project. But something that a real person would use and have. So our scenario is you have an online pickleball store where you sell pickleball gear. You have some customers, but not a ton, and you want to grow it. So we're going to do a few different tasks to try and accomplish that goal.
First up is we are going to build one of these BuzzFeed-style quizzes that is going to recommend a pickleball paddle based on what your favorite Harry Potter character is. Now that's kind of goofy. It's kind of silly, But those sorts of things do work and they're pretty shareable. So that's step 1.
Second is we're gonna build a content research engine that goes out and finds what your potential customers are actually talking about right now. So looking on social media, looking on blogs, forums, Reddit, et cetera, seeing what's kind of popular, what are people sharing, what do people wanna know about so that we can go and create content about that on our website. We are also going to have that looping, so it's doing that every single week and consistently getting better over time.
And then third, we're going to have a growth agent that takes all of that stuff, looks at our site, and turns it into ready-to-use marketing. So I'm talking email campaigns, social captions, site recommendations of where we should link to other things to, you know, get more people to take this quiz that we just created, stuff like that. So that's 3 agents. It's 3 jobs all running at the same time.
And again, I think people learn best visually, so I'm going to show you what this looks like visually. So the goal is grow the Pickleball e-commerce site automatically without doing every task manually. Now we have our orchestrator agent. They own that goal. They read, um, this next steps file. You can kind of ignore this for now, but it's basically telling us what to do as we loop through things so we get better. It delegates and then synthesizes outputs.
Now the most automatic way to do this is to have an AI agent be the orchestrator, and we will have that. But to start, I'm going to be the one orchestrating the 3 agents just so you can see it visually. Because right now, if you have an orchestrator agent in Claude Code on desktop,, it will go and create all of these agents, but it just does it within the one chat. And so you don't really get to see what those agents are doing. Now it's totally fine. It does the same thing, but I think it's more helpful to learn seeing them happen as like unique tabs open. So I'll show both, but be aware of that.
Then we have Agent 1 is the builder. They're gonna build the Harry Potter quiz that we talked about with email capture at the end. Agent 2 is the scout. They're gonna search Reddit forums, competitor sites, search trends for what pickleball buyers want, what they're talking about. And the loop condition is it's going to loop until we have 3 or more fresh ideas that we've not yet acted upon, like we haven't created content about them, things like that. Then Agent 3 is our growth agent. It's gonna read the quiz, read the site to understand where it should link people to or try to like get people to take the quiz. It'll check which recommendations from the last cycle were implemented and find new opportunities. So it'll help us create emails like you see here, site edits, social captions, next quiz recommendation if we want to build a new quiz, stuff like that. It'll synthesize all of this. The orchestrator will read these, create one unified action plan, and then start acting on that.
And so the looping comes in. The goal is, is the site growing? So are there fresh content ideas? Is the lead magnet pipeline full? I mean, are people consistently taking that quiz? And if no, then we'll keep going until we get there. But if yes, then we'll pause, wait for the next steps. And then we're going to have these running on a weekly schedule cadence, which will automatically trigger the orchestrator. So like to find new content ideas, to analyze the site and see what we could be doing to, um, get more customers, like emails to send out, stuff like that. That will happen weekly. All of that feeds back to the orchestrator creating our loop.
Now let's build it. So we're gonna open Claude and then we're gonna go to Claude Code. Now you will need a Pro plan or higher in order to access Claude Code, so just be aware of that. Now we've got our new session here and then I'll paste in this prompt. I'll link to this as well so you have this. You're the builder. Your only job is to create a Harry Potter x pickleball personality quiz. The deliverable is a single self-contained HTML file saved to /outputs/quiz. 6 questions total. Each question should feel fun and slightly absurd. Questions should subtly map to pickleball playing styles, so like aggressive, strategic, social, defensive, etc. 4 possible results. And then we'll have the email capture form that appears before the result is revealed. With a CTA that says, see your full result. And then I always like to include this, ask questions if needed, so you can work with the agent to get something that you really like. Then we're going to hit start on that.
Now, while we have that one going, we're going to hit Command+N to start a new session and then jump to our second agent. We're going to prompt it with this. You are the scout. Job is to research real content opportunities for a pickleball e-commerce site, completely independent of the quiz being built in parallel. Go out to the internet and find what pickleball players, buyers, and enthusiasts are actually talking about, searching for, and struggling with right now. So some research sources would be Reddit, these subreddits, search trends, competitor sites, as well as YouTube, what videos are getting traction. For each opportunity, score it on audience size, purchase intent, like will people actually use this to buy stuff, content gap, is it underserved, And then quiz or lead magnet potential. Could it become some sort of quiz or tool or guide deliverable? Write a ranked list of the top 8 content opportunities to this location. For each one, include the topic, one-line angle, source where you found traction, 4 scores, and recommended content format, like what we should create, and then log it to our log files. This basically just keeps track of what the agents are doing so that we can go back and look at it and they know like where each one is in the process. Cool.
Now while that one is going, we are going to hit Command+N again and start a third agent, the growth agent. I'm going into here where I have these prompts. Again, I'll share all of these with you, so don't worry. Now this one is meant to start taking action once the other two have been completed, but the cool thing is as we loop through it continuously, um, it works in parallel with those. So you're the growth agent. Quiz has been built, content research is done. Your job is to do everything a smart marketing hire would do in the first 48 hours after product launch. So read these before doing anything. And then you have 4 tasks.
First is a site link audit. So we need to figure out where should we link to the quiz on the site. Now, if we had a real website fully built out, we would link to that right now. We don't because it's just a demo. I just made this up. So I'm going to say, think of a normal pickleball e-commerce site, identify every page or section where a link to the quiz would naturally fit. And then for each placement, write the exact location, the exact copy to add, and the reason it fits there.
Then we're gonna write a launch email announcing the quiz to our existing customer list. So include subject line, preview text, full body copy, CTA. It's casual, it's fun, it's pickleball obsessed. We have social captions, right? 3 captions, one for Instagram, one for Reddit, and one for a Facebook group. Each should be native to the platform. The Reddit one should not read like marketing. The Instagram one needs a hook in the first line. Save all 3 to outputs/social captions.
Next, lead magnet recommendation. So based on the top opportunities and content ideas, recommend the single best next lead magnet to build. So include the title, format, all of that stuff, 3-sentence description of what it does, why it will outperform or complement the Harry Potter quiz. Save it to here, output/nextquizrecommendation. And then looping. After completing all 4 tasks, evaluate. Did the site have obvious placement opportunities that were missed in a previous cycle? Are any of the social captions similar to ones written in a prior run? Flag any repetition or diminishing returns in a file called output/growthagentnotes. This keeps future cycles fresh. When all tasks are complete, log growth agent complete.
Now let's go check in on our agents. So the Harry Potter quiz, um, one shot at it and it's live. Let's check it out. The Sorting Paddle. Nice. Nice. Quiz is guided. 10:10. Your partner looks at you. What do you do? You show up to open play and the vibe is chaotic. Balls flying everywhere. Someone's blasting EDM. I observe for a few minutes to identify who the real players are. The kitchen game, the non-volley zone for the uninitiated, nice, is best described as Super aggressive, always. Okay. And I'm just gonna pick random questions here, or random answers here, just so we don't waste a ton of time. Sorting hat is ready. Enter your email to reveal your Hogwarts house playing style breakdown and your perfect paddle match. Let's go. This is awesome. And I got Gryffindor. Let's go. And the perfect paddle recommendation. So this is pretty cool. This was one-shotted. I think this would be nice for a pickleball website. Obviously it's not perfect. It's got the kind of AI look, but you guys get the point. So that's done. Perfect.
Now let's go back to the second agent. This is the Scout. So it found a bunch of opportunities and then ranked them. So we've got things like, is my paddle legal? An intermediate upgrade trigger guide. That's cool. Injury prevention gear guide. Shoes. When the upgrade pays off. Women's gear content. Beginner starter kit quiz. Yeah. So I think this is pretty good without looking too in depth. This seems solid.
Now let's go check on our third agent. It is still working, so we'll give it a few seconds. I'm just going to speed this up. Okay, we are done now. So. The post-launch marketing strategy. This is from the Growth Agent. It's finished. Here's what it came up with. Task 1, site edits. Let's open that here. It came up with 12 placement recommendations and then the content for each of those. So, you know, homepage, sticky navbar, category page, et cetera. On the homepage, place it directly beneath the main homepage headline. For any product grid or featured categories, copy to add, which Hogwarts house matches your pickleball personality? Boom. It didn't have the full context of the quiz, so it got that wrong, but that's nice. Yeah. And then a bunch of those. Cool. Launch email. Launch email. Okay. Yep. Ernie. Yep. That's, that's pretty funny. Cool. As well as copy notes. That's awesome. Social captions for Instagram, Reddit. I've been playing for about 3 years now and I was bored the other night thinking about why certain player personalities are so consistent. Okay. Nice. And then next quiz recommendation is your paddle past its prime. That's, that's pretty solid. Why it'll outperform supporting data points. Awesome. This is great.
So now we, you've seen those 3 agents go through things, but the thing that I wanted to show you is if you don't wanna be the one orchestrating all of this, you wanna have an orchestrator agent. Here's how we would do it. We would use a prompt like this, which is you're an orchestrator agent managing a fleet of 3 sub-agents for a pickleball e-commerce business. Job is to delegate work, monitor outputs, and synthesize results into a unified action plan. Before doing anything, check if /outputs/next_steps exists. If it does, read it first. It is your memory from the previous cycle. Use it to understand what's already completed and what still needs work before delegating anything. So we've got our goal: grow the Pickleball e-commerce site by launching a new lead magnet, researching content opportunities, and executing 48-hour post-launch marketing push. So then it's going to spawn these agents. Now it gives a prompt here as well, which is the exact prompt that we used before. You're the builder, et cetera, et cetera. So it does that for the first one, then it does it for the second one, the scout. Then it does it for the third one. But then where it really gets cool is it synthesizes all of this and it writes the next steps of a summary, top 3 actions to take this week and what the next loop cycle should focus on. So this is where we start looping after we're writing the next steps. File evaluate these 3 conditions. Are there at least 3 unacted content ideas in the document? Is the site fully linked to the quiz? Is the next lead magnet defined? And if it's not met, it's going to keep doing that. From there, if we wanted, we could spin out even more agents to help with some of this stuff. So we could have a copywriter agent that is creating blog posts for all of these, and that cycles back in. And whenever we've finished writing all of the content ideas, all of the blog post ideas, then we spin out new ones. And so now you can see how this starts to build on itself.
So that is one real world example, but I don't just wanna stop there because I wanna go through a few more examples to make this really concrete. And so we're going to do a quiz. I am going to present you with 4 different real-world scenarios that you might come across, a friend might come across, your company might come across, and you're going to think through how would I build a team of agents to loop this.
Step 1: The Freelancer. You're a freelance designer with 6 active clients. Every Friday you spend 2 hours writing status updates, digging through folders, summarizing progress, personalizing each message. It's the same task and you don't like it. So how would you loop it? I'll give you 3 seconds to think about it, and then we're jumping down to what an answer could look like. So you have a loop that runs every Friday at 4 PM automatically. It reads your project folders to see what changed, loads up a skill file that knows each client's name, project goals, and preferred tone. So this is like the memory of who your clients are, um, and how we want to write. Drafts a personalized status update, drops a finished draft in a review folder so you look through it, obviously keeping the human in the loop for Quality assurance makes a lot of sense, and then logs what was sent so that you never have to repeat this. And a loop condition would be, did every active client get an update this week? If yes, you're done. If not, it'll keep going. Cool.
Number 2, you're a student, you're studying for exams, you're trying to stay current in a fast-moving field like AI. New papers drop daily, new tools every week. You feel behind, you can't read everything. Do you want to stay sharp without spending 3 hours every Sunday doing research? How would you loop them? Give you a second to think and An answer is we Loop every Sunday while you sleep, searches for the 5 biggest developments of the past week in your topic. It scores each one by relevance to what you're actually studying, filters out anything below your relevance threshold. So if it's not relevant, it won't show it to you. Writes a plain English briefing— what happened, why it matters— and then checks the past 3 weeks of briefing so it doesn't repeat things. Now, Loop condition: are there 2+ genuinely new developments this week? If not, Dig deep. That's a pretty cool one.
Number 3, a shop owner. You sell products online, you've got SKUs, you know you should be updating descriptions, fixing what's not converting, pushing your winners harder, etc. But you don't do it because it takes a long time. How would you loop this one? Well, you could do it once a month. It runs on the first, reads your sales data, what sold, what didn't, identifies the 3 products with high traffic and low conversion, and then rewrites those product descriptions with better hooks and clearer CTAs. Writes promotional copy for your top 3 performers to push those harder, and then logs every change made and the reason behind it.
And then the last one is if you are a creator, you have a YouTube channel, you post once a week, you have a bunch of video ideas, but you never know which one to make next. You pick based on vibes. Sometimes it works, sometimes it doesn't. How would you loop that? Well, you could have a loop running every Monday morning before you start work. It reads the full ideas list, pulls the last 90 days of video performance, identifies which topics overperformed and which flopped, checks what's trending, scores every idea, outputs are ranked top 5, as well as flagging ideas that competitors are already recovered.
Now, as much as I love AI, I don't want to pretend like it is always perfect. So in certain scenarios, you have to have an understanding of what the AI is good at and what it's not good at. So you should try something like this. But for example, with YouTube videos, as someone who spent a lot of time creating YouTube videos, it's not always perfect at knowing what topics are really good and what's not. So you have to think for yourself, think critically, keep that in mind. But even if you have this and you can just look through it for a bunch of ideas and someone else's opinion, that's really helpful. So start building it and then you can add in your own thought as well.
So that's the idea of looping. Hopefully those examples helped. Now you have a clearer picture. If you have a Claude subscription or a Codex subscription, you can start testing this, using it right now. It's extremely helpful and it's the future of how people are going to work with AI. If you have any comments, drop them in the comments. I'll try to respond, and I'll see you next time.