The AI-Augmented Engineer
The AI-Augmented Engineer

The AI-Augmented Engineer

How to use loops in Claude Code

The internet won't shut up about /loop in Claude Code. I'll show you why

Jeff Morhous
Jul 13, 2026
∙ Paid

Everyone who uses AI to write code seems to be talking about loops over the last month. I’m even hearing it’s the next paradigm of software development.

Diagram explaining loops in Claude Code, including showing when to use /loop, when to use /goal, and when to use /schedule to create a loop

I don’t think that’s true, but I do think understanding loops and how to use them in Claude Code has the potential to make you more productive. Initially, they may sound intimidating because people are hyping up a relatively straightforward automation concept.

Making loops is essentially replacing yourself as the person who prompts the agent. When you make a loop, you make a system that prompts the agent.

In today’s edition, I’ll show you:

  • What a loop is

  • What makes up a loop

  • How to make a loop in Claude Code (with example prompts)

  • How loops can make you more productive

After this intro section, the rest of this newsletter is exclusive for paid subscribers.

I’d love to have you join us as a paying member of the newsletter - you’ll get access to this article along with the entire Member Vault.

What is a loop?

Even the OpenClaw guy is pushing loops now

Screenshot of an X post from Peter Steinberger explaining that loops are the future of software development

This post is actually pretty explanatory for loops.

Loops prompt themselves to write code so that agents can do long tasks in parallel without much involvement from you.

One important concept that makes loops powerful is the idea that an agent can have its own agents. An orchestrator agent can perform the loop and spin off subagents to actually accomplish a task.

What makes up a loop?

Loops are essentially recursive goals where you define a purpose and the agent iterates until it meets that purpose/goal.

Sound familiar? Maybe you read the newsletter’s posts on /goal:

How to use goals to implement a new project

How to use goals to implement a new project

Jeff Morhous
·
Jun 4
Read full story
The ultimate guide to Codex goals

The ultimate guide to Codex goals

Jeff Morhous
·
Jun 2
Read full story

In fact, Anthropic calls goals “goal-based loops”:

Loops in Claude Code using goals

Generally speaking, a loop needs 4 things:

  1. A goal (scope of what you want agents to do)

  2. Context (don’t let your agents fly blind!)

Keep reading with a 7-day free trial

Subscribe to The AI-Augmented Engineer to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2026 Jeff Morhous · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture