In Claude Code, /loop takes a prompt or slash command and runs it repeatedly instead of just once. You can give it an interval, like every five minutes, or leave the interval off and let Claude decide when to run again. It's the difference between asking Claude to check something one time and asking it to keep checking until you say stop.

What /loop actually does

Normally you type a request, Claude does it, and the turn ends. /loop wraps that request in a repeat: Claude runs it, waits, then runs it again, on its own, without you re-typing anything. That makes it useful for anything you'd otherwise sit and re-check by hand: a deploy that's building, a test suite you want re-run on every change, or a queue you're waiting to clear.

/loop 5m /run-tests

Run the /run-tests command every 5 minutes. Click to copy.

The two ways to run it

There are two modes, and the difference is who controls the timing.

Mode 1Fixed intervalYou set the cadence: /loop 10m <prompt> runs it every 10 minutes. Best when you're polling something on a clock.
Mode 2Self-pacedLeave the interval off: /loop <prompt> and Claude decides when to run again based on the task. Best for work where the right timing isn't fixed.

A real example

Say you just pushed a change and the deploy takes a few minutes. Instead of refreshing the dashboard yourself, you loop the check:

/loop 2m Check the latest deploy status and tell me the moment it goes live or fails

Claude checks every two minutes and reports back only when there's something to say. When the deploy is live, you stop the loop. You never had to babysit the screen. The same pattern works for watching a long-running job, monitoring an inbox, or re-running a report until the numbers settle.

When not to use it: /loop is for recurring checks, not one-off tasks. If you just need something done once, ask for it directly. Looping a one-time job only wastes turns.

How to stop a loop

A loop keeps going until you end it, so you stay in control. You can interrupt it at any time, and because each run is its own turn, you can watch what it's doing and step in whenever you want. That's the whole idea: it works on the recurring part so you don't have to, but it never takes the wheel away from you.