Claude Code

Claude Code /goal vs /loop: when to use which

/goal is an inner loop that runs one task until a condition is met. /loop is an outer loop that runs a prompt on a schedule. Combine them to build loop engineering in Claude Code.

9 min · 2026-06-22 · Watch on YouTube

The main idea

Some people hear /loop and think that is all of loop engineering. Others see /goal and ask if it is already a loop. It is. /goal is a different kind of loop than /loop.

/loop runs a command, a prompt, or a slash command on a schedule, such as every 5 minutes, every hour, or every week. It works like a cron job. /goal takes a prompt with a condition, for example implement all tasks in tasks.md, or write unit tests for each file and keep going until code coverage is 90%. Claude keeps working until the condition is met, even if something goes wrong along the way. I call /goal the inner loop because it runs until done or blocked.

In the video I combine them. The outer loop runs every 1 minute and calls /goal to complete all tasks in tasks.md. When I add a new task, the next loop run picks it up and the inner loop does the work. You can add verifiers so the loops do the right things instead of only burning tokens.

Key points

Chapters

  1. 0:00/goal vs /loop
  2. 1:08/goal is the inner loop
  3. 2:00/loop is the outer loop
  4. 4:10When to use each
Free live lesson · Nov 24Stop Measuring AI by Tokens. Measure What It EarnsOne hour, live, with Saurav. Bring your own bill. Free.
Save my free seat →
Get new videos and tips by emailOne short email when there is something new. Unsubscribe any time.

More CloudYeti videos