{"slug": "how-to-use-loops-in-claude-code", "title": "How to use loops in Claude Code", "summary": "To use loops in Claude Code, an AI coding tool, to automate prompting and enable agents to perform long tasks in parallel. It describes loops as recursive goals that iterate until a purpose is met, with an orchestrator agent spinning off subagents. The piece argues that understanding loops can boost developer productivity, though it rejects claims that loops represent a new paradigm of software development.", "body_md": "# How to use loops in Claude Code\n\n### The internet won't shut up about /loop in Claude Code. I'll show you why\n\nEveryone 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.\n\nI 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.\n\nMaking 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.\n\nIn today’s edition, I’ll show you:\n\nWhat a loop is\n\nWhat makes up a loop\n\nHow to make a loop in Claude Code (with example prompts)\n\nHow loops can make you more productive\n\n*After this intro section, the rest of this newsletter is exclusive for paid subscribers.*\n\n*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.*\n\n## What is a loop?\n\nEven the OpenClaw guy is pushing loops now\n\nThis post is actually pretty explanatory for loops.\n\nLoops prompt themselves to write code so that agents can do long tasks in parallel without much involvement from you.\n\nOne 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.\n\n## What makes up a loop?\n\nLoops are essentially recursive goals where you define a purpose and the agent iterates until it meets that purpose/goal.\n\nSound familiar? Maybe you read the newsletter’s posts on /goal:\n\nIn fact, Anthropic calls goals “goal-based loops”:\n\nGenerally speaking, a loop needs 4 things:\n\nA goal (scope of what you want agents to do)\n\nContext (don’t let your agents fly blind!)\n\n## Keep reading with a 7-day free trial\n\nSubscribe to The AI-Augmented Engineer to keep reading this post and get 7 days of free access to the full post archives.", "url": "https://wpnews.pro/news/how-to-use-loops-in-claude-code", "canonical_source": "https://www.augmentedswe.com/p/claude-code-loops", "published_at": "2026-07-13 11:10:13+00:00", "updated_at": "2026-07-13 11:37:06.757759+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models"], "entities": ["Claude Code", "Anthropic", "OpenClaw"], "alternates": {"html": "https://wpnews.pro/news/how-to-use-loops-in-claude-code", "markdown": "https://wpnews.pro/news/how-to-use-loops-in-claude-code.md", "text": "https://wpnews.pro/news/how-to-use-loops-in-claude-code.txt", "jsonld": "https://wpnews.pro/news/how-to-use-loops-in-claude-code.jsonld"}}