Video summary

I guess we're writing loops now?

Main summary

Key takeaways

Technology

Technological concept: “Loops” for coding agents (and looping beyond a human-led loop)

The speaker argues you should stop having humans manually run multi-step agent workflows (“hand-holding” a loop) and instead design agent systems where the agents prompt/coordinate themselves.

They contrast two styles of looping:

  • Traditional looping (human-in-the-loop) A model makes a plan → human accepts → agent executes a chunk → another agent reviews → human brings feedback back to the original agent, repeating.

  • Agent-driven loops (machine-in-the-loop) Agents review code, give feedback, revise, re-review, and trigger the next cycle automatically.

Review/automation patterns described

Self-prompting / closed-loop iteration

Agents are set up to:

  • Audit their own output
  • Trigger re-review and fixes until approvals are reached

PR monitoring + event-based workflows

Use automation that watches pull requests and issues in other repos to react when updates happen.

Context gathering agent

A context agent (via Hermes agent) provides the needed information to the developer/user rather than requiring the user/agent to go fetch everything manually.

Orchestrators, threads, and parallelization

The speaker mentions a “simple loop” concept for Codex:

  • Wake periodically (e.g., every 5 minutes)
  • Direct work to threads
  • Use an orchestrator skill plus triage/auto-review/computer-use capabilities so parts of work can land autonomously

Key feature takeaway

  • Codex threads can spawn additional threads, enabling nested/dynamic parallel work rather than a fixed one-reviewer-per-change workflow.

Critique of “persona-based sub-agents”

The speaker criticizes sub-agent approaches that rely on predefined roles/personas (e.g., adversarial reviewer, security reviewer, explorer with markdown instructions).

They argue the “cool part” of agents is dynamic context-building, not hard-coded worker archetypes.

Dynamic workflows that create loops within loops

The speaker describes a workflow where:

  1. A thread creates PR(s)
  2. Another thread reviews the PR when filed
  3. A loop of review → fixes → re-review continues until approvals
  4. When ready, it merges and then triggers the next PR

Implementation detail

  • Uses a heartbeat that wakes every 5–10 minutes
  • It checks PR status / commit SHA changes
  • Creates review threads for new heads
  • Re-runs reviews after fixes
  • Updates progress against main

Concrete engineering example: performance/invalidation improvements (Lakebed)

They applied loops to refactor a component (“isolate layer” inside “Lakebed”) and received guidance about subscription invalidation performance, including proposals such as:

  • Dependency-aware invalidation
  • Mutation coalescing
  • Per-app invalidating batches
  • Shared results for identical subscription arguments
  • Back-pressuring maximum refresh frequency

They asked whether all changes could be done in one PR; the agent responded:

  • It’s too large for one PR → split into at least three PRs (mostly stacked, with some parallelization opportunities)

The speaker notes the loop created HTML plans, then spawned threads to implement parts sequentially.

Practical workflow advice: when humans should intervene

They recommend shifting human involvement to later stages:

  • Let agents build, run tests/dev server, commit/push, open PR
  • Then handle code review feedback automatically via loops

A “spicy” warning:

If humans read code before review feedback is incorporated, they may be wasting time—agents can fix issues without early human intervention.

Tooling mentioned (features relevant to looping)

Codex

  • Can spin up new threads
  • Supports a “goal” primitive for long-running/never-ending tasks (checked each turn whether the goal is done)

Claude Code

  • Used with Opus to generate multi-step workflows from feedback

Hermes agent

  • Used to provide context

Magic Patterns (sponsor)

Not directly about agent loops, but about AI design workflow:

  • A design system selector using existing stacks (e.g., shadcn/chakra/mantine/MUI)
  • Can import from Figma
  • Has an auto-router that can retrieve real SVGs
  • Includes commenting on screen, a visual editor, and frame/device previews

Review productivity + failure modes

The speaker reports loop autonomy can go wrong and become token-expensive:

If it’s going down the wrong path, it might go down that wrong path longer.

They cite a case where an agent spent hours running an automated workflow based on small feedback, reaching millions of tokens, emphasizing the need to manage loop scope and cost.

Cost/token guidance

Main cost point

  • Looping burns far more tokens than single-shot prompting.

Personal usage claim

  • They stayed well under weekly caps on a $200 plan despite multiple heavy loops.
  • Another setup (Claude Code + Opus 4.1 on a $100 plan) hit a 5-hour limit quickly.

Advice

  • If expensive plans aren’t hitting limits, use loops more—treat limits as a challenge.
  • Loops likely aren’t suitable yet for strict production safety, but they’re great for “crazy” R&D tasks.

Main speakers/sources

  • Speaker: “Pete” (referenced as a key influence behind the “looping discourse”) The video narrator also discusses “Pete” and his earlier post as an influence.

  • Tools mentioned: Codex, Claude Code, Opus, Hermes agent

  • Sponsor: Magic Patterns
  • Related article referenced: Anthropic’s piece on recursive self-improvement

Original video