How to design AI agent loops: schedules, goals, and subagents in Claude Code and Codex
Description
Watch: full video.This is a practical guide to designing AI agent loops: not one-off prompts, but recurring systems that know when to run, what goal to pursue, what context to use, and how to check their own work. The useful shift is from manually babysitting AI tasks to designing routines with schedules, state, subagents, and clear stop conditions. For knowledge workers, the value is a more concrete way to think about where autonomous AI work is useful, and where it can become wasteful or expensive.
Official video embed
Claire Vo, How I AI / Lenny’s Newsletter, Jun 17, 2026
Claire Vo, How I AI / Lenny’s Newsletter, Jun 17, 2026
This video is hosted by a third-party provider. It will load only after you choose to press Play.
This video can load through the original platform's official player where available.
Open original sourceKey Takeaways
- The important distinction is that an agent loop is not magic autonomy; it is an automated prompt system with timing, context, tools, state, and a reason to run.
- Different loop types fit different work patterns: heartbeats watch continuously, crons run on schedule, hooks react to events, and goals pursue a defined outcome.
- The “onboarding an employee” mental model is useful because good loops need instructions, permissions, examples, feedback, and boundaries before they touch real work.
- The practical risk is cost and noise: goal-based loops can burn tokens quickly if the task is vague, the stopping condition is weak, or validation is missing.