Skip to content

Podcast

How to Design AI Agent Loops- Schedules, Goals, and Subagents in Claude Code and Codex

How I AI

Source ↗ ← All highlights
  • Three Ways To Automate Agent Prompts
    • Claire distinguishes manual message prompting (human-initiated chat turns) from automated loops that prompt agents without human input.
    • She defines three loop form factors: heartbeats (regular intervals, e.g., every 5 minutes), crons (time-specific schedules like 9am or Sundays), and hooks (triggered by internal events like a tool call or session start).
    • Heartbeats are useful for frequent polling tasks (e.g., check JIRA every 5 minutes and triage new tickets).
    • Crons are for less frequent, fixed-timing tasks (daily reports, weekly jobs).
    • Hooks tie prompts to lifecycle events, enabling reactive, event-driven agent runs. (Time 0:03:03)
  • Loops Are Automated Prompts Not A New Paradigm
    • A loop is simply an automated prompt that runs without human typing, triggered on schedules, hooks, heartbeats, or goals.
    • Claire Vo lists heartbeat (regular), cron (fixed time), hooks (events), and goal loops (run until validated) as the core forms. (Time 0:03:05)
  • Build Loops With Five Foundational Components
    • Build loops with five foundations: work trees, skills, plugins/connectors, subagents, and state tracking.
    • These keep agent work isolated, reusable, connected to tools, delegable to subagents, and trackable as a to-do list. (Time 0:06:24)
  • Design Loops Using An Employee Onboarding Mindset
    • Design a loop like you’re onboarding an employee: define the job, schedule, and desired outcomes.
    • Examples: weekly EA calendar review, hourly issue triage, or goal-based PR review until lints pass. (Time 0:09:30)
  • Daily Aging PR Reviewer That Babysits PRs
    • Claire built a Claude Code routine named Daily Aging PR Review to find PRs older than 12 hours and either babysit merge checks or post a Slack alert.
    • It runs daily at 10:15am, uses GitHub and Slack connectors, and can spawn subthreads to watch PRs. (Time 0:13:26)
  • Weekly Skills Identification That Spawns Validating Subagents
    • In Codex Claire used a template to scan recent PRs for missing skills, then spawned subagents that run goal loops to validate each identified skill.
    • The automation created chat threads that ran CLI smoke tests against the base branch to prove the skill works. (Time 0:20:17)
  • Avoid Token Burn With Precise Goal Validation
    • Monitor loop costs and write precise goal prompts to avoid burning tokens.
    • Goal loops especially must have strict, measurable validation criteria or they will run long and expensive validations. (Time 0:25:36)