Skip to content
How I AIHow I AI

Loop engineering for beginners

I break down every loop type from scratch—what a heartbeat, cron, hook, and goal loop actually are, when each one fits, and the five things any effective loop needs before it touches production. Then I build two live loops: a daily aging-PR reviewer in Claude Code that schedules itself at 10:15 a.m. and spins off its own subagents, and a weekly skills-identification loop in Codex that spawns goal-based subagents to validate its own output in real time. *What you’ll learn:* 1. The plain-English definition of a loop—and why it’s just an automated prompt, not a scary new paradigm 2. The four loop types (heartbeat, cron, hook, and goal) and when each one actually fits your workflow 3. How to think about loop design using the “onboarding an employee” mental model 4. The five things every effective loop needs: work trees, skills, plugins/connectors, subagents, and state tracking 5. How to build a scheduled PR-review routine in Claude Code that babysits aging PRs and alerts your team 6. How to set up a weekly skills-identification automation in Codex that spawns its own validating subagents 7. Why goal-based loops are the hardest to write well—and where most people burn tokens for nothing 8. The two warning signs that your loop is going to get expensive before it gets useful *Brought to you by:* WorkOS—Make your app enterprise-ready today: https://workos.com?utm_source=lennys_howiai&utm_medium=podcast&utm_campaign=q22025 Runway—The creative AI platform for images, video, and more: https://runwayml.com/howIAI *In this episode, we cover:* (00:00) Prompts are out and loops are in (02:30) Defining a loop (03:03) The four ways to automate a prompt: heartbeat, cron, hooks, and goals (06:03) Five things every effective loop needs (09:26) The “onboarding an employee” framework for designing loops (11:58) Live build #1: Daily aging PR loop in Claude Code (17:08) Subagents inside loops (19:00) Live build #2: Weekly skills identification loop in Codex (22:57) Watching subagents spin up in real time (25:28) Warning signals around loops (27:31) What listeners are doing with loops *Tools referenced:* • Claude Code: https://claude.ai/code • Codex: https://chatgpt.com/codex • OpenClaw: https://openclaw.ai/ *Other references:* • Claire’s article “Why OpenClaw Feels Alive Even Though It’s Not”: https://x.com/clairevo/article/2017741569521271175 • Addy Osmani’s article on loop engineering: https://addyosmani.com/blog/loop-engineering/ • Using Goals in Codex: https://developers.openai.com/cookbook/examples/codex/using_goals_in_codex *Where to find Claire Vo:* ChatPRD: https://www.chatprd.ai/ Website: https://clairevo.com/ LinkedIn: https://www.linkedin.com/in/clairevo/ X: https://x.com/clairevo _Production and marketing by https://penname.co/._ _For inquiries about sponsoring the podcast, email jordan@penname.co.)_

Claire Vohost
Jun 17, 202629mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Design AI agent loops with schedules, goals, tools, and subagents

  1. A “loop” is automated prompting that lets an agent initiate work on a schedule or in response to triggers, reducing reliance on manual chat-style prompting.
  2. The host outlines four loop mechanisms—heartbeat, cron, hooks, and goal loops—and frames loops as pre-AI automation patterns now applied to AI agents.
  3. Effective loops require supporting infrastructure (isolated workspaces, reusable skills, connectors/plugins, subagents, and state tracking) to keep execution clean and repeatable.
  4. Two live builds show loops in action: a daily “aging PR” babysitter in Claude Code and a weekly “skill identification + validation” automation in Codex that spawns goal-driven subagents.
  5. The episode closes with cautionary guidance: loops can become expensive and unreliable unless prompts, success criteria, and monitoring are designed with precision.

IDEAS WORTH REMEMBERING

5 ideas

A loop is just automated prompting—nothing mystical.

Instead of typing prompts manually, you trigger agent work via schedules or events, and the agent can continue prompting itself until it finishes or gets blocked.

There are four practical trigger styles: heartbeat, cron, hooks, and goals.

Heartbeat runs at a regular interval, cron runs at specific times, hooks react to lifecycle/webhook events, and goal loops keep running until measurable criteria are met.

Good loops depend more on operational scaffolding than clever prompts.

The episode highlights isolation (worktrees), reusable “skills,” connectors/plugins, subagents for delegation, and explicit state tracking to prevent conflicts and chaos.

Design loops like you’re onboarding an employee with a recurring job.

A clear job statement (“every Friday do X and report Y”) translates directly into an automation that is easier to specify, evaluate, and improve over time.

Subagents make loops scalable by delegating babysitting and validation.

In the PR loop, subthreads can monitor individual PRs until checks are green; in the skills loop, separate agents validate each proposed skill against the base branch.

WORDS WORTH SAVING

5 quotes

Prompts are out and loops are in. If your agent isn't able to prompt itself through an automation, what are you even doing?

Claire Vo

I think this whole concept of a loop is really just reminding people you do not have to use your human fingers to type in a prompt in order for your agent to do work on your behalf.

Claire Vo

A goal is a type of loop that sets an outcome and runs an agent against that outcome until the outcome can be measured and validated, or the agent is blocked.

Claire Vo

When you're designing loops or designing agents, I say this is the time for the manager. You are designing a job. And so just imagine that you're onboarding an employee.

Claire Vo

If you do not write that loop well or your validation criteria is too thin, guess what? Your agent is going to burn tokens.

Claire Vo

Prompts vs automated loopsHeartbeat, cron, hooks, and goal-based loopsLoop engineering checklist (5 essentials)Worktrees / isolation for parallel agent workSkills, plugins/connectors (GitHub, Slack, etc.)Subagents and multi-threaded validationCost control, success criteria, and warning signals

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.