What are Claude Code scheduled tasks?
Claude Code scheduled tasks run a prompt automatically on a schedule, so Claude can poll a deploy, review pull requests every morning or remind you of something later. There are three kinds, and the right one depends on whether your machine and session need to stay open.
The scheduling docs compare them like this:
| Cloud | Desktop | /loop |
|
|---|---|---|---|
| Runs on | Anthropic-managed cloud by default | Your machine | Your machine |
| Needs your machine on | No | Yes | Yes |
| Needs an open session | No | No | Yes |
| Survives restarts | Yes | Yes | Restored on --resume, with exceptions |
| Local files | No, fresh clone | Yes | Yes |
| Minimum interval | 1 hour | 1 minute when Claude sets it, 1 hour in the forms | 1 minute |
Anthropic's own rule of thumb: use cloud tasks for work that must run without your machine, Desktop tasks when you need local files and tools, and /loop for quick polling during a session.
How do you run a prompt on repeat with /loop?
/loop is a bundled skill that repeats a prompt while your session stays open. Both parts are optional:
# fixed interval
/loop 5m check if the deployment finished and tell me what happened
# Claude picks the interval each time
/loop check whether CI passed and address any review comments
# re-run a skill
/loop 20m /review-pr 1234
With an interval, Claude converts it to a cron expression and confirms the cadence and job ID. Units are s, m, h and d. Seconds round up to a minute, and intervals like 7m that don't fit a clean cron step are rounded to the nearest one that does.
Without an interval, Claude chooses a delay between one minute and one hour after each run: short while a build is finishing, longer when nothing is happening.
With no prompt at all, a bare /loop runs a built-in maintenance prompt. It continues unfinished work, tends to the current branch's pull request (review comments, failed CI, merge conflicts) and then runs cleanup passes. To replace that default, write your own instructions in .claude/loop.md for one project or ~/.claude/loop.md for all of them. The project file wins, and content beyond 25,000 bytes is truncated.
How do you stop a loop?
- Self-paced loop: press
Escwhile it waits for the next run. - Fixed-interval loop: ask Claude, for example "cancel the deploy check loop."
EscandCtrl+Cdon't stop these.
How do one-time reminders and the cron tools work?
For a single reminder, just ask in plain language:
remind me at 3pm to push the release branch
in 45 minutes, check whether the integration tests passed
Claude schedules a one-shot task that deletes itself after it runs. Under the hood it uses three tools: CronCreate to schedule, CronList to list and CronDelete to cancel by ID. You can ask "what scheduled tasks do I have?" at any time.
A few rules from the docs are worth knowing before you rely on these session tasks:
- Limits: a session holds up to 50 scheduled tasks at once, and each has an 8-character ID.
- Timing: tasks fire between your turns, never mid-response, and use your local timezone.
- Jitter: recurring tasks start a little late on purpose, by up to half the gap to the next run and at most 30 minutes. The exception is an every-five-minutes task (what
/loop 5mcreates), which starts 15 seconds early. One-shot tasks set for:00or:30can run up to 90 seconds early, so pick an odd minute when timing matters. - Seven-day expiry: recurring tasks fire one last time and delete themselves seven days after creation.
- No catch-up: if a run comes due while Claude is busy, it fires once when Claude is idle, not once per missed interval.
- Closing the terminal stops them. Backgrounding the session carries
/looptasks over to a background session.
The cron expressions are the standard five fields: minute, hour, day of month, month, day of week. 0 9 * * 1-5 means weekdays at 9am local time. Names like MON and extended syntax like L are not supported. To turn the scheduler off entirely, set CLAUDE_CODE_DISABLE_CRON=1.
How do Desktop scheduled tasks work?
Desktop scheduled tasks live in the Claude Desktop app and start a fresh session on your machine at the time you choose. Per the Desktop scheduling docs, they need Claude Desktop 1.1.5368 or later.
To create one, open the Code tab, click Scheduled in the sidebar, then New task. Choose Set up manually, name the task, write the instructions, turn on Only on this computer under Advanced settings, pick a local folder and choose a schedule: Hourly, Daily, Weekdays or Weekly. After creating it, the Edit form also offers Manual and Custom cron schedules. You can also just ask in any Desktop session, for example "set up a daily code review that runs every morning at 9am."
Things to plan around:
- Tasks only run while the app is open and the computer is awake. Keep computer awake in settings prevents idle sleep, but closing the lid still sleeps the machine.
- After a sleep, Desktop starts exactly one catch-up run for the most recent missed time in the last seven days. A 9am task may run at 11pm, so add guardrails like "only review today's commits" to the prompt.
- Each task has its own permission mode. A run that needs an unapproved tool stalls until you answer, so click Run now once after creating a task and choose "always allow" for the tools it needs.
- The prompt is stored as a
SKILL.mdfile at~/.claude/scheduled-tasks/<task-name>/, and edits take effect on the next run.
The Desktop app guide covers the rest of the app.
How do cloud scheduled tasks work?
Cloud scheduled tasks, formerly called routines, are saved Claude Code configurations that run on Anthropic-managed infrastructure, so they keep working when your laptop is closed. The cloud scheduled tasks docs say they are in research preview and available on Pro, Max, Team and Enterprise plans.
Each task bundles a prompt, one or more GitHub repositories, a cloud environment and connectors. It can have several triggers:
- Schedule: hourly, daily, weekly or a custom cron, or a one-off run at a set time.
- API: an HTTP POST to the task's own endpoint with a bearer token, useful from alerting tools or deploy scripts.
- GitHub: pull request or release events, with filters such as base branch, labels or draft status. This needs the Claude GitHub App on the repository.
Create one at claude.ai/code/routines, from the Desktop app, or from the CLI:
/schedule daily PR review at 9am
/schedule in 2 weeks, open a cleanup PR that removes the feature flag
/schedule list
/schedule needs a claude.ai subscription login, so it isn't available with a Console API key or a cloud provider. Some details from the docs:
- Prompts must stand alone. The task runs autonomously, so say exactly what to do and what success looks like.
- Branches: each repository is cloned fresh, and Claude pushes to
claude/-prefixed branches unless your prompt says otherwise. - Permissions: runs start in auto mode where it's available, and stop to wait for you on actions that still need approval.
- Identity: tasks belong to your account and act as you, so commits and connector actions carry your name.
- Limits: custom cron schedules can't run more often than once per hour, and scheduled runs are capped at 100 per hour per account.
- A green run isn't success. It only means the session exited without an infrastructure error, so open the run to see what Claude did.
The Claude Code on the web guide explains the cloud sessions these runs use.
Which scheduling option should you use?
- Watching something during a working session:
/loop. - A daily job that needs your local files, tools or uncommitted work: a Desktop task.
- Reliable unattended work tied to a repo, an alert or a pull request: a cloud task.
- A schedule inside your existing CI: Claude Code GitHub Actions with a
scheduletrigger.
Every option spends tokens. An idle /loop still sends your full context each time it fires, so check the Loops rows in /usage. The Claude Code cost guide explains how to read them. To steer a running session from your phone instead of scheduling it, see Claude Code Remote Control.
Keep your scheduled prompts in one place
The prompt is the part of a scheduled task you will keep refining. Kipt stores prompts as Markdown in a private GitHub repo you own, with {{name:default}} blanks for values like a branch or a repo, and you can find any of them with Cmd+K. Paste the current version into /loop, loop.md or a cloud task when you set it up.