AI agent loops: The next step beyond prompting for coding tasks
Since the launch of ChatGPT in 2022, interacting with artificial intelligence has largely meant writing prompts. Users type a request, add context, and the AI generates a response. Prompt engineering became a valuable skill: better prompts led to better outputs.
Now, a new approach called loop engineering is emerging. Instead of humans typing prompts for each task, developers design recurring systems where AI agents work autonomously in cycles until a goal is met. This reduces the need for manual prompting.
Several AI experts advocate for this shift. Boris Cherny, head of Anthropic's Claude Code, said he no longer writes prompts himself. “It’s an agent that prompts Claude. I don’t write the prompt anymore. Claude writes the prompt, and now I’m talking to that new Claude that is kind of coordinating,” he told CNBC. He added that loops represent the kind of work he would be proudest of in a decade.
Peter Steinberger, an OpenAI engineer and creator of the OpenClaw project, posted on X: “Here’s your monthly reminder that you shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.”
Addy Osmani, director at Google Cloud, wrote that the days of directly prompting AI coding tools are “kind of over.” He explained: “Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead … I believe this may be the future of how we work with coding agents.”
What are AI agent loops?
A loop is a recurring system that guides AI agents so the user does not have to constantly write prompts. As Osmani puts it: “You let that system poke the agents instead of you.” Each loop typically includes five key components:
- Automations: Enable the loop to repeat on a schedule, allowing agents to do discovery and triage independently.
- Worktrees: Allow two AI agents to work in parallel without overlapping.
- Skills: Instructions that help the agent know project knowledge it might otherwise guess.
- Plugins and connectors: Give agents access to existing tools.
- Sub-agents: Let users assign one agent to generate ideas and another to check the work.
Osmani also mentioned memory as a sixth component. He advised storing information like what has been done and what is next in a markdown file or Linear board, because “the model forgets everything between runs so the memory has to be on disk and not in the context.”
How are loops used by developers?
One example is the /goal loop, which instructs a coding agent like Claude Code or OpenAI’s Codex to keep working until a task is completed. This eliminates the need for repeated prompting at each step.
While prompt engineering is still relevant, loop engineering marks a shift toward more autonomous AI workflows. Developers are encouraged to design systems that manage agents, reducing direct human intervention over time.