Loop engineering is the practice of writing a loop that prompts Claude for you, over and over, until a job is finished, instead of typing one prompt and watching the result by hand. It turns Claude from a tool you operate turn by turn into a worker that runs a task to completion. The community named the practice in June 2026, after Google's Addy Osmani used the phrase and Boris Cherny, Head of Claude Code at Anthropic, said it out loud: "I don't prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do." The clip spread fast, because it described what a lot of people had already started doing.
The phrase is a community term. The features underneath it are official, and they ship inside Claude Code.
Two commands do the heavy lifting, and knowing when to reach for each one is most of the skill.
/goal <condition> runs Claude across turns until a condition holds. After each turn a lightweight evaluator model checks whether the goal is met. If it is not, Claude keeps going. When the condition is satisfied, the goal clears itself. It needs Claude Code v2.1.139 or later, and it works best with auto-approve on so it can run unattended.
/loop [interval] [prompt] re-runs a prompt on a rhythm. Give it an interval (/loop 30m ...) and it fires on that beat. Give it no interval and it self-paces. A Claude loop like this runs until you end the session or tell it to stop.
The rule I use: reach for /goal when there is a finish line, and /loop when there is a beat to keep. A migration that has to reach 100 percent is a goal. A community feed that has to be checked every half hour is a loop.
People sometimes ask why they cannot script this with cron. The difference is who makes decisions while the work runs.
| Property | Cron job | Loop |
|---|
| What runs | A fixed script | Claude, choosing each step |
| Handles the unexpected | Fails or repeats blind | Reads the situation and adapts |
| Decision-maker | None | The model, mid-run |
| Best for | Identical, predictable steps | Fuzzy work that needs judgment |
| Checks its own work | Only if you coded the check | Against evidence you define |
A cron job runs the same script on a timer with no one home to make a call. A loop runs Claude, which looks at what is on the screen and picks the next action. That mid-run judgment is the whole reason to use one.
Every loop I trust follows the same five beats.
- Find the work. Scan the source (a feed, an inbox, a folder, a window) and pull the items that qualify.
- Do one item. Handle a single unit of work, from start to finish, before touching the next.
- Check with evidence. Confirm the result against something you can observe, rather than trusting the model's confidence. Open the link. Read the field back. Look at the screenshot.
- Remember. Write state to a file so the loop never repeats work it already did.
- Go again, then stop. Return to beat one until the goal holds, then stop or ping you.
Beat three is the one that earns its keep. Ask any AI for a one-page brief and it hands back clean prose with sources at the bottom. Some of those sources are invented: real-looking links that lead nowhere, or pages that do not support the claim. A single prompt never catches this, because the model stays confident until something opens the link. A loop with a measurable bar catches it. Every claim needs three sources, every link must open to a page that backs the claim, and the loop opens each one before it calls the job done. It never gets bored and never skips the boring ones.
Most loop-engineering writing shows loops doing code and file work, the things Claude can already touch inside a terminal. The bigger unlock is loops that do desktop and browser work: clicking real buttons, typing into real apps, taking part in real community threads. That needs eyes and hands, which is what OpenOwl's computer-use tools add on top of Claude. This is where AI desktop automation stops being a demo and starts touching the apps you use all day.
OpenOwl runs on macOS and ships 42 tools built for this kind of loop: screenshot, click, type_text, send_keys, paste_text, find_element, click_element, find_text, click_text, list_windows, focus_window, wait_for_change, batch_actions, and workflow record and replay. A loop stitches those calls together and decides which one comes next based on what it sees.
We run a community-engagement loop of our own. It finds relevant Reddit threads, drafts a reply that answers the question asked, and posts it through OpenOwl driving a real browser. It taught us things no tutorial did, and most of them showed up as broken output before we understood the cause.
- Type through AppleScript, not raw automation. On macOS, raw pyautogui typing dropped characters in browser fields. A thirty-character string landed as about three. Clipboard paste did nothing and returned no error. OpenOwl routes typing and paste through AppleScript System Events now, and the characters arrive.
- Never OCR a URL. OCR confuses q with d, 0 with O, and l with 1, so a permalink read off the screen becomes a dead 404. Read the address bar instead: cmd+L to select it, cmd+C to copy, then read the clipboard.
- A blank read-back is not always a failure. Browser text fields do not expose their value over the accessibility layer. When an after-typing read-back says the value could not be read, that outcome is expected, and the loop treats it as normal rather than retrying into a mess.
- Keep a focus-theft tripwire. If a screenshot ever shows terminal scrollback where the target app should be, the loop stops and refocuses before it does anything. A misplaced click or keystroke costs more than a pause.
- Remember every post. The loop keeps a state record of what it has already replied to, so it never double-posts into the same thread.
We run this in production. I will not hand you throughput numbers, because the honest version of this story is about reliability rather than volume. A loop that posts fast and posts garbage is worse than no loop.
Connect OpenOwl to Claude Code, drop this charter in, adjust the specifics for your target, and run it once while you watch.
/goal Every qualifying thread in my queue has a staged, on-topic draft reply, and every draft has passed the checks below.
You are running a community-engagement loop on macOS through OpenOwl.
FIND THE WORK
- Open the browser window with list_windows and focus_window.
- Read the current thread URL from the address bar: send cmd+L, then cmd+C, then read the clipboard. Never OCR the URL.
- A thread qualifies only if I can add a real answer to the exact question asked.
DO ONE ITEM
- Draft one reply that answers the question first and mentions a product only when it is the direct answer.
- Type through AppleScript-backed input (type_text / paste_text), never raw keystrokes.
- After typing, do not treat a blank value read-back as a failure. Confirm with a screenshot instead.
CHECK WITH EVIDENCE
- The reply helps on its own, even with every link removed.
- It breaks no rule of the platform or the subreddit.
- Re-open the thread URL from the clipboard and confirm it loads a real page.
REMEMBER
- Append the thread URL and a one-line summary to state.md.
- Before drafting, skip any thread already in state.md.
NEEDS ME
- If a thread needs judgment only a human should make (a refund, a callout, a DM, anything a community would read as spam), add it to needs-me.md and skip it.
STOP
- Stage every draft for my review. Post nothing until I approve.
- If a screenshot shows the terminal instead of the browser, stop and refocus first.
A loop can post to a community faster than any human, and spam breaks platform rules and backfires on the brand it was meant to help. The version we run, and the version worth running, holds four lines.
- Keep a human gate. The loop drafts and stages. A person approves before anything posts. If you remove the gate, narrow the loop to a tight, provable definition of helpful so it cannot wander.
- Honor the "needs me" rule. Any item that needs judgment only a human should make (spending money, deleting something, contacting a named person, anything a community would read as spam) goes on a "needs me" list and gets skipped. The loop does not auto-execute it.
- Add value or do not post. A loop that dumps generic promo into threads is spam. A loop that surfaces a real, useful answer is participation. The test is whether the reply would help even if you deleted every link in it.
- Respect each platform's automation rules. Read them, then follow them. One automated account that ignores them can get every account you own banned.
- The source-checker. Point a
/goal loop at a draft. Every claim needs three sources, every link must open to a supporting page, and the loop opens each one before it signs off.
- The inbox triage loop. Have it read your mail client, label what qualifies, draft replies to the routine messages, and drop anything sensitive on the "needs me" list.
- The community listener. Run a
/loop 30m that scans your feeds, flags threads where you can add a real answer, and stages a draft for each.
- The release-notes gatherer. Walk it through app windows, screenshot each panel, and assemble a changelog, with wait_for_change confirming the UI settled before every capture.
- The form filler. Feed it a spreadsheet and a web form, and let it type each row through AppleScript-backed input, with a screenshot check after every submit.
Each of these fits inside 50 tool calls a day on OpenOwl's free tier for a first run. When a loop earns its keep and you want it running unattended for longer, OpenOwl Pro lifts the cap for $19.99 a month.
Some work should never sit inside an unattended loop.
- Anything that spends money without a human pressing the button.
- Anything that deletes data you cannot recover.
- Anything that contacts a specific person on your behalf.
- Anything a community would read as spam.
Route all of it to the "needs me" list and handle it yourself.
What is loop engineering?
Loop engineering is the practice of writing a loop that prompts Claude over and over until a task is finished, rather than typing one prompt and babysitting the output. Google's Addy Osmani popularized the phrase in June 2026, and the underlying commands (/goal and /loop) ship inside Claude Code.
What is the difference between /goal and /loop?
/goal <condition> runs until a condition holds, then clears itself, which suits work with a finish line. /loop [interval] [prompt] re-runs on a rhythm or self-paces and runs until you stop it, which suits work with a beat to keep.
Does OpenOwl work on Windows?
No. OpenOwl runs on macOS. It gives Claude 42 tools for seeing and driving the screen, and it routes typing and paste through AppleScript System Events so characters land in browser fields.
Can I automate Reddit or other community replies safely?
Yes, with a human gate. Let the loop find threads and stage drafts, approve each post yourself, and skip anything that needs human judgment. A loop that adds a real answer is participation; a loop that dumps promo is spam and can get your accounts banned.
How many tool calls do I get for free?
OpenOwl's free tier includes 50 tool calls a day, which covers a first run of most loops. Pro removes the cap for $19.99 a month.
Do I need to write code to run a loop?
No. You write a charter in plain language, connect OpenOwl, and run it. If you would rather have one built and tuned for your workflow, the done-for-you service handles it.
Pick one repetitive task you did by hand this week. Writing it as a charter takes about ten minutes: the goal, the five beats, the "needs me" list, and a stop rule. Connect OpenOwl (the quick setup takes a few minutes on macOS), paste the charter into Claude Code, and run it once with your hands off the keyboard while you watch. You will see the first thing that breaks inside the first few items, and fixing that one thing is how every reliable loop begins.