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 ↗

CHAPTERS

  1. 0:00 – 2:30

    Why “loops” beat one-off prompts for agentic work

    Claire frames the episode around a shift from manual prompting to agents that can trigger and guide themselves through automated workflows. She sets expectations: loops are powerful (especially for engineering), but prompting still has a place and there are pitfalls to avoid.

  2. 2:30 – 3:03

    What a prompt is vs. what a loop is (in plain language)

    She distinguishes standard chat-based prompting (human-triggered message turns) from automated prompting. A loop is essentially an automation that repeatedly kicks off agent work on a schedule or until a goal is satisfied.

  3. 3:03 – 6:03

    Four automation patterns that trigger loops: heartbeat, cron, hooks, goals

    Claire breaks down the main ways loops get triggered—three classic automation patterns plus a newer AI-first pattern. She explains each and why they matter in modern AI coding tools.

  4. 6:03 – 9:26

    The core ingredients of effective loop engineering

    Using Addy Osmani’s loop engineering framing, Claire outlines what makes loops reliable and maintainable. She emphasizes operational hygiene—isolating work, reusing repeatable skills, and tracking state—so autonomous agents don’t create chaos.

  5. 9:26 – 11:58

    Loops as “onboarding an employee”: a practical design framework

    She recommends designing loops the way you’d assign a job to a new hire: clarify cadence, responsibilities, and success criteria. This makes loop creation less intimidating than complex workflow diagrams and “thousands of loops” hype.

  6. 11:58 – 19:00

    Loop 101 in Claude: scheduled tasks as beginner-friendly loops

    Before coding-heavy examples, Claire points out that many users have already built loops via simple scheduled tasks (e.g., a morning briefing). She positions routines/scheduled tasks as the gentlest entry point to loop thinking.

  7. 19:00 – 22:57

    Live build #1 (Claude Code): Daily aging PR review & “babysitting” loop

    Claire builds a routine that checks for PRs older than 12 hours, evaluates merge readiness, and either monitors them to green checks or notifies the team. The loop uses connectors (GitHub/Slack) and can spawn threads/subagents for ongoing PR babysitting.

  8. 22:57 – 25:28

    Watching goal-based subagents spin up and validate skills in real time

    As the automation runs, Codex creates subagent threads with explicit goals to test and confirm skill quality against the base branch. Claire narrates how these goal loops continue until validation completes, demonstrating layered automation (schedule → subagents → goal loops).

  9. 25:28 – 27:31

    Warning signals: cost blowups and sloppy goal criteria

    Claire closes with cautions: loops can silently become expensive and wasteful if validation criteria are weak or prompts are imprecise. Goal-based loops are especially sensitive—unclear success metrics lead to long runs and token burn.

  10. 27:31

    Where listeners can apply loops next (and how to think about them)

    She broadens the use cases beyond engineering: scheduled briefings, inbox cleanup, research workflows, and any recurring job that can be validated. The episode ends with a call for comments on how others are using loops and whether they’re worth the cost.

  11. Subagents inside loops: distributing work across threads

    She highlights that loops don’t have to do everything in one “main” run. Instead, a loop can delegate specific responsibilities (like monitoring checks or validating outputs) to subagents running in parallel threads.

  12. Live build #2 (Codex): Weekly skills identification loop from recent PRs

    In Codex, Claire leverages automation templates to create a weekly loop that reviews merged work and recommends skills to deepen. She adds constraints: ground recommendations in evidence, focus on internal validation tools, and validate each suggested skill via subagents.

Get more out of YouTube videos.

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