How to design AI agent loops: schedules, goals, and subagents in Claude Code and Codex

17 Jun 2026 · 29 min
How I AI

17 Jun 2026 · 29 min

0:00

AI loops are automated prompting systems that let agents work without human input. The host covers four loop types (heartbeats, cron schedules, event hooks, goal-based) and five building blocks (work trees, skills, plugins, subagents, state tracking), then builds two examples: a daily PR review that flags old pull requests and sends Slack reminders, and a weekly automation that suggests developer skills and validates them with subagents.

Chapters

More from Lenny

24:04
Podcast

Meta’s new ‘Muse Wonder’ model: good for AI agents, bad for design

1d ago
37:47
Podcast

How Meta designed Muse: an AI agent people actually want to talk to | Alex Cornell (Design Director)

3d ago
1:02:11
Podcast

Why every company now needs to think and operate like a lab team | Josh Woodward (Google Labs, Gemini, AI Studio)

4d ago
35:40
Podcast

How OpenAI uses ChatGPT Sites (live at DevDay!) | Kath Korevec (Product Lead)

1w ago
37:23
Podcast

OpenAI’s Head of ChatGPT: We’re entering a new era of AI (again) | Tibo Sottiaux

1w ago
46:06
Podcast

Jev: 8 real use cases for the fastest, cheapest model I’ve ever used | John Lindquist

2w ago
24:20
Podcast

OpenAI Dev Day 2026: The releases that actually matter

2w ago
26:24
Podcast

Jev for beginners: how to use it and what to build

2w ago
1:34:14
Podcast

The grief, loneliness, and burnout sweeping through the tech industry right now | Molly Graham

2w ago
38:51
Podcast

Opus 5.5 vs. GPT-6 Sol: which model won my blind taste test?

3w ago
24:52
Podcast

I left Claude for months. Opus 5.5 is why I'm back

3w ago
See all content