Skip to main content
Back

Everything to know about loop engineering and “loopmaxxing”

The top AI engineers aren't prompting anymore, they're designing loops. Here's how to build them without burning your A

June 14, 2026

Hey,

The biggest names in AI engineering, including the creators of OpenClaw and Claude Code, are done with prompting and moved on to the next architectural paradigm: loop engineering.

However, designing an autonomous loop is easy. Controlling it is not. Without guardrails, "loop engineering" quickly devolves into "loopmaxxing," a chaotic trap that burns through millions of API tokens and leaves your repository filled with unmaintainable code.

Today, we break down the anatomy of a perfect AI loop, and how to stop your agents from bankrupting your API budget.

Author photo
Today's Author
Ben Dickson is a veteran software engineer and former CTO known as the "Engineer's Journalist" for translating technical AI research into practical, production-focused insights. He is a lead contributor to TechCrunch and VentureBeat.
From Weights & Biases
Many organizations have AI policies, but far fewer have a practical way to decide whether an agent is ready for production, who signs off, and how that decision gets documented.

This guide shows how leading enterprises connect evaluations, traces, human review, and approval workflows into an auditable record of deployment readiness.
Sunday Deep Dive
All about loop engineering (including the pitfalls)

Last week, OpenClaw creator Peter Steinberger posted a sharp directive for developers: "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."

The sentiment echoed something said by Boris Cherny, the Anthropic engineering lead behind Claude Code: “I don't prompt Claude anymore. I have loops that are running. They're the ones prompting Claude and figuring out what to do. My job is to write loops.”

The best AI engineering skill is no longer crafting a perfect LLM prompt but engineering loops with LLMs at their heart. However, as developers rush to embrace this architectural upgrade, a dangerous anti-pattern is emerging.

When applied recklessly withoudt deterministic exit conditions, loop engineering turns into "loopmaxxing," a trap that burns massive API credits while degrading system observability. Building an autonomous workflow without understanding the underlying mechanics guarantees structural failures in production.

What is loop engineering?

Loop engineering shifts a model from a static call-and-response tool to an active participant in an event loop. Instead of feeding an agent step-by-step instructions, developers give the system a verifiable goal. The loop runs an agent that observes the current state, chooses an action, executes it, checks the result, and decides whether to continue, retry, or stop entirely.

There are different definitions what an AI loop needs, but I mostly agree with the primitives proposed by Google engineer Addy Osmani (with a bit of simplification):

  • Automations: The trigger that starts the loop, such as a scheduled cron job or a /goal command.
  • Worktrees: Isolated branch environments that ensure parallel sub-agents do not overwrite each other's code.
  • Skills and external tools: Markdown files with persistent project guidelines and integrations (e.g., MCP servers) that give your agents access to external tools like Jira, GitHub, or internal databases.
  • Sub-agents: Specialized models dividing the labor. One agent drafts the code, while a separate evaluator grades the output against a strict rubric.
  • Memory: External tracking systems, such as a Linear board or progress file, because LLMs eventually clear out their context windows.

For example, a simple version of this loop structure can read the previous day’s CI failures, assign an agent to create a draft fix, and run tests. If the tests pass, it opens a pull request.

alpha_signal_image_1

When executed well, loop engineering can produce impressive results. For instance, early iterations of this concept were seen in Andrej Karpathy's autoresearch project, a lightweight Python loop that successfully ran machine learning experiments overnight without human intervention.

The trap: why loopmaxxing is the new tokenmaxxing

Despite their benefits, AI loops come with caveats and pitfalls. Much like "tokenmaxxing" (the brute-force approach of giving models massive inference budgets or sampling thousands of responses to force a good answer), "loopmaxxing" replaces thoughtful software architecture with open-ended “while(true)” iteration.

The underlying assumption is that an agent will eventually figure out the correct solution if it runs long enough. However, AI loops need to verify success, such as passing unit tests, compiling successfully, or returning a specific zero-exit status code.

