Dan Luu’s ‘Agentic Loop’ Turns a Developer Into an AI Manager
A detailed breakdown of the five-step process for using Claude 3 Opus for coding, reframing the developer’s job from writing code to directing and verifying AI output. Dan Luu published a detailed,…
A detailed breakdown of the five-step process for using Claude 3 Opus for coding, reframing the developer’s job from writing code to directing and verifying AI output.
Dan Luu published a detailed, multi-step process for using large language models for programming, specifically referencing Claude 3 Opus. He calls it an "agentic loop," a method that reframes the developer's role from writing code to directing an AI to produce it. The process treats the LLM as a junior engineer, with the human developer acting as the manager and architect.
The entire appendix of his post, which details this method, was itself generated using the agentic loop. This provides a direct, verifiable artifact of the process's output.
The five-step agentic loop
Luu’s process is not a single prompt but a structured, iterative workflow. He breaks it down into five distinct steps, repeated for each component of the project.
- High-level plan: The human developer creates the initial architecture and goals.
- Detailed plan: The developer works with the AI to flesh out the high-level plan into a specific, step-by-step implementation guide.
- Code generation: The developer prompts the AI to write the code for one small part of the detailed plan.
- Testing: The generated code is immediately tested.
- Commit or debug: If the tests pass, the code is committed. If they fail, the developer and AI debug the issue, potentially returning to step 3 to regenerate the code.
The loop structure is central. It constrains the AI's work to small, verifiable chunks and ensures a human is validating every output before it's integrated.
Managing the AI as a junior engineer
The core mental model Luu proposes is delegation, not collaboration in the sense of pair programming. The human provides the context, the constraints, and the success criteria, much like a tech lead assigning a ticket. The AI executes the implementation.
This requires a shift in prompting. Instead of asking for a single function, the developer provides the AI with the relevant context from the larger application, the detailed plan for the specific task, and clear instructions. Luu's account suggests this managerial overhead is traded for a significant increase in implementation speed for discrete tasks.
The artifact is the proof
Luu reports using this exact process to create the appendix for his blog post. The task involved generating HTML, CSS, and JavaScript from a text description. By making the process the subject of its own output, he provides a concrete example of what the agentic loop can produce. This self-referential demonstration serves as the primary evidence for the technique's viability.
What We'd Change
This playbook requires an expert user
The analogy of the AI as a junior engineer has a critical implication. A junior engineer cannot effectively manage another junior engineer. Luu’s process is potent because he is an experienced developer who can create a sound high-level plan and, crucially, accurately evaluate the AI’s output.
A novice programmer attempting this loop would likely struggle to identify subtle flaws in the generated code or create a sufficiently robust architectural plan. The playbook’s effectiveness is therefore highly dependent on the skill level of the human operator.
Model-specific and potentially brittle
The entire workflow is tuned to the capabilities of Claude 3 Opus as of early 2024. Luu notes its proficiency in following instructions and handling large contexts. This same process may yield different results with other models like GPT-4 or open-source alternatives.
As models evolve, the specific prompting techniques and even the structure of the loop may need to be completely reworked. This is not a timeless development methodology but a snapshot of a state-of-the-art workflow for a specific generation of AI.
Unproven on complex, brownfield projects
The example task, generating a self-contained blog appendix, is ideal for this approach. It is a greenfield project with well-defined boundaries. Applying this agentic loop to a large, existing codebase with years of technical debt and complex interdependencies presents a much greater challenge.
The context window of the LLM is a hard limit. Feeding an entire production monolith into a prompt is not feasible. The playbook is best suited for new features, isolated components, or new projects where the AI does not need to understand a vast pre-existing system.
Landing
Luu’s agentic loop is not a path to fully autonomous software development. It is an operational framework for leveraging current AI. The model redefines the senior developer's role, shifting effort from line-by-line implementation to architectural planning, prompt engineering, and rigorous verification. The leverage comes from successfully managing an AI agent, not from replacing the developer. For founders and small teams, this presents a pathway to increasing output, provided the human in the loop has the expertise to be an effective manager.
The investor read
This playbook signals a significant shift in developer leverage. A single, highly-skilled engineer using an agentic process can potentially achieve the output of a small team, altering the capital efficiency calculations for early-stage software companies. This reduces the need for large junior-heavy engineering teams and places an even higher premium on senior talent capable of architectural thinking and AI management. For investors, this means evaluating a founding team's ability to leverage these new workflows is as important as their raw headcount. The market for tools that streamline these agentic loops—better testing frameworks, context-aware IDEs, and specialized agents—is a clear area for investment. This is a deliberate, bootstrapped productivity play, not a venture-scale product itself.
Pull quote: “The loop structure is central. It constrains the AI's work to small, verifiable chunks and ensures a human is validating every output before it's integrated.”
Every claim ties to a primary source. See our methodology.