Run prompts on a schedule
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -83,7 +83,7 @@
`.claude/loop.md`| Project-level. Takes precedence when both files exist.
`~/.claude/loop.md`| User-level. Applies in any project that does not define its own.
-The file is plain Markdown with no required structure. Write it as if you were typing the `/loop` prompt directly. The following example keeps a release branch healthy:
+Write the `loop.md` file in plain Markdown, as in this example that keeps a release branch healthy:
.claude/loop.md
@@ -194,10 +194,10 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* In a [background session](</docs/en/agent-view#from-inside-a-session>), a self-paced loop stops if its next wakeup comes due while the session’s process isn’t running, such as after a crash. When the process starts again, the transcript shows a [notice that the wakeup won’t fire](</docs/en/errors#restarted-after-its-next-loop-wakeup-was-due>). To continue the loop, [reply to the session](</docs/en/agent-view#peek-and-reply>) and ask Claude to keep it running.
- * When you resume with `claude --resume` or `claude --continue`, Claude Code restores tasks scheduled with `CronCreate`, except expired recurring tasks and one-shot tasks whose time has passed. You also lose session-scoped tasks if you exit between turns by choosing `Exit and stop tasks`. A self-paced `/loop` isn’t restored either. To restart a loop that didn’t come back, run `/loop` again.
+ * When you resume with `claude --resume` or `claude --continue`, Claude Code restores tasks scheduled with `CronCreate`, except expired recurring tasks and one-shot tasks whose time has passed. You also lose session-scoped tasks if you exit between turns by choosing `Exit and stop tasks`. After you resume, rerun your earlier `/loop` command to restart a self-paced loop or another loop you lost.
* A restored recurring task doesn’t fire for the runs it missed while the session wasn’t running. Its next run is the first one due after you resume, and jitter applies to that run.
* When you resume with `claude --resume` or `claude --continue`, Claude Code doesn’t restart the background Bash commands and monitors that were running when the session ended. If you still need one, ask Claude to start it again.
- * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder.
+ * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error. To run a saved task in another folder, such as a new worktree, create it again in that folder.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -135,7 +135,7 @@
## How session-scoped scheduled tasks run
-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 when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code, not UTC.
+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 when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code.
### Jitter
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -56,7 +56,7 @@
/loop check whether CI passed and address any review comments
-In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The list shows its pending wakeup as a one-shot task, so a wakeup scheduled for `:00` or `:30` can run a little early. The seven-day expiry applies to the loop too.
+In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list, so you can ask Claude to list or cancel it. The list shows its pending wakeup as a one-shot task, so a wakeup scheduled for `:00` or `:30` can run a little early. The loop expires 30 days after it starts.
Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later.
@@ -97,7 +97,7 @@
### Stop a loop
* **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
- * **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
+ * **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends 30 days after you start it.
In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. A self-paced loop can also stop when an iteration ends without Claude scheduling the next one. For one extra iteration about 20 minutes later, see [`CLAUDE_CODE_LOOP_KEEPALIVE`](</docs/en/env-vars#variables>).
@@ -164,9 +164,9 @@
A one-shot task scheduled for `:00` or `:30` runs up to 90 seconds early. Claude Code doesn’t shift a one-shot task scheduled for any other minute, so when the timing matters, schedule it off the hour and half hour: `3 9 * * *` instead of `0 9 * * *`.
-### Seven-day expiry
-
-Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
+### Recurring task expiry
+
+Recurring tasks automatically expire 30 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. Before v2.1.330, the limit was 7 days, and recurring tasks created with `CronCreate` on those versions keep it. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
## Cron expression reference
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -99,7 +99,7 @@
* **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
* **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
-In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either.
+In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. A self-paced loop can also stop when an iteration ends without Claude scheduling the next one. For one extra iteration about 20 minutes later, see [`CLAUDE_CODE_LOOP_KEEPALIVE`](</docs/en/env-vars#variables>).
#### Detach without stopping a loop
@@ -194,7 +194,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* In a [background session](</docs/en/agent-view#from-inside-a-session>), a self-paced loop stops if its next wakeup comes due while the session’s process isn’t running, such as after a crash. When the process starts again, the transcript shows a [notice that the wakeup won’t fire](</docs/en/errors#restarted-after-its-next-loop-wakeup-was-due>). To continue the loop, [reply to the session](</docs/en/agent-view#peek-and-reply>) and ask Claude to keep it running.
- * When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it.
+ * When you resume with `claude --resume` or `claude --continue`, Claude Code restores tasks scheduled with `CronCreate`, except expired recurring tasks and one-shot tasks whose time has passed. You also lose session-scoped tasks if you exit between turns by choosing `Exit and stop tasks`. A self-paced `/loop` isn’t restored either. To restart a loop that didn’t come back, run `/loop` again.
* A restored recurring task doesn’t fire for the runs it missed while the session wasn’t running. Its next run is the first one due after you resume, and jitter applies to that run.
* When you resume with `claude --resume` or `claude --continue`, Claude Code doesn’t restart the background Bash commands and monitors that were running when the session ended. If you still need one, ask Claude to start it again.
* With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder.
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -96,7 +96,7 @@
### Stop a loop
- * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
+ * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` on an empty prompt to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
* **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either.
Show diff (211 lines)
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -7,11 +7,7 @@
Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, create a [cloud scheduled task](</docs/en/routines>), set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
-##
-
-
-
-Compare scheduling options
+## Compare scheduling options
Claude Code offers three ways to schedule recurring or one-off work:
@@ -29,11 +25,7 @@
Use **cloud tasks** for work that should run reliably without your machine. Use **Desktop tasks** when you need access to local files and tools. Use **`/loop`** for quick polling during a session.
-##
-
-
-
-Run a prompt repeatedly with /loop
+## Run a prompt repeatedly with /loop
The `/loop` [bundled skill](</docs/en/commands>) is the quickest way to run a prompt on repeat while the session stays open. Both the interval and the prompt are optional, and what you provide determines how the loop behaves.
@@ -50,11 +42,7 @@
* Skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
* [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`
-###
-
-
-
-Run on a fixed interval
+### Run on a fixed interval
When you supply an interval, Claude converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
@@ -62,11 +50,7 @@
The interval can lead the prompt as a bare token like `30m`, or trail it as a clause like `every 2 hours`. Supported units are `s` for seconds, `m` for minutes, `h` for hours, and `d` for days. Seconds are rounded up to the nearest minute since cron has one-minute granularity. Intervals that don’t map to a clean cron step, such as `7m` or `90m`, are rounded to the nearest interval that does and Claude tells you what it picked.
-###
-
-
-
-Let Claude choose the interval
+### Let Claude choose the interval
When you omit the interval, Claude chooses one dynamically instead of running on a fixed cron schedule. After each iteration it picks a delay between one minute and one hour based on what it observed: short waits while a build is finishing or a PR is active, longer waits when nothing is pending. The chosen delay and the reason for it are printed at the end of each iteration. The example below checks CI and review comments, with Claude waiting longer between iterations once the PR goes quiet:
@@ -76,11 +60,7 @@
Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later.
-###
-
-
-
-Run the built-in maintenance prompt
+### Run the built-in maintenance prompt
When you omit the prompt, Claude uses a built-in maintenance prompt instead of one you supply. On each iteration it works through the following, in order:
@@ -94,11 +74,7 @@
Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-###
-
-
-
-Customize the default prompt with loop.md
+### Customize the default prompt with loop.md
Create a `loop.md` file to replace the built-in maintenance prompt with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and Claude Code ignores it whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
@@ -118,30 +94,18 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-###
-
-
-
-Stop a loop
+### Stop a loop
* **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
* **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either.
-####
-
-
-
-Detach without stopping a loop
+#### Detach without stopping a loop
When you’re [attached to a background session](</docs/en/agent-view#attach-to-a-session>) and Claude is idle, press `Ctrl+C` twice on an empty prompt to detach. A self-paced loop waiting there for its next iteration keeps running, and that iteration starts on schedule. To stop the loop instead, press `Esc` before you detach. Detaching with `Ctrl+C` without stopping the loop requires Claude Code v2.1.295 or later.
-##
-
-
-
-Set a one-time reminder
+## Set a one-time reminder
For one-shot reminders, describe what you want in natural language instead of using `/loop`. Claude schedules a single-fire task that deletes itself after running.
@@ -151,11 +115,7 @@
Claude pins the fire time to a specific minute and hour using a cron expression and confirms when it will fire.
-##
-
-
-
-Manage session-scoped scheduled tasks
+## Manage session-scoped scheduled tasks
Ask Claude in natural language to list or cancel tasks, or reference the underlying tools directly.
@@ -173,27 +133,15 @@
Each scheduled task has an 8-character ID you can pass to `CronDelete`. A session can hold up to 50 scheduled tasks at once.
-##
-
-
-
-How session-scoped scheduled tasks run
+## How session-scoped scheduled tasks run
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 when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code, not UTC.
-###
-
-
-
-Jitter
+### Jitter
A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, except a task that runs every five minutes, written `*/5 * * * *`. One-shot tasks scheduled on the hour or half hour run a little early. To see when a task is next due, read the row under Claude’s `CronCreate` call in your terminal. The row shows that time after the schedule, for example `next run 10:21 AM`. To check again later, ask Claude to list your tasks and look for `next run` in the rows under the `CronList` call. Next run times in these rows require Claude Code v2.1.299 or later.
-####
-
-
-
-How late a recurring task runs
+#### How late a recurring task runs
Unless it runs every five minutes, a recurring task starts each run late by up to half the gap to the next run, and by at most 30 minutes. Your task is one of these three cases:
@@ -212,27 +160,15 @@
For example, `7,37 * * * *` schedules a task for `:07` and `:37`, which are 30 minutes apart, so its delay is somewhere between 0 and 15 minutes. If this task’s delay is 14 minutes, it runs at `:21` and `:51` every hour. Changing the schedule to a different minute moves the run time, and a delay is still added on top.
-####
-
-
-
-When a one-shot task runs early
+#### When a one-shot task runs early
A one-shot task scheduled for `:00` or `:30` runs up to 90 seconds early. Claude Code doesn’t shift a one-shot task scheduled for any other minute, so when the timing matters, schedule it off the hour and half hour: `3 9 * * *` instead of `0 9 * * *`.
-###
-
-
-
-Seven-day expiry
+### Seven-day expiry
Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
-##
-
-
-
-Cron expression reference
+## Cron expression reference
`CronCreate` accepts standard 5-field cron expressions: `minute hour day-of-month month day-of-week`. All fields support wildcards (`*`), single values (`5`), steps (`*/15`), ranges (`1-5`), and comma-separated lists (`1,15,30`).
@@ -247,19 +183,11 @@
Day-of-week uses `0` or `7` for Sunday through `6` for Saturday. Extended syntax like `L`, `W`, `?`, and name aliases such as `MON` or `JAN` is not supported. When both day-of-month and day-of-week are constrained, a date matches if either field matches. This follows standard vixie-cron semantics.
-##
-
-
-
-Disable session-scoped scheduled tasks
+## Disable session-scoped scheduled tasks
Set `CLAUDE_CODE_DISABLE_CRON=1` in your environment to disable the scheduler entirely. `CronCreate` and `/loop` become unavailable, and any already-scheduled tasks stop firing. While the project’s `.claude/scheduled_tasks.json` file holds tasks, `CronList` and `CronDelete` stay available, so you can still ask Claude to list or cancel them. See [Environment variables](</docs/en/env-vars>) for the full list of disable flags.
-##
-
-
-
-Limitations
+## Limitations
Session-scoped scheduling has inherent constraints:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -88,11 +88,11 @@
* tend to the current branch’s pull request: review comments, failed CI runs, merge conflicts
* run cleanup passes such as bug hunts or simplification when nothing else is pending
-Claude does not start new initiatives outside that scope, and irreversible actions such as pushing or deleting only proceed when they continue something the transcript already authorized.
+Each run goes through your session’s [permission checks](</docs/en/permissions>) before it pushes or deletes anything. A bare `/loop` runs this prompt at a dynamically chosen interval:
/loop
-A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
+Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
###
@@ -253,7 +253,7 @@
Disable session-scoped scheduled tasks
-Set `CLAUDE_CODE_DISABLE_CRON=1` in your environment to disable the scheduler entirely. The cron tools and `/loop` become unavailable, and any already-scheduled tasks stop firing. See [Environment variables](</docs/en/env-vars>) for the full list of disable flags.
+Set `CLAUDE_CODE_DISABLE_CRON=1` in your environment to disable the scheduler entirely. `CronCreate` and `/loop` become unavailable, and any already-scheduled tasks stop firing. While the project’s `.claude/scheduled_tasks.json` file holds tasks, `CronList` and `CronDelete` stay available, so you can still ask Claude to list or cancel them. See [Environment variables](</docs/en/env-vars>) for the full list of disable flags.
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -23,7 +23,7 @@
Persistent across restarts| Yes| Yes| Restored on `--resume`, with [exceptions](</docs/en/scheduled-tasks#limitations>)
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
-Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
+Permission prompts| [Auto mode](</docs/en/routines#permission-prompts-during-a-run>) by default| Configurable per task| Inherits from session
Customizable schedule| Yes| Yes| Yes
Minimum interval| 1 hour| 1 minute when Claude sets it, [1 hour in the forms](</docs/en/desktop-scheduled-tasks#schedule-options>)| 1 minute
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -24,8 +24,8 @@
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
-Customizable schedule| Via `/schedule` in the CLI| Yes| Yes
-Minimum interval| 1 hour| 1 minute| 1 minute
+Customizable schedule| Yes| Yes| Yes
+Minimum interval| 1 hour| 1 minute when Claude sets it, [1 hour in the forms](</docs/en/desktop-scheduled-tasks#schedule-options>)| 1 minute
Use **cloud tasks** for work that should run reliably without your machine. Use **Desktop tasks** when you need access to local files and tools. Use **`/loop`** for quick polling during a session.
@@ -124,7 +124,18 @@
Stop a loop
-To stop a self-paced `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Loops on a fixed interval keep running until you cancel them like any other scheduled task or seven days elapse.
+ * **Self-paced loop** : while the loop is waiting for its next iteration, press `Esc` to stop it. You can also stop it with `Ctrl+C` while Claude is idle, except in a background session you’ve attached to. A `Pending wakeup cancelled` notice confirms that the loop won’t fire again.
+ * **Fixed-interval loop** : to stop a loop such as `/loop 5m`, ask Claude to cancel it, for example `cancel the deploy check loop`. `Esc` and `Ctrl+C` don’t stop it, or any task you scheduled by asking Claude directly. A loop you don’t cancel ends when seven days elapse.
+
+In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either.
+
+####
+
+
+
+Detach without stopping a loop
+
+When you’re [attached to a background session](</docs/en/agent-view#attach-to-a-session>) and Claude is idle, press `Ctrl+C` twice on an empty prompt to detach. A self-paced loop waiting there for its next iteration keeps running, and that iteration starts on schedule. To stop the loop instead, press `Esc` before you detach. Detaching with `Ctrl+C` without stopping the loop requires Claude Code v2.1.295 or later.
##
@@ -254,7 +265,10 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
- * When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume.
+ * In a [background session](</docs/en/agent-view#from-inside-a-session>), a self-paced loop stops if its next wakeup comes due while the session’s process isn’t running, such as after a crash. When the process starts again, the transcript shows a [notice that the wakeup won’t fire](</docs/en/errors#restarted-after-its-next-loop-wakeup-was-due>). To continue the loop, [reply to the session](</docs/en/agent-view#peek-and-reply>) and ask Claude to keep it running.
+ * When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it.
+ * A restored recurring task doesn’t fire for the runs it missed while the session wasn’t running. Its next run is the first one due after you resume, and jitter applies to that run.
+ * When you resume with `claude --resume` or `claude --continue`, Claude Code doesn’t restart the background Bash commands and monitors that were running when the session ended. If you still need one, ask Claude to start it again.
* With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,4 +1,11 @@
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
+Session-scoped scheduled tasks let Claude re-run a prompt automatically on an interval within a Claude Code session. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session.
+
+These cases are covered on other pages:
+
+ * **Reacting to events as they happen instead of polling** : see [Channels](</docs/en/channels>). Your CI can push the failure into the session directly.
+ * **Keeping the session working turn after turn toward a condition rather than on an interval** : see [`/goal`](</docs/en/goal>).
+
+Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, create a [cloud scheduled task](</docs/en/routines>), set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
@@ -137,7 +144,7 @@
-Manage scheduled tasks
+Manage session-scoped scheduled tasks
Ask Claude in natural language to list or cancel tasks, or reference the underlying tools directly.
@@ -159,7 +166,7 @@
-How scheduled tasks run
+How session-scoped scheduled tasks run
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 when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code, not UTC.
@@ -208,7 +215,7 @@
Seven-day expiry
-Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Routines](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
+Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [cloud scheduled tasks](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
##
@@ -233,7 +240,7 @@
-Disable scheduled tasks
+Disable session-scoped scheduled tasks
Set `CLAUDE_CODE_DISABLE_CRON=1` in your environment to disable the scheduler entirely. The cron tools and `/loop` become unavailable, and any already-scheduled tasks stop firing. See [Environment variables](</docs/en/env-vars>) for the full list of disable flags.
@@ -252,6 +259,6 @@
For cron-driven automation that needs to run unattended:
- * [Routines](</docs/en/routines>): run in the cloud on a schedule, via API call, or on GitHub events
+ * [Cloud scheduled tasks](</docs/en/routines>): run in the cloud on a schedule, via API call, or on GitHub events
* [GitHub Actions](</docs/en/github-actions>): use a `schedule` trigger in CI
* [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): run locally on your machine
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -65,7 +65,7 @@
/loop check whether CI passed and address any review comments
-In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does.
+In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The list shows its pending wakeup as a one-shot task, so a wakeup scheduled for `:00` or `:30` can run a little early. The seven-day expiry applies to the loop too.
Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later.
@@ -150,7 +150,7 @@
Tool| Purpose
---|---
`CronCreate`| Schedule a new task. Accepts a 5-field cron expression, the prompt to run, and whether it recurs or fires once.
-`CronList`| List all scheduled tasks with their IDs, schedules, and prompts.
+`CronList`| List scheduled tasks with their IDs, schedules, next run times, and prompts.
`CronDelete`| Cancel a task by ID.
Each scheduled task has an 8-character ID you can pass to `CronDelete`. A session can hold up to 50 scheduled tasks at once.
@@ -169,7 +169,7 @@
Jitter
-A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, except a task that runs every five minutes, written `*/5 * * * *`. One-shot tasks scheduled on the hour or half hour run a little early.
+A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, except a task that runs every five minutes, written `*/5 * * * *`. One-shot tasks scheduled on the hour or half hour run a little early. To see when a task is next due, read the row under Claude’s `CronCreate` call in your terminal. The row shows that time after the schedule, for example `next run 10:21 AM`. To check again later, ask Claude to list your tasks and look for `next run` in the rows under the `CronList` call. Next run times in these rows require Claude Code v2.1.299 or later.
####
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -169,7 +169,7 @@
Jitter
-A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, and one-shot tasks scheduled on the hour or half hour run a little early.
+A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, except a task that runs every five minutes, written `*/5 * * * *`. One-shot tasks scheduled on the hour or half hour run a little early.
####
@@ -177,13 +177,20 @@
How late a recurring task runs
-When you create a recurring task, Claude Code gives it a fixed delay and adds that delay to every run. The delay is worked out from the task’s ID, so the same task runs the same number of minutes late each time, including when the session is idle and nothing else is running. Tasks that run more often get shorter delays, and 30 minutes is the longest delay a task can get. These are the delay ranges for some common schedules:
-
-Task runs| Delay is between
----|---
-Every 10 minutes| 0 and 5 minutes
-Every 30 minutes| 0 and 15 minutes
-Every hour, or less often such as daily| 0 and 30 minutes
+Unless it runs every five minutes, a recurring task starts each run late by up to half the gap to the next run, and by at most 30 minutes. Your task is one of these three cases:
+
+ * **Evenly spaced runs** : a task with equal gaps, such as hourly, daily, or every 10 minutes, runs the same number of minutes late every time, including when the session is idle.
+ * **Unevenly spaced runs** : a task with uneven gaps, such as one scheduled for `:00` and `:15` each hour, can run a different number of minutes late at each.
+ * **Every five minutes** : a task written `*/5 * * * *` isn’t delayed. A run exactly five minutes after the last one would start after a five-minute [prompt cache](</docs/en/prompt-caching#which-ttl-each-request-gets>) had expired, so each run starts 15 seconds sooner.
+
+Find your schedule in the first column of this table to see when each of its runs starts.
+
+Schedule| When each run starts
+---|---
+Every 5 minutes, written `*/5 * * * *`, which is what `/loop 5m` creates| 4 minutes 45 seconds after the previous run
+Every 10 minutes| 0 to 5 minutes late
+Every 30 minutes| 0 to 15 minutes late
+Every hour, or less often such as daily| 0 to 30 minutes late
For example, `7,37 * * * *` schedules a task for `:07` and `:37`, which are 30 minutes apart, so its delay is somewhere between 0 and 15 minutes. If this task’s delay is 14 minutes, it runs at `:21` and `:51` every hour. Changing the schedule to a different minute moves the run time, and a delay is still added on top.
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -169,12 +169,31 @@
Jitter
-To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a deterministic offset to fire times:
-
- * Recurring tasks fire up to 30 minutes after the scheduled time (or up to half the interval, for tasks that run more often than hourly). An hourly job scheduled for `:00` may fire anywhere up to `:30`.
- * One-shot tasks scheduled for the top or bottom of the hour fire up to 90 seconds early.
-
-The offset is derived from the task ID, so the same task always gets the same offset. If exact timing matters, pick a minute that is not `:00` or `:30`, for example `3 9 * * *` instead of `0 9 * * *`, and the one-shot jitter will not apply.
+A scheduled task can run at a different time than its schedule says. If every session’s tasks ran exactly on schedule, many of them would call the API at the same moment, so Claude Code shifts each task’s run time. Recurring tasks run late, and one-shot tasks scheduled on the hour or half hour run a little early.
+
+####
+
+
+
+How late a recurring task runs
+
+When you create a recurring task, Claude Code gives it a fixed delay and adds that delay to every run. The delay is worked out from the task’s ID, so the same task runs the same number of minutes late each time, including when the session is idle and nothing else is running. Tasks that run more often get shorter delays, and 30 minutes is the longest delay a task can get. These are the delay ranges for some common schedules:
+
+Task runs| Delay is between
+---|---
+Every 10 minutes| 0 and 5 minutes
+Every 30 minutes| 0 and 15 minutes
+Every hour, or less often such as daily| 0 and 30 minutes
+
+For example, `7,37 * * * *` schedules a task for `:07` and `:37`, which are 30 minutes apart, so its delay is somewhere between 0 and 15 minutes. If this task’s delay is 14 minutes, it runs at `:21` and `:51` every hour. Changing the schedule to a different minute moves the run time, and a delay is still added on top.
+
+####
+
+
+
+When a one-shot task runs early
+
+A one-shot task scheduled for `:00` or `:30` runs up to 90 seconds early. Claude Code doesn’t shift a one-shot task scheduled for any other minute, so when the timing matters, schedule it off the hour and half hour: `3 9 * * *` instead of `0 9 * * *`.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,4 +1,4 @@
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
@@ -67,7 +67,7 @@
In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does.
-Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later. In those cases, on earlier versions, a prompt with no interval runs on a fixed 10-minute schedule, and a `/loop` with no prompt prints the usage message.
+Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later.
###
@@ -221,7 +221,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
- * Starting a fresh conversation clears all session-scoped tasks. When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume.
+ * When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume.
* With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -222,7 +222,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* Starting a fresh conversation clears all session-scoped tasks. When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume.
- * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude` directory. When that directory or the task file in it is a symlink, Claude Code returns an error instead of scheduling the task.
+ * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude/scheduled_tasks.json` file. When the `.claude` directory or that file is a symlink, Claude Code returns an error instead of scheduling the task. A saved task runs only in the project folder where you created it. If you copy the file into another folder, such as a new worktree, sessions there list the copied tasks but don’t run them, so create the task again in that folder.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -145,7 +145,7 @@
cancel the deploy check job
-Under the hood, Claude uses these tools:
+These are the underlying tools Claude uses:
Tool| Purpose
---|---
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,4 +1,4 @@
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. When you resume with `--resume` or `--continue`, Claude Code restores tasks that haven’t expired, except those listed under Limitations. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
@@ -13,7 +13,7 @@
Runs on| Cloud, Anthropic-managed by default| Your machine| Your machine
Requires machine on| No| Yes| Yes
Requires open session| No| No| Yes
-Persistent across restarts| Yes| Yes| Restored on `--resume` if unexpired
+Persistent across restarts| Yes| Yes| Restored on `--resume`, with [exceptions](</docs/en/scheduled-tasks#limitations>)
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
@@ -221,7 +221,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
- * Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores recurring tasks that have not expired and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
+ * Starting a fresh conversation clears all session-scoped tasks. When you resume a session with `claude --resume` or `claude --continue`, Claude Code restores the tasks scheduled with `CronCreate`, except recurring tasks that have expired and one-shot tasks whose scheduled time has passed. A self-paced `/loop` isn’t restored, so run `/loop` again to restart it. Background Bash and monitor tasks are never restored on resume.
* With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude` directory. When that directory or the task file in it is a symlink, Claude Code returns an error instead of scheduling the task.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -65,9 +65,9 @@
/loop check whether CI passed and address any review comments
-When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does.
-
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` behaves differently in two ways: a prompt with no interval runs on a fixed 10-minute schedule instead of a schedule Claude chooses, and `/loop` with no prompt prints the usage message instead of running the maintenance prompt or reading `loop.md`. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
+In a session where the [Monitor tool is available](</docs/en/tools-reference#monitor-tool>), Claude may use it directly when you ask for a dynamic `/loop` schedule. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does.
+
+Dynamically chosen intervals and the built-in maintenance prompt work on every provider, and with [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>) turned off. On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, or with fetching turned off, both require Claude Code v2.1.248 or later. In those cases, on earlier versions, a prompt with no interval runs on a fixed 10-minute schedule, and a `/loop` with no prompt prints the usage message.
###
@@ -93,7 +93,7 @@
Customize the default prompt with loop.md
-Where the built-in maintenance prompt is available, a `loop.md` file replaces it with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and is ignored whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
+Create a `loop.md` file to replace the built-in maintenance prompt with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and Claude Code ignores it whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
Path| Scope
---|---
@@ -117,7 +117,7 @@
Stop a loop
-To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Loops on a fixed interval keep running until you stop them or seven days elapse.
+To stop a self-paced `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Loops on a fixed interval keep running until you cancel them like any other scheduled task or seven days elapse.
##
@@ -222,7 +222,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores recurring tasks that have not expired and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
- * Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink.
+ * With [feature-flag fetching off](</docs/en/env-vars#features-that-need-feature-flag-fetching>), Claude Code stores a task you asked to keep across sessions in the project’s `.claude` directory. When that directory or the task file in it is a symlink, Claude Code returns an error instead of scheduling the task.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,4 +1,4 @@
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn toward a condition rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -36,7 +36,7 @@
Prompt only| `/loop check the deploy`| Your prompt runs at an interval Claude chooses each iteration
Interval only, or nothing| `/loop`| The built-in maintenance prompt runs, or your `loop.md` if one exists
-You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing:
+You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. A scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing:
* Built-in commands such as `/permissions`, `/model`, or `/clear`
* Skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>), including the bundled `/verify` skill
@@ -65,9 +65,9 @@
/loop check whether CI passed and address any review comments
-When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it.
-
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead. Claude Code also uses that fixed schedule when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
+When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does.
+
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` behaves differently in two ways: a prompt with no interval runs on a fixed 10-minute schedule instead of a schedule Claude chooses, and `/loop` with no prompt prints the usage message instead of running the maintenance prompt or reading `loop.md`. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
###
@@ -87,15 +87,13 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
-
###
Customize the default prompt with loop.md
-A `loop.md` file replaces the built-in maintenance prompt with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and is ignored whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
+Where the built-in maintenance prompt is available, a `loop.md` file replaces it with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and is ignored whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
Path| Scope
---|---
@@ -113,15 +111,13 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
-
###
Stop a loop
-To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Before v2.1.202, not rescheduling was the only way Claude could end a loop on its own. Loops on a fixed interval keep running until you stop them or seven days elapse.
+To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Loops on a fixed interval keep running until you stop them or seven days elapse.
##
@@ -226,7 +222,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores recurring tasks that have not expired and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
- * Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink. Before v2.1.216, Claude Code wrote the file through the link.
+ * Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -67,7 +67,7 @@
When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it.
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead. Claude Code also uses that fixed schedule when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
###
@@ -87,7 +87,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
###
@@ -113,7 +113,7 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead. The same happens when you turn off [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>).
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -39,7 +39,7 @@
You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing:
* Built-in commands such as `/permissions`, `/model`, or `/clear`
- * Skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>), including the bundled `/verify` and `/code-review` skills.
+ * Skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>), including the bundled `/verify` skill
* Skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
* [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -225,7 +225,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
- * Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores tasks that have not expired: recurring tasks within seven days of creation, and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
+ * Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores recurring tasks that have not expired and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
* Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink. Before v2.1.216, Claude Code wrote the file through the link.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,4 +1,4 @@
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on Anthropic-managed infrastructure, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on the cloud, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
@@ -10,7 +10,7 @@
| [Cloud](</docs/en/routines>)| [Desktop](</docs/en/desktop-scheduled-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
---|---|---|---
-Runs on| Anthropic cloud| Your machine| Your machine
+Runs on| Cloud, Anthropic-managed by default| Your machine| Your machine
Requires machine on| No| Yes| Yes
Requires open session| No| No| Yes
Persistent across restarts| Yes| Yes| Restored on `--resume` if unexpired
@@ -230,6 +230,6 @@
For cron-driven automation that needs to run unattended:
- * [Routines](</docs/en/routines>): run on Anthropic-managed infrastructure on a schedule, via API call, or on GitHub events
+ * [Routines](</docs/en/routines>): run in the cloud on a schedule, via API call, or on GitHub events
* [GitHub Actions](</docs/en/github-actions>): use a `schedule` trigger in CI
* [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): run locally on your machine
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -38,9 +38,9 @@
You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing:
- * built-in commands such as `/permissions`, `/model`, or `/clear`
- * skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>)
- * skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
+ * Built-in commands such as `/permissions`, `/model`, or `/clear`
+ * Skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>), including the bundled `/verify` and `/code-review` skills.
+ * Skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
* [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`
###
@@ -226,6 +226,7 @@
* Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores tasks that have not expired: recurring tasks within seven days of creation, and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
+ * Claude Code stores the scheduled task list in the project’s `.claude` directory, and scheduling a task fails with an error when that directory, or the task file inside it, is a symlink. Before v2.1.216, Claude Code wrote the file through the link.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -41,7 +41,7 @@
* built-in commands such as `/permissions`, `/model`, or `/clear`
* skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>)
* skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
- * [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`; skills an MCP server exposes still run
+ * [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -67,7 +67,7 @@
When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it.
-On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
###
@@ -87,7 +87,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
###
@@ -113,7 +113,7 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
+On Amazon Bedrock, Claude Platform on AWS, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,5 +1,3 @@
-Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-
Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on Anthropic-managed infrastructure, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -123,7 +123,7 @@
Stop a loop
-To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own by not scheduling the next wakeup once the task is provably complete. Loops on a fixed interval keep running until you stop them or seven days elapse.
+To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own once the task is complete. Claude calls the [`ScheduleWakeup` tool](</docs/en/tools-reference>) with `stop: true`, which cancels the pending wakeup immediately. If an iteration ends without either rescheduling or stopping, Claude Code schedules one fallback wakeup about 20 minutes later and ends the loop when that iteration doesn’t reschedule either. Before v2.1.202, not rescheduling was the only way Claude could end a loop on its own. Loops on a fixed interval keep running until you stop them or seven days elapse.
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -69,7 +69,7 @@
When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it.
-On Bedrock, Vertex AI, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
+On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
###
@@ -89,7 +89,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
+On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
###
@@ -115,7 +115,7 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-On Bedrock, Vertex AI, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
+On Amazon Bedrock, Google Cloud’s Agent Platform, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -38,7 +38,12 @@
Prompt only| `/loop check the deploy`| Your prompt runs at an interval Claude chooses each iteration
Interval only, or nothing| `/loop`| The built-in maintenance prompt runs, or your `loop.md` if one exists
-You can also pass another command as the prompt, for example `/loop 20m /review-pr 1234`, to re-run a saved skill or command each iteration.
+You can also pass a skill as the prompt, for example `/loop 20m /review-pr 1234`, to re-run that skill each iteration. As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](</docs/en/skills#control-who-invokes-a-skill>). The following reach Claude as plain text instead of executing:
+
+ * built-in commands such as `/permissions`, `/model`, or `/clear`
+ * skills marked [`disable-model-invocation: true`](</docs/en/skills#frontmatter-reference>)
+ * skills withheld from Claude by a [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) setting or a `Skill` [deny rule](</docs/en/skills#restrict-claude%E2%80%99s-skill-access>)
+ * [MCP prompts](</docs/en/mcp#use-mcp-prompts-as-commands>) such as `/mcp__github__list_prs`; skills an MCP server exposes still run
###
@@ -220,7 +225,7 @@
Session-scoped scheduling has inherent constraints:
- * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing.
+ * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing. [Backgrounding the session](</docs/en/agent-view#from-inside-a-session>) carries `/loop` tasks over to a background session, which keeps running without a terminal.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores tasks that have not expired: recurring tasks within seven days of creation, and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,9 +1,3 @@
-> ## Documentation Index
->
-> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
->
-> Use this file to discover all available pages before exploring further.
-
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on Anthropic-managed infrastructure, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -44,7 +44,7 @@
Prompt only| `/loop check the deploy`| Your prompt runs at an interval Claude chooses each iteration
Interval only, or nothing| `/loop`| The built-in maintenance prompt runs, or your `loop.md` if one exists
-You can also pass another command as the prompt, for example `/loop 20m /review-pr 1234`, to re-run a packaged workflow each iteration.
+You can also pass another command as the prompt, for example `/loop 20m /review-pr 1234`, to re-run a saved skill or command each iteration.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -90,7 +90,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-The built-in maintenance prompt isn’t available to everyone yet, and isn’t supported on Bedrock, Vertex AI, or Microsoft Foundry. Where it isn’t active, `/loop` with no prompt prints the usage message instead.
+On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of running the maintenance prompt.
###
@@ -116,7 +116,7 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
-`loop.md` follows the same availability as the built-in maintenance prompt. Where the maintenance prompt isn’t active, `/loop` with no prompt prints the usage message and the file isn’t read.
+On Bedrock, Vertex AI, and Microsoft Foundry, `loop.md` isn’t read and `/loop` with no prompt prints the usage message instead.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -90,7 +90,7 @@
A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
-On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of starting the maintenance loop.
+The built-in maintenance prompt isn’t available to everyone yet, and isn’t supported on Bedrock, Vertex AI, or Microsoft Foundry. Where it isn’t active, `/loop` with no prompt prints the usage message instead.
###
@@ -115,6 +115,8 @@
quiet, say so in one line.
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
+
+`loop.md` follows the same availability as the built-in maintenance prompt. Where the maintenance prompt isn’t active, `/loop` with no prompt prints the usage message and the file isn’t read.
###
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -6,7 +6,7 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>) to create a routine on Anthropic-managed infrastructure, set up a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), or use [GitHub Actions](</docs/en/github-actions>).
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -6,7 +6,7 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. To keep the session working turn after turn until a condition is met rather than on an interval, see [`/goal`](</docs/en/goal>). Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
##
@@ -122,7 +122,7 @@
Stop a loop
-To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them.
+To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them. In self-paced mode, Claude can also end the loop on its own by not scheduling the next wakeup once the task is provably complete. Loops on a fixed interval keep running until you stop them or seven days elapse.
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -174,9 +174,9 @@
Jitter
-To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a small deterministic offset to fire times:
-
- * Recurring tasks fire up to 10% of their period late, capped at 15 minutes. An hourly job might fire anywhere from `:00` to `:06`.
+To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a deterministic offset to fire times:
+
+ * Recurring tasks fire up to 30 minutes after the scheduled time (or up to half the interval, for tasks that run more often than hourly). An hourly job scheduled for `:00` may fire anywhere up to `:30`.
* One-shot tasks scheduled for the top or bottom of the hour fire up to 90 seconds early.
The offset is derived from the task ID, so the same task always gets the same offset. If exact timing matters, pick a minute that is not `:00` or `:30`, for example `3 9 * * *` instead of `0 9 * * *`, and the one-shot jitter will not apply.
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,3 +1,9 @@
+> ## Documentation Index
+>
+> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt>
+>
+> Use this file to discover all available pages before exploring further.
+
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -8,7 +8,7 @@
Compare scheduling options
-Claude Code offers three ways to schedule recurring work:
+Claude Code offers three ways to schedule recurring or one-off work:
| [Cloud](</docs/en/routines>)| [Desktop](</docs/en/desktop-scheduled-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
---|---|---|---
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -110,6 +110,14 @@
Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
+###
+
+
+
+Stop a loop
+
+To stop a `/loop` while it is waiting for the next iteration, press `Esc`. This clears the pending wakeup so the loop does not fire again. Tasks you scheduled by asking Claude directly are not affected by `Esc` and stay in place until you delete them.
+
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,6 +1,6 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current conversation and stop when you start a new one. Resuming with `--resume` or `--continue` brings back any task that hasn’t expired: a recurring task created within the last 7 days, or a one-shot whose scheduled time hasn’t passed yet. For scheduling that survives independently of any session, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
##
@@ -15,7 +15,7 @@
Runs on| Anthropic cloud| Your machine| Your machine
Requires machine on| No| Yes| Yes
Requires open session| No| No| Yes
-Persistent across restarts| Yes| Yes| No (session-scoped)
+Persistent across restarts| Yes| Yes| Restored on `--resume` if unexpired
Access to local files| No (fresh clone)| Yes| Yes
MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
@@ -210,9 +210,9 @@
Session-scoped scheduling has inherent constraints:
- * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit cancels everything.
+ * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit stops them firing.
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
- * No persistence across restarts. Restarting Claude Code clears all session-scoped tasks.
+ * Starting a fresh conversation clears all session-scoped tasks. Resuming with `claude --resume` or `claude --continue` restores tasks that have not expired: recurring tasks within seven days of creation, and one-shot tasks whose scheduled time has not yet passed. Background Bash and monitor tasks are never restored on resume.
For cron-driven automation that needs to run unattended:
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,6 +1,6 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Cloud](</docs/en/web-scheduled-tasks>) or [Desktop](</docs/en/desktop-scheduled-tasks>) scheduled tasks, or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Routines](</docs/en/routines>), [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>), or [GitHub Actions](</docs/en/github-actions>).
##
@@ -10,7 +10,7 @@
Claude Code offers three ways to schedule recurring work:
-| [Cloud](</docs/en/web-scheduled-tasks>)| [Desktop](</docs/en/desktop-scheduled-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
+| [Cloud](</docs/en/routines>)| [Desktop](</docs/en/desktop-scheduled-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
---|---|---|---
Runs on| Anthropic cloud| Your machine| Your machine
Requires machine on| No| Yes| Yes
@@ -173,7 +173,7 @@
Seven-day expiry
-Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
+Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Routines](</docs/en/routines>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
##
@@ -216,6 +216,6 @@
For cron-driven automation that needs to run unattended:
- * [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>): run on Anthropic-managed infrastructure
+ * [Routines](</docs/en/routines>): run on Anthropic-managed infrastructure on a schedule, via API call, or on GitHub events
* [GitHub Actions](</docs/en/github-actions>): use a `schedule` trigger in CI
* [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): run locally on your machine
Show diff (122 lines)
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -28,41 +28,87 @@
-Schedule a recurring prompt with /loop
-
-The `/loop` [bundled skill](</docs/en/commands>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
+Run a prompt repeatedly with /loop
+
+The `/loop` [bundled skill](</docs/en/commands>) is the quickest way to run a prompt on repeat while the session stays open. Both the interval and the prompt are optional, and what you provide determines how the loop behaves.
+
+What you provide| Example| What happens
+---|---|---
+Interval and prompt| `/loop 5m check the deploy`| Your prompt runs on a fixed schedule
+Prompt only| `/loop check the deploy`| Your prompt runs at an interval Claude chooses each iteration
+Interval only, or nothing| `/loop`| The built-in maintenance prompt runs, or your `loop.md` if one exists
+
+You can also pass another command as the prompt, for example `/loop 20m /review-pr 1234`, to re-run a packaged workflow each iteration.
+
+###
+
+
+
+Run on a fixed interval
+
+When you supply an interval, Claude converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
/loop 5m check if the deployment finished and tell me what happened
-Claude parses the interval, converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
-
-###
-
-
-
-Interval syntax
-
-Intervals are optional. You can lead with them, trail with them, or leave them out entirely.
-
-Form| Example| Parsed interval
----|---|---
-Leading token| `/loop 30m check the build`| every 30 minutes
-Trailing `every` clause| `/loop check the build every 2 hours`| every 2 hours
-No interval| `/loop check the build`| defaults to every 10 minutes
-
-Supported units are `s` for seconds, `m` for minutes, `h` for hours, and `d` for days. Seconds are rounded up to the nearest minute since cron has one-minute granularity. Intervals that don’t divide evenly into their unit, such as `7m` or `90m`, are rounded to the nearest clean interval and Claude tells you what it picked.
-
-###
-
-
-
-Loop over another command
-
-The scheduled prompt can itself be a command or skill invocation. This is useful for re-running a workflow you’ve already packaged.
-
- /loop 20m /review-pr 1234
-
-Each time the job fires, Claude runs `/review-pr 1234` as if you had typed it.
+The interval can lead the prompt as a bare token like `30m`, or trail it as a clause like `every 2 hours`. Supported units are `s` for seconds, `m` for minutes, `h` for hours, and `d` for days. Seconds are rounded up to the nearest minute since cron has one-minute granularity. Intervals that don’t map to a clean cron step, such as `7m` or `90m`, are rounded to the nearest interval that does and Claude tells you what it picked.
+
+###
+
+
+
+Let Claude choose the interval
+
+When you omit the interval, Claude chooses one dynamically instead of running on a fixed cron schedule. After each iteration it picks a delay between one minute and one hour based on what it observed: short waits while a build is finishing or a PR is active, longer waits when nothing is pending. The chosen delay and the reason for it are printed at the end of each iteration. The example below checks CI and review comments, with Claude waiting longer between iterations once the PR goes quiet:
+
+ /loop check whether CI passed and address any review comments
+
+When you ask for a dynamic `/loop` schedule, Claude may use the [Monitor tool](</docs/en/tools-reference#monitor-tool>) directly. Monitor runs a background script and streams each output line back, which avoids polling altogether and is often more token-efficient and responsive than re-running a prompt on an interval. A dynamically scheduled loop appears in your scheduled task list like any other task, so you can list or cancel it the same way. The jitter rules don’t apply to it, but the seven-day expiry does: the loop ends automatically seven days after you start it.
+
+On Bedrock, Vertex AI, and Microsoft Foundry, a prompt with no interval runs on a fixed 10-minute schedule instead.
+
+###
+
+
+
+Run the built-in maintenance prompt
+
+When you omit the prompt, Claude uses a built-in maintenance prompt instead of one you supply. On each iteration it works through the following, in order:
+
+ * continue any unfinished work from the conversation
+ * tend to the current branch’s pull request: review comments, failed CI runs, merge conflicts
+ * run cleanup passes such as bug hunts or simplification when nothing else is pending
+
+Claude does not start new initiatives outside that scope, and irreversible actions such as pushing or deleting only proceed when they continue something the transcript already authorized.
+
+ /loop
+
+A bare `/loop` runs this prompt at a dynamically chosen interval. Add an interval, for example `/loop 15m`, to run it on a fixed schedule instead. To replace the built-in prompt with your own default, see Customize the default prompt with loop.md.
+
+On Bedrock, Vertex AI, and Microsoft Foundry, `/loop` with no prompt prints the usage message instead of starting the maintenance loop.
+
+###
+
+
+
+Customize the default prompt with loop.md
+
+A `loop.md` file replaces the built-in maintenance prompt with your own instructions. It defines a single default prompt for bare `/loop`, not a list of separate scheduled tasks, and is ignored whenever you supply a prompt on the command line. To schedule additional prompts alongside it, use `/loop <prompt>` or ask Claude directly. Claude looks for the file in two locations and uses the first one it finds.
+
+Path| Scope
+---|---
+`.claude/loop.md`| Project-level. Takes precedence when both files exist.
+`~/.claude/loop.md`| User-level. Applies in any project that does not define its own.
+
+The file is plain Markdown with no required structure. Write it as if you were typing the `/loop` prompt directly. The following example keeps a release branch healthy:
+
+.claude/loop.md
+
+ Check the `release/next` PR. If CI is red, pull the failing job log,
+ diagnose, and push a minimal fix. If new review comments have arrived,
+ address each one and resolve the thread. If everything is green and
+ quiet, say so in one line.
+
+Edits to `loop.md` take effect on the next iteration, so you can refine the instructions while a loop is running. When no `loop.md` exists in either location, the loop falls back to the built-in maintenance prompt. Keep the file concise: content beyond 25,000 bytes is truncated.
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -30,7 +30,7 @@
Schedule a recurring prompt with /loop
-The `/loop` [bundled skill](</docs/en/skills#bundled-skills>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
+The `/loop` [bundled skill](</docs/en/commands>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
/loop 5m check if the deployment finished and tell me what happened
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,6 +1,6 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Cloud](</docs/en/web-scheduled-tasks>) or [Desktop](</docs/en/desktop#schedule-recurring-tasks>) scheduled tasks, or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Cloud](</docs/en/web-scheduled-tasks>) or [Desktop](</docs/en/desktop-scheduled-tasks>) scheduled tasks, or [GitHub Actions](</docs/en/github-actions>).
##
@@ -10,7 +10,7 @@
Claude Code offers three ways to schedule recurring work:
-| [Cloud](</docs/en/web-scheduled-tasks>)| [Desktop](</docs/en/desktop#schedule-recurring-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
+| [Cloud](</docs/en/web-scheduled-tasks>)| [Desktop](</docs/en/desktop-scheduled-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
---|---|---|---
Runs on| Anthropic cloud| Your machine| Your machine
Requires machine on| No| Yes| Yes
@@ -127,7 +127,7 @@
Seven-day expiry
-Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
+Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for durable scheduling.
##
@@ -172,4 +172,4 @@
* [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>): run on Anthropic-managed infrastructure
* [GitHub Actions](</docs/en/github-actions>): use a `schedule` trigger in CI
- * [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>): run locally on your machine
+ * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): run locally on your machine
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -125,9 +125,9 @@
-Three-day expiry
+Seven-day expiry
-Recurring tasks automatically expire 3 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
+Recurring tasks automatically expire 7 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
##
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -32,12 +32,6 @@
The `/loop` [bundled skill](</docs/en/skills#bundled-skills>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/loop 5m check if the deployment finished and tell me what happened
Claude parses the interval, converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
@@ -66,12 +60,6 @@
The scheduled prompt can itself be a command or skill invocation. This is useful for re-running a workflow you’ve already packaged.
-Report incorrect code
-
-Copy
-
-Ask AI
-
/loop 20m /review-pr 1234
Each time the job fires, Claude runs `/review-pr 1234` as if you had typed it.
@@ -84,19 +72,7 @@
For one-shot reminders, describe what you want in natural language instead of using `/loop`. Claude schedules a single-fire task that deletes itself after running.
-Report incorrect code
-
-Copy
-
-Ask AI
-
remind me at 3pm to push the release branch
-
-Report incorrect code
-
-Copy
-
-Ask AI
in 45 minutes, check whether the integration tests passed
@@ -110,19 +86,7 @@
Ask Claude in natural language to list or cancel tasks, or reference the underlying tools directly.
-Report incorrect code
-
-Copy
-
-Ask AI
-
what scheduled tasks do I have?
-
-Report incorrect code
-
-Copy
-
-Ask AI
cancel the deploy check job
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -1,6 +1,28 @@
Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
-Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts and runs without an active terminal session, see [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) or [GitHub Actions](</docs/en/github-actions>).
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts, use [Cloud](</docs/en/web-scheduled-tasks>) or [Desktop](</docs/en/desktop#schedule-recurring-tasks>) scheduled tasks, or [GitHub Actions](</docs/en/github-actions>).
+
+##
+
+
+
+Compare scheduling options
+
+Claude Code offers three ways to schedule recurring work:
+
+| [Cloud](</docs/en/web-scheduled-tasks>)| [Desktop](</docs/en/desktop#schedule-recurring-tasks>)| [`/loop`](</docs/en/scheduled-tasks>)
+---|---|---|---
+Runs on| Anthropic cloud| Your machine| Your machine
+Requires machine on| No| Yes| Yes
+Requires open session| No| No| Yes
+Persistent across restarts| Yes| Yes| No (session-scoped)
+Access to local files| No (fresh clone)| Yes| Yes
+MCP servers| Connectors configured per task| [Config files](</docs/en/mcp>) and connectors| Inherits from session
+Permission prompts| No (runs autonomously)| Configurable per task| Inherits from session
+Customizable schedule| Via `/schedule` in the CLI| Yes| Yes
+Minimum interval| 1 hour| 1 minute| 1 minute
+
+Use **cloud tasks** for work that should run reliably without your machine. Use **Desktop tasks** when you need access to local files and tools. Use **`/loop`** for quick polling during a session.
##
@@ -141,7 +163,7 @@
Three-day expiry
-Recurring tasks automatically expire 3 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
+Recurring tasks automatically expire 3 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>) or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
##
@@ -182,4 +204,8 @@
* No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
* No persistence across restarts. Restarting Claude Code clears all session-scoped tasks.
-For cron-driven automation that needs to run unattended, use a [GitHub Actions workflow](</docs/en/github-actions>) with a `schedule` trigger, or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) if you want a graphical setup flow.
+For cron-driven automation that needs to run unattended:
+
+ * [Cloud scheduled tasks](</docs/en/web-scheduled-tasks>): run on Anthropic-managed infrastructure
+ * [GitHub Actions](</docs/en/github-actions>): use a `schedule` trigger in CI
+ * [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>): run locally on your machine
Show diff (188 lines)
--- a/scheduled-tasks.md
+++ b/scheduled-tasks.md
@@ -0,0 +1,185 @@
+Scheduled tasks require Claude Code v2.1.72 or later. Check your version with `claude --version`.
+
+Scheduled tasks let Claude re-run a prompt automatically on an interval. Use them to poll a deployment, babysit a PR, check back on a long-running build, or remind yourself to do something later in the session. To react to events as they happen instead of polling, see [Channels](</docs/en/channels>): your CI can push the failure into the session directly. Tasks are session-scoped: they live in the current Claude Code process and are gone when you exit. For durable scheduling that survives restarts and runs without an active terminal session, see [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) or [GitHub Actions](</docs/en/github-actions>).
+
+##
+
+
+
+Schedule a recurring prompt with /loop
+
+The `/loop` [bundled skill](</docs/en/skills#bundled-skills>) is the quickest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude sets up a cron job that fires in the background while the session stays open.
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ /loop 5m check if the deployment finished and tell me what happened
+
+Claude parses the interval, converts it to a cron expression, schedules the job, and confirms the cadence and job ID.
+
+###
+
+
+
+Interval syntax
+
+Intervals are optional. You can lead with them, trail with them, or leave them out entirely.
+
+Form| Example| Parsed interval
+---|---|---
+Leading token| `/loop 30m check the build`| every 30 minutes
+Trailing `every` clause| `/loop check the build every 2 hours`| every 2 hours
+No interval| `/loop check the build`| defaults to every 10 minutes
+
+Supported units are `s` for seconds, `m` for minutes, `h` for hours, and `d` for days. Seconds are rounded up to the nearest minute since cron has one-minute granularity. Intervals that don’t divide evenly into their unit, such as `7m` or `90m`, are rounded to the nearest clean interval and Claude tells you what it picked.
+
+###
+
+
+
+Loop over another command
+
+The scheduled prompt can itself be a command or skill invocation. This is useful for re-running a workflow you’ve already packaged.
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ /loop 20m /review-pr 1234
+
+Each time the job fires, Claude runs `/review-pr 1234` as if you had typed it.
+
+##
+
+
+
+Set a one-time reminder
+
+For one-shot reminders, describe what you want in natural language instead of using `/loop`. Claude schedules a single-fire task that deletes itself after running.
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ remind me at 3pm to push the release branch
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ in 45 minutes, check whether the integration tests passed
+
+Claude pins the fire time to a specific minute and hour using a cron expression and confirms when it will fire.
+
+##
+
+
+
+Manage scheduled tasks
+
+Ask Claude in natural language to list or cancel tasks, or reference the underlying tools directly.
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ what scheduled tasks do I have?
+
+Report incorrect code
+
+Copy
+
+Ask AI
+
+ cancel the deploy check job
+
+Under the hood, Claude uses these tools:
+
+Tool| Purpose
+---|---
+`CronCreate`| Schedule a new task. Accepts a 5-field cron expression, the prompt to run, and whether it recurs or fires once.
+`CronList`| List all scheduled tasks with their IDs, schedules, and prompts.
+`CronDelete`| Cancel a task by ID.
+
+Each scheduled task has an 8-character ID you can pass to `CronDelete`. A session can hold up to 50 scheduled tasks at once.
+
+##
+
+
+
+How scheduled tasks run
+
+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 when a task comes due, the prompt waits until the current turn ends. All times are interpreted in your local timezone. A cron expression like `0 9 * * *` means 9am wherever you’re running Claude Code, not UTC.
+
+###
+
+
+
+Jitter
+
+To avoid every session hitting the API at the same wall-clock moment, the scheduler adds a small deterministic offset to fire times:
+
+ * Recurring tasks fire up to 10% of their period late, capped at 15 minutes. An hourly job might fire anywhere from `:00` to `:06`.
+ * One-shot tasks scheduled for the top or bottom of the hour fire up to 90 seconds early.
+
+The offset is derived from the task ID, so the same task always gets the same offset. If exact timing matters, pick a minute that is not `:00` or `:30`, for example `3 9 * * *` instead of `0 9 * * *`, and the one-shot jitter will not apply.
+
+###
+
+
+
+Three-day expiry
+
+Recurring tasks automatically expire 3 days after creation. The task fires one final time, then deletes itself. This bounds how long a forgotten loop can run. If you need a recurring task to last longer, cancel and recreate it before it expires, or use [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) for durable scheduling.
+
+##
+
+
+
+Cron expression reference
+
+`CronCreate` accepts standard 5-field cron expressions: `minute hour day-of-month month day-of-week`. All fields support wildcards (`*`), single values (`5`), steps (`*/15`), ranges (`1-5`), and comma-separated lists (`1,15,30`).
+
+Example| Meaning
+---|---
+`*/5 * * * *`| Every 5 minutes
+`0 * * * *`| Every hour on the hour
+`7 * * * *`| Every hour at 7 minutes past
+`0 9 * * *`| Every day at 9am local
+`0 9 * * 1-5`| Weekdays at 9am local
+`30 14 15 3 *`| March 15 at 2:30pm local
+
+Day-of-week uses `0` or `7` for Sunday through `6` for Saturday. Extended syntax like `L`, `W`, `?`, and name aliases such as `MON` or `JAN` is not supported. When both day-of-month and day-of-week are constrained, a date matches if either field matches. This follows standard vixie-cron semantics.
+
+##
+
+
+
+Disable scheduled tasks
+
+Set `CLAUDE_CODE_DISABLE_CRON=1` in your environment to disable the scheduler entirely. The cron tools and `/loop` become unavailable, and any already-scheduled tasks stop firing. See [Environment variables](</docs/en/env-vars>) for the full list of disable flags.
+
+##
+
+
+
+Limitations
+
+Session-scoped scheduling has inherent constraints:
+
+ * Tasks only fire while Claude Code is running and idle. Closing the terminal or letting the session exit cancels everything.
+ * No catch-up for missed fires. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle, not once per missed interval.
+ * No persistence across restarts. Restarting Claude Code clears all session-scoped tasks.
+
+For cron-driven automation that needs to run unattended, use a [GitHub Actions workflow](</docs/en/github-actions>) with a `schedule` trigger, or [Desktop scheduled tasks](</docs/en/desktop#schedule-recurring-tasks>) if you want a graphical setup flow.