How to Use Four Claude Code Loops for Better Output

19.0K views
•
July 12, 2026
by
Dream Labs AI
YouTube video player
How to Use Four Claude Code Loops for Better Output

TL;DR

Use Claude Code loops to repeat work until a verification, score, schedule, or proactive trigger says the task is complete. Turn-based loops check work before responding, goal-based loops iterate toward measurable targets, time-based loops run on schedules, and proactive loops initiate work from ongoing context instead of waiting for another manually typed prompt.

Transcript

The the thing that I've been finding myself using more and more is a loop. So, this is /loop and it's just like the coolest thing. It's like the simplest thing that works. >> Boris Journey, the creator of Claude code, just introduced a brand new way of building with AI that people cannot stop talking about. Loops. Prompting Claude like a pleb by ty... Read More

Key Insights

  • A Claude Code loop is an AI agent that repeats a cycle of work until a defined stop condition is met. The four loop categories presented are turn-based, goal-based, time-based, and proactive, with each category using a different condition to continue or conclude work.
  • A turn-based loop verifies completed work before returning its response. In the landing-page example, a verification skill directs Claude to inspect the page in a browser, confirm that requested functions work, identify defects, fix them, and only then report completion to the user.
  • Verification skills can test requirements beyond basic software functionality. They can check whether an output matches a preferred aesthetic, uses the correct prices or rates, contains accurate calculations, and incorporates every supplied reference instead of relying on only a subset of the available materials.
  • A goal-based loop continues revising work until it meets a measurable target. The website example asks Claude to improve a homepage until Google Lighthouse gives it a score of at least 90, using feedback from unsuccessful evaluations to guide each subsequent iteration.
  • Custom evaluation cartridges can score written content against defined criteria. The Humanify cartridge evaluates voice, variety, and predictability to judge whether an email sounds human, while other described cartridges assess marketing characteristics or predict an email’s likely open-rate performance from historical audience data.
  • Multiple evaluation cartridges can be combined into a single stopping condition. The presented email workflow combines Humanify, Hormozi AI, and open-rate assessments, then instructs Claude to keep improving the content until its combined Claude Evaluator score reaches the specified threshold.
  • A time-based loop runs a task at a stated interval or scheduled time. Examples include checking a public repository every five minutes to address review comments and failing continuous integration, or processing a team meeting transcript every day at 9:00 a.m.
  • A proactive loop allows Claude to begin useful work from continuing context rather than waiting for a new typed prompt. The described application watches competitors, identifies strong content, and recreates relevant material in the user’s voice as part of an autonomous content-creation workflow.

Explore YouTube Video Summarizer or Get YouTube Transcript Extractor

Questions & Answers

Q: What is a Claude Code loop?

A Claude Code loop is an AI agent repeating a cycle of work until a stop condition is met. Instead of producing one response immediately after receiving a prompt, Claude can verify a result, evaluate it against a target, rerun it on a schedule, or initiate another action from context. The four presented categories are turn-based, goal-based, time-based, and proactive loops.

Q: How do turn-based loops verify Claude Code’s work?

A turn-based loop adds a verification step before Claude returns its final response. In the demonstrated workflow, a skill file called through the verify front-end command instructs Claude to build a landing page, inspect it in a browser, and confirm that its requested features function correctly. The verification process found and fixed one real bug before Claude reported that the work was complete.

Q: What requirements can a Claude Code verification skill check?

A verification skill can check more than whether a website technically functions. The examples include confirming that an output follows a preferred aesthetic, uses known prices or rates, contains correct calculations for accounting or invoicing, and uses every resource supplied with the task. A user can ask Claude to adapt an existing verification skill into a reusable skill for one of these specific requirements.

Q: How do goal-based loops improve an output?

A goal-based loop evaluates work against a measurable target and continues revising it until that target is reached. One example asks Claude to improve a homepage until its Google Lighthouse score reaches at least 90. If the score is too low, Claude uses the evaluation feedback to modify the page, tests it again, and repeats the process before notifying the user.

Q: What is the Humanify cartridge used for?

The Humanify cartridge is an evaluation algorithm designed to determine whether an email or another piece of writing sounds human rather than artificial. It analyzes voice, variety, and predictability, then assigns a human score. In the example, Claude receives a goal of at least nine out of ten and repeatedly rewrites the email from the cartridge’s feedback until the score satisfies that condition.

Q: How can multiple scoring cartridges be combined in one loop?

Multiple cartridges can contribute to one combined stopping condition for a goal-based loop. The demonstrated setup joins Humanify, Hormozi AI, and an open-rate cartridge in a Claude Evaluator. Claude then continues improving an email or other content until it reaches the specified combined score. This lets one iterative workflow assess human tone, marketing qualities, and predicted audience response together.

Q: How do time-based loops work in Claude Code?

A time-based loop runs a prompted task at a specified interval or scheduled time. The source gives an example that checks a public repository every five minutes, addresses review comments, and fixes failing continuous integration. Another example runs daily at 9:00 a.m. and processes a team meeting transcript, allowing recurring work to continue without manually submitting the same prompt each time.

Q: What makes proactive loops different from scheduled loops?

A scheduled loop repeats work because a specified time or interval has arrived, while a proactive loop uses continuing context to initiate useful work without waiting for another manually typed prompt. The described proactive setup can watch competitors, recognize their strongest content, and recreate relevant material in the user’s voice. Time-based behavior can also be incorporated within the broader proactive setup.

Summary & Key Takeaways

  • A Claude Code loop is an AI agent repeating a cycle of work until a stop condition is satisfied. The four presented types are turn-based, goal-based, time-based, and proactive loops. Together, they shift the workflow from issuing isolated prompts toward defining checks, measurable outcomes, schedules, and contextual triggers for repeated autonomous work.

  • Turn-based loops verify a result before presenting it, while goal-based loops repeatedly improve an output until it reaches a specified threshold. Examples include testing a landing page in a browser, fixing functional defects, improving a Lighthouse score to at least 90, or revising an email until custom evaluation cartridges award acceptable scores.

  • Time-based loops execute prompts at specified intervals, such as checking a public repository every five minutes or processing a team meeting transcript daily at 9:00 a.m. Proactive loops go further by allowing Claude to initiate context-aware work itself, including monitoring competitors and recreating useful content in the user’s established voice.


Read in Other Languages (beta)

Share This Summary 📚

Explore More Summaries from Dream Labs AI 📚