Claude Loops are recurring prompts inside Claude Code. Instead of typing the same instruction over and over, you tell Claude to run it on a schedule - once every 5 minutes, every hour, or at a pace Claude itself decides. The loop keeps running until you stop it.

You invoke a loop with a single slash command:

/loop 5m check the build status and tell me when it finishes

That one line tells Claude: "Run this task right now. Then run it again every 5 minutes. Keep doing it until I say stop." No scripting, no cron file, no infrastructure.

One-sentence definition: A Claude Loop is a recurring prompt that Claude Code executes on a fixed or self-paced schedule, inside your active session.

Why do Claude Loops exist?

A lot of real-world work is not "do this once." It is "keep checking until something changes." Examples:

Before loops, you had two awkward options: (1) sit there typing the same prompt repeatedly, or (2) write a shell script, set up cron, and lose all the AI intelligence between runs. Loops give you the third option - recurring tasks with Claude's reasoning on every single iteration.

The two modes of a Claude Loop

Every loop runs in one of two modes. You choose by whether or not you provide an interval.

Fixed-interval mode

You provide an interval. Claude runs the task on that exact cadence.

/loop 10m /code-review

This runs /code-review right now, then again every 10 minutes. Predictable, simple, perfect when you know how often you want the check.

Dynamic (self-paced) mode

You skip the interval. Claude decides when to wake up based on what it is waiting for.

/loop watch the deploy and ping me when it is live

Here Claude figures out a good wake-up time using a tool called ScheduleWakeup. It might check every 90 seconds during a fast-moving CI run, then back off to 20 minutes once things stabilize. You get the right pacing without thinking about it.

Rule of thumb: Use a fixed interval when the cadence is obvious. Let Claude self-pace when you are not sure how fast the external state actually changes.

What can go inside a loop?

Anything you would normally type into Claude Code. That includes:

This is the part most people miss: a loop is not limited to a single command. It can wrap a whole reasoning task. Claude gets fresh context every iteration and decides for itself what to do next.

How Claude Loops differ from cron jobs and scripts

FeatureCron / Shell scriptsClaude Loops
Reasoning between runsNone - same command every timeFull AI reasoning every iteration
Setup timeMinutes to hours (write script, edit crontab)Seconds - type /loop
Reads contextNoYes - reads your project, recent state, prior results
Self-pacingNoYes, in dynamic mode
Survives long sessionsN/AYes - context auto-compresses
Where it runsA server you maintainYour local session (or cloud with /schedule)

Loops vs. /schedule vs. autonomous agents

Claude Code has three related ways to repeat work. They are easy to confuse, so here is the quick distinction:

Most people start with /loop. Once you are comfortable, /schedule is the natural next step for "set and forget" automation.

When should you NOT use a loop?

Loops are great, but they are not the right tool for everything. Skip the loop if:

Heads up on cost: Each loop iteration is a full Claude run. If your loop fires every minute for 8 hours, that is 480 runs. Pick intervals that match how often the underlying state actually changes.

A quick mental model

If it helps, think of a Claude Loop as a small, intelligent assistant sitting next to you. You give it one instruction. It does the thing. It checks back on its own schedule. It tells you when something interesting happens. When you are done, you tell it to stop and it goes away cleanly.

That is it. Nothing more complicated than that.

What to read next

Ready to write your first loop?

Our hands-on guide walks you through it command-by-command. No prior experience needed.

Get Started →