Moving From Prompting Agents to Orchestrating Agentic Loops
Theo - t3.gggo watch the original →
the gist
Stop manually prompting agents for every step; instead, design dynamic loops where agents audit their own work, manage sub-threads, and iterate until they reach a high-quality result without human intervention.
The Shift from Manual Prompting to Autonomous Loops
Modern development with AI has evolved from simple copy-pasting of chatbot outputs to direct IDE integration, and now to autonomous agentic loops. The core insight is that developers should stop acting as the 'glue' between agent tasks. Instead of manually reviewing every step, developers should design systems where agents audit their own code, generate feedback, and trigger re-runs. This allows for complex, multi-stage tasks—like large-scale refactors—to be completed with minimal human oversight.
Designing Dynamic Workflows
Rather than relying on hard-coded personas (e.g., 'security reviewer' or 'adversarial agent'), which often fail to adapt to specific codebase needs, developers should leverage dynamic agentic orchestration. In this model, the agent assesses the problem, breaks it into logical PRs, and creates sub-threads to handle specific tasks. By using tools like Claude Code, an agent can be instructed to monitor PR comments, address feedback, and even spin up new threads to review its own work. This creates a recursive improvement loop where the agent manages the entire lifecycle of a feature from implementation to final approval.
The Trade-offs: Cost and Complexity
While powerful, this approach is not without risks. The primary concern is token consumption. Recursive loops can lead to 'runaway' processes where agents spend millions of tokens on minor fixes. However, the author notes that with the right subscription tiers (e.g., $200/month plans), the efficiency gains often outweigh the costs. The biggest challenge is 'psychosis'—the risk of agents breaking the codebase if they are left unattended for too long. The author suggests starting with non-critical tasks to understand the agent's behavior before applying these loops to production environments.
Rethinking the Developer Role
If a human is reading code before another agent has reviewed it, they are likely wasting time. The goal is to move the human's involvement to the end of the chain. By the time the developer looks at the code, the agent should have already handled the 'bullshit'—the trivial errors and formatting issues—leaving only the high-level architectural decisions for the human. This shift transforms the developer from a manual coder into a system architect who defines the 'shape' of the work and the constraints of the loop.