If a loop is assigned a fuzzy goal, such as "refactor this feature to be better" or "optimize the layout," the agent will engage in infinite drift. Without strict exit conditions, an agent reviewing its own sub-agents will spin into endless retries, optimizing for hallucinated metrics.

When an agent loops through retries, failed tool calls, and context reconstruction, it burns through millions of tokens. Developers end up billing for memory and context that a human engineer naturally retains.

alpha_signal_image_2

This hands-off approach also creates a severe accumulation of comprehension debt. As the autonomous loop ships code rapidly in the background, the gap widens between the repository's state and the human engineer's understanding of how that code operates.

When a failure eventually occurs in production, debugging an autonomous loop's output becomes an observability nightmare. Developers find themselves staring at thousands of lines of unfamiliar logic, lacking the mental context of why the agent chose a specific implementation path after dozens of iterations.

The pragmatic path

The most effective loop engineers do not write open-ended agentic cycles. Instead, they build strict control loops. In these setups, developers write the desired state and the observation mechanism, while deterministic code handles the execution and API calls.

The LLMs step is only for dynamic decisions that traditional code cannot handle. By wrapping repetitive or risky parts of a workflow with memory and hard-coded checks, you limit the blast radius of a hallucinating model.

Naturally, coming up with all the checks and controls for your AI loop can be very tiresome and challenging, especially at the beginning of a project.

So I recommend starting by designing a minimal loop with human verification. Once you run the loop several times, you get a feel of what’s working and not, what can be improved through prompt and context engineering and what needs deterministic guardrails and design in the loop itself.

Once the workflow is proven manually, parts of the process can be gradually automated. As you identify the exact steps the agent gets right consistently, replace the LLM prompts for those specific steps with standard code.

To maintain observability and control, have separate agents in the loop to perform the task and check the results. An agent looping over its own flawed logic has a high tendency to reinforce its mistakes rather than fix them.

Production loops also require trace-logging to monitor agent reasoning, progress detection to terminate the run if the agent is stuck, and strict iteration caps. You should explicitly determine when you need to hand over control to a human engineer.

A robust rule of thumb is to allow a maximum of two or three retries before failing gracefully and handing the error back to a human developer.

No shortcuts in software architecture

Loop engineering provides a powerful paradigm for scaling engineer intent across a codebase. It automates the tedious processes of verifying, testing, and iterating on generated code. However, it is not a silver bullet and requires architectural discipline.

Cognitive surrender remains the most significant risk in the current AI era. Building a system designed specifically so you never have to think about your codebase again is a recipe for disaster.

No amount of infinite iterations or compute budget will save an application built on a foundation of poor software architecture. Agents run loudly and fail quietly, meaning developers must remain vigilant engineers, not just prompt supervisors.

Sponsor Logo
The AI developer platform to build AI agents, applications, and models with confidence.
Learn More →
At Alpha Signal, our mission is to build a sharp, engaged community focused on AI, machine learning, and cutting-edge language models, helping over 200,000 developers stay informed and ahead. We’re passionate about curating the best in AI, from top research and trending technical blogs to expert insights and tailored job opportunities. We keep you connected to the breakthroughs and discussions that matter, so you can stay in the loop without endless searching. We also work closely with partners who value the future of AI, including employers and advertisers who want to reach an audience as passionate about AI as we are.

Our partnerships are based on shared values of ethics, responsibility, and a commitment to building a better world through technology.Privacy is a priority at Alpha Signal. Our Privacy Policy clearly explains how we collect, store, and use your personal and non-personal information. By using our website, you accept these terms, which you can review on our website. This policy applies across all Alpha Signal pages, outlining your rights and how to contact us if you want to adjust the use of your information. We’re based in the United States. By using our site, you agree to be governed by U.S. laws.
Looking to promote your company, product, service, or event to 250,000+ AI developers?
Work with us