Learning resourcesReviewed · Anthropic

Claude Code: Run prompts on a schedule (/loop and cron tools)

This is the Claude Code documentation page on scheduling prompts inside a running session with /loop and cron tools, written for developers who use Claude Code, and its main catch is that tasks only fire while the session is open and recurring tasks expire after seven days. It explains fixed and self-paced loops, one-time reminders, the CronCreate, CronList and CronDelete tools, jitter, the cron syntax supported and how to disable the scheduler.

Researched 12 Nov 2026

In short.

This is the Claude Code documentation page on scheduling prompts inside a running session with /loop and cron tools, written for developers who use Claude Code, and its main catch is that tasks are session-scoped: they only fire while Claude Code is running and idle, and recurring tasks expire after seven days. The page documents three ways to start work (a fixed interval, an interval Claude picks itself, or a built-in or custom default prompt), one-time reminders in natural language, three underlying tools (CronCreate, CronList, CronDelete), a limit of 50 tasks per session, timing jitter, restore-on-resume behaviour, a switch to disable the scheduler and a comparison with cloud, Desktop and GitHub Actions scheduling. This report is based only on reading the captured page; nothing was run or tested.

Researched and written by an AI model and checked by a second AI model. How it works

The review covers the complete selected page at [https://code.claude.com/docs/en/scheduled-tasks.md] as captured on 12 November 2026 (selected-page.txt, 20,228 bytes). Pages that this page links to (cloud routines, Desktop scheduled tasks, GitHub Actions, Channels, /goal, skills, permissions, environment variables, tools reference, agent view and others) are excluded and only described as the selected page describes them. No licence or notice file was captured. Nothing was installed, executed or tested, so all behaviour, limits, timings and version requirements are the page's claims and not confirmed. Costs, plan requirements and supported platforms are not stated and are unknown.

The overview

What this resource is

This is a single documentation page titled Run prompts on a schedule, taken from the Claude Code docs at [https://code.claude.com/docs/en/scheduled-tasks.md]. Its stated purpose is to show how to use /loop and the cron scheduling tools to run prompts repeatedly, poll for status, or set one-time reminders within a Claude Code session.

It is a guide to a feature of an existing product, not a tool you install. The feature itself is called session-scoped scheduled tasks. The captured page names no author, publication date or page version number. Version numbers appear only as feature requirements for Claude Code itself.

Overall assessment

The page is a substantive, specific reference. It gives concrete syntax, numeric limits, edge cases and a decision table for choosing between scheduling options, rather than a general overview. It is candid about the catches: tasks stop when the session ends, missed runs are not replayed, recurring tasks expire after seven days, and run times are deliberately shifted.

As documentation it is useful to anyone who wants Claude Code to keep checking on something during a working session. It is not a guide to unattended, durable automation, and it says so by pointing those cases to other features. Because nothing was executed, how well these features behave in practice is not assessed; the report only reflects what the page claims.

Who it is for

The page is for people who already use Claude Code and want it to repeat a prompt while they work. The examples it gives are polling a deployment, babysitting a pull request, checking on a long-running build, and reminding yourself to do something later in the session. Beginners can follow the plain-language examples such as /loop 5m check the deploy. Experienced developers get the cron field reference, the jitter formulas and the environment variable for disabling the scheduler.

It is a poor fit if you need work to run while your machine is off or no session is open. The page directs those readers to cloud scheduled tasks, Desktop scheduled tasks or GitHub Actions. It also directs people who want to react to events instead of polling to Channels, and people who want Claude to keep working toward a condition to /goal. The details of those alternatives are on other pages that were not part of this review.

What the feature can do

Fixed-interval loops: /loop with an interval and a prompt, such as /loop 5m check the deploy, converts the interval to a cron expression, schedules the job and confirms the cadence and job ID. The interval can lead as a token like 30m or trail as a clause like every 2 hours, with units s, m, h and d.

Self-paced loops: with a prompt but no interval, Claude picks a delay between one minute and one hour after each iteration, based on what it observed, and prints the delay and the reason. The page says Claude may use the Monitor tool instead where it is available, to stream a background script's output rather than poll.

Default prompts: a bare /loop, or /loop with only an interval, runs a built-in maintenance prompt that continues unfinished work, tends the current branch's pull request (review comments, failed CI runs, merge conflicts) and then runs cleanup passes. A loop.md file can replace that prompt.

Skills in loops: a skill can be the prompt, for example /loop 20m /review-pr 1234, but only skills Claude is allowed to invoke on its own run. Built-in commands such as /permissions, /model and /clear, skills marked disable-model-invocation: true (including the bundled /verify skill), skills withheld by a skillOverrides setting or a Skill deny rule, and MCP prompts reach Claude as plain text instead of executing.

One-time reminders: plain-language requests such as remind me at 3pm to push the release branch create a single-fire task that deletes itself after running.

Management: CronCreate, CronList and CronDelete, which you can ask for in natural language. A session can hold up to 50 tasks, each with an 8-character ID.

Using it

Requirements

You need Claude Code with the /loop bundled skill and the cron tools available. The page does not say which Claude Code version first introduced them. It names these version thresholds: v2.1.248 or later for dynamically chosen intervals and the built-in maintenance prompt on Amazon Bedrock, Claude Platform on AWS, Google Cloud's Agent Platform and Microsoft Foundry, or with feature-flag fetching turned off; v2.1.299 or later for next run times in CronCreate and CronList rows; and v2.1.295 or later for detaching from a background session with Ctrl+C while leaving a self-paced loop running.

The page does not state account, plan or subscription requirements, supported operating systems or model requirements; these are unknown from this evidence. The session must stay running and idle for tasks to fire. Setting CLAUDE_CODE_DISABLE_CRON=1 removes the scheduler, so it must not be set if you want to use it.

How it works

The scheduler checks every second for due tasks and enqueues them at low priority. A scheduled prompt fires between your turns, not while Claude is mid-response; if Claude is busy, the prompt waits until the current turn ends. Times use your local timezone, so 0 9 * * * means 9am where you run Claude Code, not UTC.

CronCreate takes a standard 5-field cron expression (minute, hour, day-of-month, month, day-of-week), the prompt, and whether the task recurs or fires once. Wildcards, single values, steps, ranges and comma lists are supported. Sunday is 0 or 7. Extended syntax such as L, W, ? and names like MON or JAN is not supported. When both day-of-month and day-of-week are constrained, a date matches if either field matches, following vixie-cron semantics.

Seconds are rounded up to the nearest minute. Intervals that do not map to a clean cron step, such as 7m or 90m, are rounded to the nearest one that does, and Claude tells you what it chose.

Jitter: to avoid many sessions calling the API at the same moment, run times are shifted. Recurring tasks run late by up to half the gap to the next run, capped at 30 minutes (every 10 minutes: 0 to 5 minutes late; every 30 minutes: 0 to 15; hourly or less often: 0 to 30). A task written */5 * * * *, which is what /loop 5m creates, is not delayed: each run starts 4 minutes 45 seconds after the previous one, because a run exactly five minutes later would begin after a five-minute prompt cache had expired. One-shot tasks set for :00 or :30 run up to 90 seconds early; the page suggests an off-hour minute such as 3 9 * * * when timing matters.

Expiry and stopping: recurring tasks fire one final time seven days after creation and delete themselves. A self-paced loop can be stopped with Esc while it waits, or with Ctrl+C while Claude is idle, except in a background session you have attached to. There, pressing Ctrl+C twice on an empty prompt while Claude is idle detaches you from the session, and a self-paced loop waiting for its next iteration keeps running, with that iteration starting on schedule; to stop the loop instead, press Esc while it waits, before you detach. The page says detaching with Ctrl+C without stopping the loop requires Claude Code v2.1.295 or later. A fixed-interval loop does not respond to Esc or Ctrl+C; you ask Claude to cancel it. In self-paced mode Claude can end the loop by calling ScheduleWakeup with stop: true, and if an iteration neither reschedules nor stops, one fallback wakeup is scheduled about 20 minutes later.

Setup

There is no installation step described; the feature is used from inside a Claude Code session. To start, type /loop with an optional interval and optional prompt, or describe a reminder in natural language. To see or cancel tasks, ask Claude, for example what scheduled tasks do I have? or cancel the deploy check job.

Optional customisation is a loop.md file. Claude Code looks first for .claude/loop.md (project level, takes precedence) and then ~/.claude/loop.md (user level), and uses the first one it finds. It is plain Markdown with no required structure, is read again on each iteration so edits apply while a loop is running, and content beyond 25,000 bytes is truncated. loop.md supplies the default whenever no prompt is provided, including /loop and /loop 15m; supplying an explicit prompt bypasses it.

To turn the whole feature off, set CLAUDE_CODE_DISABLE_CRON=1 in the environment. The page says CronCreate and /loop then become unavailable and already-scheduled tasks stop firing.

Worked examples from the page

Fixed interval: /loop 5m check if the deployment finished and tell me what happened. The page says Claude converts 5m to */5 * * * *, schedules it and confirms the cadence and job ID.

Self-paced: /loop check whether CI passed and address any review comments. Claude chooses how long to wait each time and waits longer once the pull request goes quiet.

Skill as prompt: /loop 20m /review-pr 1234 re-runs that skill each iteration, provided Claude is allowed to invoke it itself.

One-time reminders: remind me at 3pm to push the release branch, or in 45 minutes, check whether the integration tests passed.

Custom default: a .claude/loop.md for a release branch might say to check the release/next pull request, pull the failing job log and push a minimal fix if CI is red, address and resolve new review comments, and otherwise say in one line that everything is green and quiet. Note that this example instructs Claude to push code, and the page says each run goes through the session's permission checks before it pushes or deletes anything.

None of these examples was run for this report.

Assessment & evidence

Limitations and risks

Limits stated on the page: tasks fire only while Claude Code is running and idle, so closing the terminal or exiting the session stops them. Backgrounding the session carries /loop tasks to a background session that keeps running without a terminal. There is no catch-up for missed fires: if a task comes due while Claude is busy on a long request, it fires once when Claude becomes idle, not once per missed interval.

Resume behaviour: claude --resume or --continue restores tasks made with CronCreate, except expired recurring tasks and one-shot tasks whose time has passed. A self-paced /loop is not restored and must be started again. A restored recurring task does not fire for runs missed while the session was down, and jitter applies to its next run. Background Bash commands and monitors are not restarted on resume.

In a background session, a self-paced loop stops if its next wakeup comes due while the session process is not running, such as after a crash; you must reply to the session to continue it.

With feature-flag fetching off, a task you asked to keep across sessions is stored in the project's .claude/scheduled_tasks.json. If .claude or that file is a symlink, Claude Code returns an error instead of scheduling. A saved task runs only in the folder where it was created; copies in a new worktree are listed but do not run.

Practical risks implied by the page: scheduled prompts that push or delete things depend on the session's permission settings, run times can differ from the schedule by up to 30 minutes, and a fixed-interval loop cannot be stopped with Esc or Ctrl+C. The page does not discuss what happens with failed or very long runs beyond the points above. Real-world reliability was not assessed.

Reasoning behind the assessment

The page is useful because it answers the questions a user is likely to have before relying on a loop: how often it can run, when it actually runs, what stops it, what survives a restart and what it cannot do. The jitter section gives formulas and a worked example (7,37 * * * * with a 14-minute delay running at :21 and :51), and the comparison table makes the trade-offs against cloud and Desktop scheduling explicit.

The main weakness is that some questions are left unanswered. Pricing and account or plan requirements are absent from the page. Other topics are covered on the page itself, with linked pages providing additional detail: it describes how permissions apply (a /loop inherits permission prompts from the session, and each run of the built-in maintenance prompt goes through the session's permission checks before it pushes or deletes anything), and its comparison table sets out substantive differences between cloud, Desktop and /loop scheduling. Version availability is described only through a few minimum versions, so a reader cannot tell from this page alone whether their installed version has everything described. There is also some wording that needs care: the page says tasks are restored on resume with exceptions, and the exceptions are spread across the Limitations list, so readers should read that list in full.

Alternatives named on the page

Cloud scheduled tasks: run on Anthropic-managed cloud by default, do not need your machine or an open session, persist across restarts, use a fresh clone with no local file access, use connectors configured per task, default to auto mode for permission prompts and have a 1-hour minimum interval.

Desktop scheduled tasks: run on your machine, do not need an open session but need the machine on, have local file access, use config files and connectors for MCP, have configurable permission prompts, and have a 1-minute minimum when Claude sets the schedule or 1 hour in the forms.

/loop: runs on your machine, needs an open session, inherits MCP servers and permissions from the session, and has a 1-minute minimum interval.

Other pointers: GitHub Actions with a schedule trigger for CI-driven automation; Channels for reacting to events instead of polling; /goal for keeping a session working toward a condition rather than on an interval; and the Monitor tool for streaming a background script's output. The page's own guidance is cloud tasks for reliable unattended work, Desktop tasks when you need local files and tools, and /loop for quick polling during a session. The alternatives were not examined beyond what this page says about them.

Evidence base

The only evidence is the captured page selected-page.txt from [https://code.claude.com/docs/en/scheduled-tasks.md], 20,228 bytes, content hash sha256:ef9be1d49e12d3b25196cdf892b6982290677ac4ee86ae43393c7dd5803379ca, captured on 12 November 2026 at 21:37 UTC. The scope is that complete page; pages it links to are excluded. Factual statements in this report about the feature's behaviour, limits, syntax, timings and version requirements come from that page's text. The overall assessment, the reasoning about strengths and weaknesses, and the suggested actions are evaluative judgments and recommendations based on it, not statements made by the page. None of the page's claims were verified by running Claude Code, and no runtime behaviour, timing, limit or version requirement was independently confirmed.

Access & freshness

Costs

The page states no prices, fees or usage charges, and no billing allowances are stated, so prices and billing terms for using this feature are unknown from this evidence. The page does document operational limits that are not billing terms, such as a maximum of 50 scheduled tasks per session. Each scheduled fire runs a prompt through Claude, so frequent loops presumably consume model usage under whatever plan or provider you use, but the page does not quantify this and does not say how usage is billed.

The only cost-related remarks are qualitative: the Monitor tool is described as often more token-efficient and responsive than re-running a prompt on an interval, and the seven-day expiry is described as bounding how long a forgotten loop can run. For comparison, the page lists a 1-hour minimum interval for cloud tasks and 1 minute for /loop, but gives no pricing for any option.

Rights and reuse

The captured page contains no licence, copyright notice or reuse statement, so permission to copy, redistribute or adapt its text remains unknown. The product terms that govern use of the Claude Code feature it describes are not established by this evidence.

Freshness

The page shows no publication or last-updated date. The capture date is 12 November 2026. The page cites specific Claude Code versions (v2.1.248, v2.1.295 and v2.1.299), which suggests it tracks a product that changes often, and details such as intervals, limits, jitter rules and restore behaviour could change after the capture. Readers should check the live page and their installed Claude Code version before relying on specifics. Whether a newer revision exists is unknown.

Suggested actions

If you use Claude Code and want light, in-session polling, try a fixed-interval loop on something low-risk first (for example, checking a build) and use CronList to see the next run time. Remember that timing is shifted and that a fixed-interval loop must be cancelled by asking Claude.

Before putting write actions in a loop or in loop.md (pushing fixes, resolving threads), review your session's permission settings, since the page says each run goes through them.

If the work must survive closed terminals, restarts or the seven-day expiry, read the cloud, Desktop and GitHub Actions pages instead. If you want events rather than polling, read the Channels page. Check the live page for your Claude Code version before depending on features tied to specific versions, and ask for the current pricing and plan terms separately because this page does not give them.

Evidence for this report

selected-page.txtselected · checked 2026-11-12