Claude Code Adds Dynamic Loop That Chooses Its Own Interval
The new /loop command runs prompts on a schedule or lets Claude pick the next tick based on what it observes, and can use the Monitor tool to skip polling entirely.
Anthropic has shipped a dynamic scheduling mode for Claude Code's /loop command. When you invoke /loop without an interval, Claude now chooses the next wake-up time itself — between one minute and one hour — based on what it saw in the last iteration. It can also call the Monitor tool directly to stream output from a background script, eliminating polling altogether.
How the dynamic interval works
With a fixed interval such as /loop 5m check the deploy, Claude converts the value to a cron expression and runs on that cadence. If you omit the interval — /loop check whether CI passed and address any review comments — Claude picks a delay after each run. Short waits while a build finishes or a PR is active; longer waits when nothing is pending. The chosen delay and the reason are printed at the end of every iteration.
In sessions where the Monitor tool is available, a dynamic /loop may use it instead of re-running the prompt. Monitor executes a background script and streams each output line back, which is often more token-efficient and responsive than interval polling.
Built-in maintenance prompt and loop.md
A bare /loop with no prompt runs a built-in maintenance routine: continue unfinished work, tend to the current branch's pull request (review comments, failed CI, merge conflicts), then run cleanup passes such as bug hunts or simplification. You can replace that default by creating a loop.md file. Claude checks .claude/loop.md (project level) first, then ~/.claude/loop.md (user level). The file is plain Markdown; content beyond 25,000 bytes is truncated. Edits take effect on the next iteration.
Stopping and detaching
Self-paced loops stop with Esc while waiting, or Ctrl+C when Claude is idle. Fixed-interval loops must be cancelled by asking Claude — for example, "cancel the deploy check loop". A loop you don't cancel expires after seven days. In a background session, press Ctrl+C twice on an empty prompt to detach without stopping the loop; press Esc before detaching if you want to stop it.
One-shot reminders and underlying tools
For single reminders, use natural language: "remind me at 3pm to push the release branch" or "in 45 minutes, check whether the integration tests passed". Claude schedules a one-shot task that deletes itself after firing. Session-scoped tasks are managed with three tools: CronCreate (accepts a 5-field cron expression, the prompt, and recurrence flag), CronList (shows IDs, schedules, next run times, and prompts), and CronDelete (cancels by 8-character ID). A session holds up to 50 tasks.
Jitter and run-time guarantees
Recurring tasks run late by up to half the gap to the next run, capped at 30 minutes — except */5 * * * * (every five minutes), which starts 4 minutes 45 seconds after the previous run. Hourly or daily tasks run 0–30 minutes late; every 10 minutes runs 0–5 minutes late; every 30 minutes runs 0–15 minutes late. One-shot tasks scheduled on the hour or half-hour run a little early. All times are interpreted in your local timezone.
This Run feature works on every provider and with feature-flag fetching turned off; on Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform, and Microsoft Foundry it requires Claude Code v2.1.248 or later.
Sources
Related news
Comments
Weekly digest
The best of vibe coding, AI agents and open source — once a week, no spam.