Addy Osmani describes his daily workflow running five to ten AI agents in parallel using Claude Code's 'goal' and 'loop' primitives. Goal-based loops iterate until a measurable, deterministic condition is met (e.g., a Lighthouse score threshold), while time-based loops (/loop, /schedule) re-run prompts on a cadence for recurring or monitoring work like checking PRs and CI. He walks through the Claude Code team's four-tier loop taxonomy (agentic, goal-based, time-based, proactive), shares real prompt examples for verifying UI changes and refactoring a data-fetching layer, and explains how he uses loops and goals together to triage the 80-90 daily pull requests on his Agent Skills repo (80,000+ stars). He stresses never letting the same agent that did the work verify it, warns against delegating judgment/taste rather than just tasks, and notes practical details like recurring loops expiring seven days after creation and being session-scoped unless resumed or run via /schedule.
Table of contents
Before the primitives were primitivesHow the Claude Code team frames loopsGoalLoopWhat I delegate, and what I watchThe workflow I run every dayCombining loops and goalsWhat the triage system actually doesWhat loops don’t buy youThe fine printQuestions this post answers
How long do recurring loops last in Claude Code before they expire?
Recurring loops created with /loop expire seven days after creation, not three days as previously assumed. Loops are also session-scoped, meaning they stop when a new conversation starts, though resuming that same session with --resume or --continue restores any recurring task still within its seven-day window. For something that must outlive a session entirely, /schedule runs the routine in the cloud instead. Developers scheduling recurring agent tasks can track platform gotchas like this one on daily.dev.
What is the difference between /goal and /loop in Claude Code?
/goal defines a success condition and has Claude iterate, checked by an independent evaluator model, until that condition is met or a turn limit is reached, making it best for bounded tasks with a measurable finish line like a Lighthouse score. /loop instead re-runs a prompt on a fixed interval, acting like a cron job, best for recurring or monitoring work such as checking PRs or polling logs. Anyone designing autonomous agent workflows can compare primitives like these on daily.dev.
How can I use Claude Code to triage GitHub issues and pull requests automatically?
Combine /loop and /goal: schedule /loop to check GitHub on an interval (e.g., every 24 hours) for issues labeled 'bug', then trigger /goal to implement a fix until all local tests pass and push the branch. This pattern was used to manage roughly 80-90 daily pull requests on an open source repository with over 80,000 stars, including auto-closing PRs that violate contribution guidelines like unsupported translations. Maintainers automating issue triage can follow real-world agent workflow patterns on daily.dev.
396.9K Impressions9 Comments