Run Claude Code on a schedule with /loop

Sometimes you want Claude to check something again in five minutes, or every hour: is the deploy done, did CI pass, are there new review comments. /loop does that inside the session you already have open. This page covers how it works, how to stop it and where it stops working.

First, decide where it should run

As we read the docs, there are three options with different trade-offs:

Cloud for work that must run without your computer, desktop for local files and tools, /loop for quick polling while you work. The rest of this page is about /loop.

The three ways to start one

You can also loop a skill: /loop 20m /review-pr 1234. A scheduled run only executes skills Claude is allowed to call on its own; built-in commands such as /clear or /model, skills marked disable-model-invocation and MCP prompts reach Claude as plain text instead.

Fixed interval

Write the interval as a leading token (30m) or a trailing clause (every 2 hours). Units are s, m, h and d. Cron works in whole minutes, so seconds are rounded up, and intervals that don't fit a clean step (7m, 90m) are rounded to the nearest one that does; Claude tells you what it picked.

Let Claude choose

With no interval, Claude waits between one minute and one hour after each pass, depending on what it saw: short while a build finishes or a PR is busy, longer when nothing is pending. It prints the delay and the reason at the end of every iteration. If the Monitor tool is available, Claude may use it instead of polling at all: it runs a background script and streams each output line back, which can be cheaper and quicker than re-running a prompt.

The default prompt and loop.md

A bare /loop works through, in order: unfinished work from the conversation, the current branch's pull request (review comments, failed CI, merge conflicts), then cleanup passes when nothing else is pending. It does not start new projects, and irreversible actions such as pushing or deleting only go ahead when they continue something the transcript already authorized.

To replace that with your own default, create a plain Markdown file at .claude/loop.md (project) or ~/.claude/loop.md (all projects; the project one wins). Write it as if you were typing the /loop prompt. Edits apply on the next iteration, and anything past 25,000 bytes is cut. It is one default prompt, not a list of tasks, and it is ignored whenever you give a prompt on the command line.

Check the release/next PR. If CI is red, read the failing log,
diagnose and push a minimal fix. If new review comments arrived,
address each one. If everything is green and quiet, say so in one line.

Stopping a loop

A loop that never ends is the usual way to burn quota; how to stop agents from looping covers the habits that prevent it.

One-time reminders and managing tasks

For a one-off, just say it: remind me at 3pm to push the release branch or in 45 minutes, check whether the integration tests passed. Claude schedules a single run that deletes itself. To see or remove tasks, ask: what scheduled tasks do I have?, cancel the deploy check job. Behind that are three tools, CronCreate, CronList and CronDelete, and a session holds up to 50 tasks.

How the runs behave

Limits to know

Cron cheat sheet

Five fields: minute, hour, day of month, month, day of week (0 or 7 is Sunday). Wildcards, steps, ranges and lists work; L, W, ? and names like MON don't.

If both day of month and day of week are set, a date matches when either one matches.

All the guides are in the guides index; for scheduling outside a session, see everyday workflows and running Claude Code from a script. This follows Anthropic's scheduled tasks documentation as we read it in October 2026. We are not affiliated with Anthropic. We wrote this from the documentation and have not tested every case. Intervals, limits and some features depend on your version, and where this page and the documentation disagree, the documentation wins.

See also: Work toward a goal with /goal.

The free loop-stop skill gives long tasks a limit and a stop rule. If you want a second pair of eyes on your CLAUDE.md and settings, the Tune-Up Kit is a checklist for exactly that.