The world of AI gets ‘loopy’

On Friday, Claude Code creator Boris Cherny made an appearance at Meta’s @Scale conference and, surprisingly, the first question from the audience was about loops.
“Are the loopholes just the next hype cycle,” begs the question, “or are they really real?”
Cherny’s response was emphatic, “Yes, they really are.”
“Two years ago, we wrote the source code by hand. We started changing to have agents write the code. And now we’re transitioning to the point where agents are telling agents to write code,” he continued. “Although the step from source code to agents was big, the loopholes are very important and a big step.”
Later in the speech (around the 32:00 mark in the YouTube video posted above), Cherny elaborated on the pitfalls he continues to use in his work. One agent is always looking for ways to improve code structure, while the other looks for redundant shortcuts that can be combined. They submit pull requests like any other code, and since the code is constantly changing, they never stop working.
It’s a powerful idea, especially with a figure as important as Cherny behind it. By switching to agent AI, the focus of many users is controlling their agents as much as possible: establish clear goals, check different units of progress, and don’t let them stray too far beyond information. The loop takes it a step further by authorizing a multitude of agents to work continuously in the background, endlessly. It’s a lot of trust to put in AI – but as the models are getting better faster, it could be the next step to make AI handle the real work.
The first thing to note is that this is not entirely new. Recursive loops – functions that call themselves to repeat an action, and the condition that stops the loop – are a mainstay of computer science courses. These loops follow indeterminate logic — that is, the subagent chooses when to stop the loop instead of a clear state — but the same basic mechanism applies. As soon as programmers started using AI to complete tasks, some version of a repeating loop, with AI supervising AI, would emerge.
Unlike a classical computer, agent loops can be incredibly simple. One of the most popular tricks is the Ralph Loop (named after Ralph Wiggum), which summarizes all the work the model has done and asks if it has achieved its goal. It’s a way to deal with AI models that get lost as they run too long – essentially bouncing the model back and forth until the job is done.
Another way to think about loops is as part of a general push to integrate more testing time. As OpenAI researcher Noam Brown observed earlier this month, modern models can solve almost any problem if you throw it at them enough. That said, one way to ensure that the problem is solved is to keep throwing the computer at it until it goes away. That’s especially true for hill-climbing problems like code base optimization, where the model can keep making incremental improvements until it reaches a certain threshold. Or, as in Cherny’s example, it can continue to make incremental improvements as long as there is a premium to spend on it.
If that sounds expensive, it is. Like agent AI before it, AI loops burn in tokens much faster than simple Q&A conversations – and because the point is to keep the loop running all the time, there’s no room for how much you can spend. That’s great for Anthropic, which is ultimately in the business of selling tokens, but for everyone else, it could be an expensive way to operate.
However, depending on the problem the agent loop is trying to solve, and the right setup that allows monitoring of token waste, drift, and other classic AI problems, the benefits can be bad enough to outweigh the costs.
If you shop through links in our articles, we may earn a small commission. This does not affect our editorial independence.



