Schedules + goals + subagents design framework
A design framework for AI agent loops built on three questions — when should it run (schedule), what does done mean (goal), and who does the isolated pieces (subagents) — with worked examples in Claude Code and Codex.
Implementation note
When to use: before building any nontrivial loop — this is a design framework, not a runnable loop, and it exists because most loop failures are design failures: fuzzy done conditions, wrong triggers, monolithic tasks. How it works: three questions structure the design. When should it run — that is the schedule. What does done mean — that is the goal, which must be concrete and checkable. Who does the isolated pieces — those are subagents, each taking a bounded slice of the work with its own context. The framework ships with worked examples in both Claude Code and Codex showing the questions applied to real automations. Safety: the discipline itself is the safety value — a loop with an explicit machine-checkable done condition and decomposed responsibilities is far less likely to run away than a vibes-based one. Whatever design emerges, still add the runtime rails: iteration caps, budgets, and review gates on anything that mutates. Hardened 2026-07-27: explicit stop/cap/verification guardrails appended; regraded D→A.
Source: Lenny's Newsletter ↗graded A · 95/100 — how grades work →
More planning loops
Implement feature X autonomously
Ralph runs until it outputs DONE, implementing the feature end-to-end over up to 20 iterations.
Ship GOALS.md phases 1-13
Implement each GOALS.md phase with tests and validation, committing and pushing after stable milestones until unblocked.
Execute roadmap phases to completion
Work through each phase in your roadmap, verify each one, run the final audit, and stop when all phases pass.