History of Loop Engineering
From Prompt Engineering in 2022 through Agentic Workflows to the formalization of Loop Engineering in 2026.
Loop Engineering did not emerge overnight. It evolved through a series of paradigm shifts in how developers work with AI -- from crafting single prompts to designing autonomous iterative systems. Each era built on the last, and each shift was driven by the recognition that the previous approach had hit a structural ceiling.
This timeline traces the key milestones, real tools, and documented ideas that produced Loop Engineering as a formal discipline.
Timeline Overview
| Period | Era | Key Development |
|---|---|---|
| Late 2022 | Foundation | ChatGPT launch; LLMs go mainstream |
| 2023 | Prompt Engineering | Systematic prompt optimization techniques |
| Q1 2023 | First Agents | AutoGPT, BabyAGI, CAMEL -- autonomous agent experiments |
| 2024 | Agentic Workflows | LangChain, CrewAI, AutoGen -- structured agent frameworks |
| 2024 Q4 | Coding Agents | Devin, Cursor -- AI agents that write and fix code |
| 2025 | Context Engineering | Tobi Lutte and Karpathy popularize context engineering |
| Early 2025 | Agent Engineering | Claude Code, Codex CLI -- production coding agents |
| Mid 2025 | Harness Engineering | The agent harness concept -- environment, tools, constraints |
| June 2026 | Loop Engineering | Steinberger, Osmani, and Cherny name and formalize the discipline |
2022: The Foundation -- ChatGPT and Tool-Use
The story begins in November 2022 with the launch of ChatGPT, which brought LLMs to mainstream developer attention. In early 2023, major providers introduced function calling and tool-use capabilities:
- OpenAI released function calling in the Chat Completations API, allowing models to invoke external functions
- Anthropic introduced tool-use in the Claude API for structured interactions with external systems
Before tool-use, the AI-human interaction was strictly conversational -- a model generated text, and that was it. With tool-use, models could take actions in the world: read files, run commands, query databases, call APIs. This was the first prerequisite for everything that followed.
2023: The Prompt Engineering Era
Throughout 2023, Prompt Engineering became the dominant paradigm for working with LLMs. Developers and researchers developed systematic techniques for optimizing model outputs:
- Chain-of-thought prompting (Wei et al., January 2023)
- Few-shot learning and in-context examples
- Role prompting and system message design
- Self-consistency and ensemble approaches
Prompt Engineering was genuinely powerful, but it had a clear ceiling. A perfectly phrased prompt still could not verify its own output, could not take actions in the real world, and could not improve across iterations without human intervention.
This limitation became visible at scale. Traditional prompt-based workflows routinely sent 20,000+ tokens per request, but enterprise research showed that up to 95% of that context was irrelevant to the task at hand. The token waste was not just a cost problem -- at Claude 3.5 Sonnet pricing of $3.00 per million input tokens (Anthropic official pricing) -- it was a signal-to-noise problem that undermined model performance.
Q1 2023: The First Autonomous Agents
In March-April 2023, a wave of autonomous agent projects demonstrated that LLMs could drive multi-step workflows:
These projects proved a critical concept: LLMs could drive autonomous, multi-step workflows. But their limitations -- infinite loops, context overflow, no reliable verification -- made it clear that building individual agents was not enough. The frameworks around them needed engineering.
2024: The Agentic Workflow Era
The limitations of early autonomous agents led to structured frameworks with real GitHub presence and production adoption:
- LangChain (github.com/langchain-ai/langchain) -- Provided a robust Python framework for building tool-using agents with memory and planning capabilities. Its
create_agentfunction gave developers a working agent loop: pick a model, plug in tools, and the agent calls tools iteratively until the task is complete. - LangGraph (github.com/langchain-ai/langgraph) -- Built on top of LangChain to provide graph-based agent orchestration, enabling developers to define complex multi-step workflows as state machines.
- CrewAI (github.com/crewAIInc/crewAI) -- Introduced multi-agent collaboration patterns where specialized agents with different roles work together on complex tasks.
- AutoGen (github.com/microsoft/autogen) -- Microsoft's framework for conversational multi-agent systems with human-in-the-loop capabilities.
- MetaGPT (github.com/geekan/MetaGPT) -- A multi-agent framework with 45K+ GitHub stars that assigns specialized roles (product manager, architect, engineer, QA) to different agents working in concert.
This era established patterns that would later become Loop Engineering principles: agent memory (a precursor to state persistence), planning and reasoning (the "Plan" step in the agent loop), and tool orchestration (structured execution).
Late 2024: The Rise of Coding Agents
Late 2024 saw the emergence of AI coding agents that demonstrated loops handling complex software engineering tasks:
- Devin (github.com/cognition-labs/Devin) -- Launched by Cognition AI in March 2024, Devin was billed as the world's first fully autonomous AI software engineer. It could plan, write, test, debug, and ship production code autonomously in isolated cloud environments. This was Loop Engineering in practice, even though the term did not yet exist.
- Cursor (cursor.com) -- Agent mode with multi-file editing became the dominant IDE-based approach. Cursor's growth validated the demand for agentic coding tools that operate in loops: edit code, run tests, read errors, fix bugs, repeat.
- Aider (github.com/paul-gauthier/aider) -- A Git-first CLI AI coding tool that accumulated 30K+ GitHub stars by letting developers pair-program with LLMs directly in the terminal. Aider's workflow --
aider --model claude-3.5-sonnet-- demonstrated that CLI-based agentic coding was viable for production work. - OpenHands (github.com/All-Hands-AI/OpenHands, formerly OpenDevin) -- An autonomous coding agent platform that provided a research-oriented alternative to commercial tools, with a Docker-based sandbox for safe code execution.
2025: Context Engineering and Agent Engineering
Context Engineering (Early-Mid 2025)
The focus shifted from the words in a prompt to everything the model sees at inference time. This transition was crystallized by two influential endorsements in June 2025:
- June 18, 2025 -- Tobi Lutte (Shopify CEO) wrote on X: "I much prefer the term 'context engineering' over 'prompt engineering.'" His post argued that the real work was providing all the context needed for a task to be plausibly solvable.
- Andrej Karpathy (former Tesla AI director, OpenAI founding team) endorsed it on the same thread, calling context engineering "the hottest new programming language" and defining it as "the delicate art and science of filling the context window with just the right information for the next step".
Prompt Engineering became a subset of Context Engineering. The unit of work had moved from the prompt to the context window.
Agent Engineering (Mid-Late 2025)
Two production tools defined this era:
Claude Code (github.com/anthropics/claude-code, docs at code.claude.com/docs) -- A terminal-based AI coding agent from Anthropic with integrated tool-use (file reading/writing, command execution, code editing), built-in evaluation through testing and verification, state persistence across interactions, and the /goal command for running until a verifiable condition is met. Claude Code's design demonstrated that the key to reliable AI systems was better loop architecture, not better prompts.
Codex CLI (github.com/openai/codex) -- OpenAI's official CLI agent providing similar capabilities with an Automations tab for scheduled tasks, built-in worktree support for parallel agents, sub-agents as TOML configurations, and matching /goal functionality.
The broader ecosystem expanded rapidly:
- Cline (github.com/cline/cline) -- A VS Code plugin with MCP protocol support, bringing agentic coding directly into the IDE
- Continue.dev (continue.dev) -- An open-source AI code assistant for VS Code and JetBrains
- SWE-Agent (github.com/princeton-nlp/SWE-Agent) -- A research-oriented software engineering agent with 15K+ GitHub stars, focused on resolving real GitHub issues end-to-end
Harness Engineering and the Ralph Wiggum Technique
Harness Engineering emerged as the concept describing the full environment around an agent -- scaffolding, tools, constraints, and feedback loops. Addy Osmani wrote about "agent harness engineering" as making the environment a single agent runs inside.
Research Patterns Matured
Several influential research patterns formalized during this period directly informed Loop Engineering:
- ReAct (Reason + Act, Yao et al., 2022, widely adopted 2025) -- Interleave reasoning and action steps so the model observes results before its next move
- Reflexion (Shinn et al., 2023, production use 2025) -- Added memory and self-critique: an Actor acts, an Evaluator scores the trajectory, and a Self-Reflection step writes lessons into episodic memory
- Evaluator-Optimizer (Anthropic's "Building Effective Agents", 2024) -- One model generates, a second evaluates against criteria, the two cycle until evaluation passes
- Orchestrator-Workers -- A central orchestrator breaks tasks into subtasks, delegates to worker sub-agents, and synthesizes results
June 2026: Loop Engineering Formalized
The term "Loop Engineering" crystallized around three key voices in a matter of days:
June 7, 2026 -- Addy Osmani: Google Cloud AI Director Addy Osmani published his landmark essay "Loop Engineering" (addyosmani.com/blog/loop-engineering/), giving the practice its name and a concrete anatomy. He defined Loop Engineering as "replacing yourself as the person who prompts the agent. You design the system that does it instead." The essay laid out five building blocks -- automations, worktrees, skills, connectors, and sub-agents -- plus external memory. Osmani's essay turned a viral take into a vocabulary people could build on.
June 7, 2026 -- Peter Steinberger: OpenAI engineer Peter Steinberger independently argued that the relevant skill was no longer prompting coding agents but designing the loops that prompt them. His contribution to the conversation reinforced that the shift was being observed across organizations, not just by one person.
June 16, 2026 -- LangChain: Published "The Art of Loop Engineering" (langchain.com/blog/the-art-of-loop-engineering), written by Sydney Runkle and building on swyx's concept of "loopcraft: the art of stacking loops." The post formalized the four-level loop stack:
- Agent loop -- Model calls tools until a task is complete
- Verification loop -- A grader checks output against a rubric, retries with feedback if it fails
- Event-driven loop -- External events trigger agent runs
- Hill climbing loop -- Traces from production runs feed an analysis agent that improves the harness
Boris Cherny's endorsement: The head of Claude Code at Anthropic reportedly summed up the shift: "I don't prompt Claude anymore. I have loops that are running. They're the ones that are prompting Claude and figuring out what to do." When the people building the most-used coding agents say they have stopped prompting by hand, the practice has moved from fringe to mainstream.
Agent Frameworks Converge on Loop Thinking
By mid-2026, the major agent frameworks had all converged on loop-based architectures, each offering distinct approaches:
- LangGraph provided graph-based orchestration for defining loop structures as state machines
- CrewAI enabled team-based multi-agent patterns where different agents run their own loops in coordination
- AutoGen supported conversational multi-agent loops with human-in-the-loop checkpoints
- smolagents (github.com/huggingface/smolagents) offered HuggingFace's lightweight agent framework with simplified loop primitives
- OpenAI Swarm (github.com/openai/swarm) provided lightweight multi-agent orchestration for handoffs between specialized agents
The Four-Layer Model
The Tosea.ai guide (tosea.ai/blog/loop-engineering-ai-agents-complete-guide-2026) captures the full progression as a nested model:
Prompt Engineering (2022-2023)
-- Context Engineering (2025)
-- Harness Engineering (2026)
-- Loop Engineering (2026)
Each layer wraps the previous one without replacing it. You still write prompts; you still curate context; you still build a harness. Loop Engineering is the layer where all of it gets put in motion.
Looking Forward
As AI models become more capable, the bottleneck continues to shift from model quality to system design. The trajectory is clear: companies that build learning loops early -- where human judgment and verification compound together -- build an advantage that is hard to replicate.
The documented case studies validate this. The Y Combinator team that set tasks at 11PM and woke to completed specs demonstrated that well-designed loops can work while you sleep. The token optimization research showed that loop-level decisions -- which model to use for which step -- matter more than per-prompt tweaking. The enterprise reports on context waste (95% irrelevant tokens) showed that the real engineering problem is not what to say to the model, but what to put in front of it at each loop iteration.
The future of AI engineering is not about writing better prompts. It is about building better loops.
Next Steps
- Understand Core Principles -- the design rules derived from this history
- Study the Agent Loop -- the execution pattern at the heart of every loop
- Compare Loop Engineering vs Prompt Engineering