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.
Why do Claude Loops exist?
A lot of real-world work is not "do this once." It is "keep checking until something changes." Examples:
- Watching a CI build to see when it goes green.
- Polling a deploy queue and reporting when your service is live.
- Monitoring a Slack thread for new replies.
- Tailing an error log and flagging new patterns.
- Re-running a flaky test every few minutes to confirm a fix.
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.
What can go inside a loop?
Anything you would normally type into Claude Code. That includes:
- Plain English prompts:
/loop 5m check if the deploy finished - Other slash commands:
/loop 15m /verify - Skills:
/loop 1h /security-review - Multi-step instructions:
/loop 30m scan the error log, group new errors by stack trace, and tell me anything you have not seen before
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
| Feature | Cron / Shell scripts | Claude Loops |
|---|---|---|
| Reasoning between runs | None - same command every time | Full AI reasoning every iteration |
| Setup time | Minutes to hours (write script, edit crontab) | Seconds - type /loop |
| Reads context | No | Yes - reads your project, recent state, prior results |
| Self-pacing | No | Yes, in dynamic mode |
| Survives long sessions | N/A | Yes - context auto-compresses |
| Where it runs | A server you maintain | Your 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:
- /loop - runs inside your active session. Best for tasks you want to monitor while you are still at the keyboard.
- /schedule - creates a cloud agent that runs on a cron schedule without you. Best for unattended jobs like a daily morning brief.
- Autonomous /loop - a loop with no user prompt, running on its own goals. Power-user mode.
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:
- The task is genuinely one-off - just run the command directly.
- You want the task to run when you are not at your computer - use
/scheduleinstead. - You need millisecond precision - Claude Loops are not designed for high-frequency polling.
- The task triggers expensive external work every iteration - make sure the cost is acceptable before looping.
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
- How Claude Loops Work Under the Hood - for the curious.
- Getting Started Guide - your first loop in 5 minutes.
- 20+ Real-World Loop Examples - copy-paste templates.
- FAQ - every question we have been asked.