What it does
/loop runs a prompt or slash command on a fixed or dynamic interval. You provide a prompt, an interval (default 10 minutes), and Claude Code repeats that work — waking up on schedule, caching context between runs, and notifying you when it completes.
Two modes:
- Fixed interval:
/loop 5m /verifyruns every 5 minutes indefinitely until you stop it - Dynamic interval:
/loop /verify(no interval) lets you reschedule the next run after each completion based on what you learn
Dynamic mode is useful when the work takes variable time or the next check depends on the result — e.g., "poll until the deploy finishes, then switch to checking for regressions every 10 minutes."
When to use it
Polling and status-watching tasks where you'd otherwise manually re-run a command:
- CI/deploy monitoring: Poll a GitHub Actions run or Vercel deployment status every 30 seconds until it lands
- Background process tracking: Watch a long-running build, database migration, or async job
- Recurring maintenance: Run a cron-like check every hour (e.g., fetch logs, validate config drift, scrape a feed)
- Development loops: Run tests or type-check every time you save, without blocking your terminal
Don't use /loop for:
- One-off tasks (just run the command once)
- Workflows that should be deterministic CI jobs (GitHub Actions, scheduled cloud agents)
- Expensive operations that don't need polling (use
scheduleorcroninstead)
Try it yourself
Pick a task you'd normally re-run manually every few minutes — maybe checking your app's health endpoint, polling a CI job, or verifying a config file. Use /loop with a short interval (30 seconds to 2 minutes) and watch how it batches your work instead of breaking your focus.
Let it run for 3–4 cycles to see how the cache behaves and when you'd adjust the interval or add filtering logic to the prompt.
Gotchas
Cache TTL is 5 minutes. If your interval exceeds 300 seconds, the prompt context is reloaded from scratch for the next run — slower and more expensive. For intervals over 5 minutes, prefer a scheduled cloud agent (schedule) instead.
"Keep going" doesn't renew the loop. If you say "keep going" during an active loop run, it doesn't extend the loop — it just continues that single invocation. The next scheduled run still fires at the interval you set.
Polling loops need exit logic. A loop that checks "is the job done yet?" should include a condition to stop — e.g., "if status is 'complete', send stop signal." Otherwise, it runs forever.
Fixed vs dynamic: Use fixed intervals for regular tasks (health checks, log rotation). Use dynamic for tasks where the next action depends on the result — the loop reschedules itself based on what you learn, avoiding unnecessary checks.
Try it yourself
Type the command in the fake terminal. Nothing leaves your browser.