- simple.ai by @dharmesh
- Posts
- Learning To Write Your First AI Loop
Learning To Write Your First AI Loop
Why power users have quit prompting AI
Boris Cherny, the creator of Claude Code, has given up on prompting AI.
Most people’s mental model of AI involves feeding a chatbox a few sentences of instructions, piece by piece. Enter a prompt, get an output, refine, repeat until you're satisfied.
If you’re more advanced, you’ve started context engineering which involves hydrating the context window with the needed context so the LLM can do its thing. This might involve using tools, skills, MCP servers and other things.
But if you are deep in the AI world and pay attention to power users like Boris, you’ll notice that how they use AI has evolved past both prompting and context engineering.
Instead of prompting, they create loops that allow the AI to understand the end goal it’s working towards, and when it should stop working.
Longtime subscribers may recall my spidey senses felt this shift coming on back in March when I said we’re moving from chat sessions to persistent loops.
Here’s the quote from Boris that caught my attention: "I don't prompt Claude anymore. I write loops — and the loops do the work. My job is to write loops."
So today, I want to break down:
What it actually takes to write a loop, and how that's different from prompting
How to create loops that learn on their own
Where you still belong in the loop, even when it runs without you

So What Does It Mean to Write a Loop?
A prompt is a single ask, done by hand. You ask, the AI answers, you read it, you decide what’s next. You’re in the driver’s seat.
Writing a loop means stepping out of the driver’s seat and building the thing that generates those prompts for you. And a loop here has three parts.
The objective is what you're trying to get the system to accomplish.
The metric is how the system itself, not just you, can tell whether a given pass came out better or worse.
The boundary is how far the loop can go on its own before it has to come back and check with you.
Get those three right, and you stop babysitting every turn: the loop asks, checks its own work against the metric, adjusts, and keeps going without you.
So how do you actually run a loop of your own? Just bring the 3 ingredients (objective, metric, boundary) to ChatGPT or Claude and ask it to start the loop.
Here’s an example prompt you can steal:
Write a LinkedIn post about [your topic]. The objective: teach one useful idea in under 200 words. After each draft, score the result from 1 to 10: does the first line earn the click on “see more”, is there exactly one idea, would a smart reader learn something new? For scores below a 9, critique the draft and rewrite it. Take up to 10 passes, then show me only the top 3 winners.
The objective is the useful idea. The metric is the score AI gives its own drafts. The boundary is the ten passes. The output of this loop will be higher quality than what you’d get from a simple “write a LinkedIn post about [your topic]” one-off prompt.
One more thing -- can’t stop myself from offering one more practical level-up opportunity: attach 3-4 examples of LinkedIn posts you love to the above loop and you’ll almost certainly be more impressed with the result. Context is queen, after all!
Prompting doesn't disappear -- the loop is still made of prompts. You've just stopped hand-cranking each one and started designing the machine that cranks them.
Once a loop can adequately judge its own work, it can carry a whole workflow.
But not all loops are created equal. There’s a big difference between a loop that runs and a loop that learns.

A Loop That Runs vs. A Loop That Learns
A loop that just runs is automation: it does the same thing today that it did yesterday.
A loop that learns -- the kind that knows whether each pass landed and feeds that signal back in -- compounds. It’s adaptive. These are the big wins you want to aim for.
Let me show you with something slightly ridiculous I built last year: an AI that writes dad jokes, hacked together over a couple of weekends (all in the interests of human advancement, obviously).
Today, my dad joke generator is a loop that runs. You give it a topic, it works through my "dadabase" of curated dad jokes, and it produces something occasionally not-that-awful.
What would take it from running to learning is one small thing: an upvote and downvote button on every joke. Then the system would know which jokes landed and which flopped, and it could feed that signal back into what it generates next. Same loop, plus one feedback wire, and now it automatically gets smarter every time someone uses it.
If you can go through a loop and you know at the end of the loop whether you got better or worse, you're going to win eventually. The loop that learns beats the loop that merely runs.

Where Your Agents Need You Most
So if the loops do the work and judge the work, how do you best spend your time?
Your job moves out of task execution and into workflow design.
You pick the objective, which forces you to define what "good" actually looks like. You choose the metric, which is a judgment call about what's worth optimizing. And you draw the boundary, which is where your values and your risk tolerance live.
If you're hoping the loops free you up to sip margaritas on a beach, I have bad news. The people running these loops today are busier than ever. The keystroke work goes away (and that’s a win), but the judgment work doesn't.
The skill that compounds from here is loop design.
This week, try taking one task you already use AI for (drafting emails, summarizing calls, prepping for meetings) and write down three things:
Name the objective. What does "done well" look like, in one sentence?
Pick the metric. How would the system know a pass came out better or worse, without you reading every word? If you can't answer this one yet, congratulations: you've found the real work.
Draw the boundary. What can it do without you, and where does it have to stop and check in?
Do that, and you've designed your first loop. The tools for running loops get better every month. Start creating loops that learn today and you’ll unlock massive amounts of leverage.
Now, I’m curious -- if this newsletter has inspired you to create a loop, hit reply and tell me all about it. (Seriously, I read and enjoy all the replies).
Happy looping!
—Dharmesh (@dharmesh)


What'd you think of today's email?Click below to let me know. |
