YouTube Summaries

← All summaries

Loops that prompt agents: orchestrating dynamic agent workflows

2026-06-18 Thu ⏱ 24 min @t3dotgg

Theo, initially skeptical of the "stop prompting agents, build loops that prompt agents" discourse (Pete / Ralph loop), comes around after experimenting. He argues most of your agent runs should not use prompts you personally wrote — instead, agents should drive their own loops: reviewing, fixing, re-reviewing, and even dynamically spawning sub-loops tailored to the work. Big caveat: it burns enormous token volume, only sane on subscription (not API) pricing.

From hand-held loops to self-driving loops

  • The "memo" everyone got: don't prompt coding agents; design loops that prompt them. Theo had tried loops (Ralph loop) before — cool but high error rate, so he reverted to manually shuttling context between plan, build, review, and feedback steps. He was the loop.
  • Turning point: Pete's tweet about telling Codex to maintain repos, waking every ~5 min and directing work to threads. Theo discovered a Codex thread can spawn another Codex thread, and started pushing that hard.
  • Frames it via Anthropic's recursive-self-improvement narrative: the copy-paste-from-chatbot era → IDE/terminal agents editing code directly → workflows and sub-agents. He still mocks predefined personas (adversarial reviewer, security reviewer, etc.) as missing the point — the value is agents building context dynamically, not hardcoded roles.

What he actually built

  • Had Claude Code file a big refactor PR, let Opus break it into sub-agent work itself. Told the agent to monitor the PR for comments from his review bots (CodeRabbit, Reptile, Macroscope) and address them — instead of copy-pasting comments in by hand. Ran ~6+ hours, many improvements.
  • Scaled to a multi-PR project (rebuilding the isolate layer in Lakebed): asked the model to split work into ~3 stacked PRs, write HTML plans (the "Thoric" pattern, readable on his phone), then build a workflow that spins a thread to make each PR, another thread to review it, loops on review comments until approvals, merges, and triggers the next PR. Set it off at 2:29am, woke to four stacked, reviewed, merged PRs.
  • Key insight: "my loops created loops." He asked the model if it could build the loop and it produced a dynamic workflow with sub-loops shaped to the specific problem — versus static agile/sprint cadence that forces work into a fixed shape.

Practical advice and the cost catch

  • Method: watch what you do after the agent finishes — run dev server, verify it works (computer use is good now), commit, push, file PR, fetch review comments, fix — and tell the agent to do each of those steps itself. "We are looking at the code too early": if you read it before another agent reviews it, you're wasting your time.
  • Doesn't require custom skills/plugins — he uses mostly stock Codex. Mentions the `/goal` primitive (Codex & Claude Code) for one never-ending thread vs. dynamic workflows; has a 12h+ `/goal` run rewriting Hermes agent in Rust.
  • Cost is the catch: loops burn far more tokens and can wander down wrong paths. At API prices, don't. On a $200 subscription it's wildly net-positive — he's at ~$10K of inference value for the month across machines on three $200 plans, often nowhere near limits. Treat the limits as a challenge: unused capacity is money lost.