Claude Code scheduled tasks re-run a prompt on an interval, and there are three ways to set one up: /loop inside a session, a Desktop task on your machine, or a cloud task on Anthropic-managed infrastructure. As of October 2026 a /loop task needs your session open and expires after 7 days, so anything that must run with your laptop shut belongs in the cloud.
The catch: a /loop task dies after 7 days
Session-scoped tasks are brilliant for short jobs: polling a deployment, babysitting a pull request, checking on a long build, or reminding yourself of something later in the session. They're the wrong tool for anything long-lived, for two reasons.
First, they only run while your session is open on your machine. Close the session and the task stops firing. They're restored when you use --resume or --continue, unless they've expired by then.
Second, recurring tasks expire 7 days after you create them. The task fires one final time, then deletes itself. If you want one to last longer, recreate it before it expires or move it to a cloud or Desktop scheduled task.
Cloud, Desktop and /loop compared
Here's how the three options line up, as of October 2026.
| Option | Runs on | Machine must be on | Session must be open | Shortest interval | Local files |
|---|---|---|---|---|---|
| Cloud | Anthropic-managed infrastructure by default | No | No | 1 hour | No, it works from a fresh clone |
| Desktop | Your machine | Yes | No | 1 minute when Claude sets it, 1 hour in the forms | Yes |
| /loop | Your machine | Yes | Yes | 1 minute | Yes |
The trade-off is simple once you see it laid out. Cloud keeps going with your machine off, but it can't see your local files and won't run more often than hourly. Desktop and /loop can work with your local files and can run every minute, but your machine has to be on. Only /loop needs the session itself to stay open.
If you use the desktop app, my guide to the Claude Code desktop app covers where those tasks live. For cloud sessions, see my walkthrough of Claude Code on the web.
Good jobs for a session task
The docs list the kind of work session-scoped tasks are made for. They all share one thing: you're already at your desk and want Claude to keep an eye on something for you.
- Polling a deployment so you hear when it's finished instead of refreshing a dashboard.
- Babysitting a pull request while reviews and checks come in.
- Checking a long build so you can work on something else meanwhile.
- Reminding yourself of something later in the same session.
If the job fits that pattern, /loop is the quickest option. If it doesn't, here's how I'd choose. Pick cloud when the task has to run with your machine off and an hourly check is often enough. Pick Desktop when it needs your local files and should keep going without an open session. Pick /loop when you're watching something today and want checks as often as every minute.
Setting up a /loop task
- Open a Claude Code session.
- Type /loop with an interval and a prompt, for example /loop 5m check if the deployment finished.
- Claude converts it to a cron expression, schedules it and confirms the cadence and the job ID.
- Before day 7, cancel and recreate it, or move it to a cloud or Desktop task.
The three ways to write a /loop command
- Interval and prompt, such as /loop 5m check the deploy, runs on a fixed schedule.
- Prompt only lets Claude choose a delay between one minute and one hour on each round.
- Interval only, or nothing at all, runs the built-in maintenance prompt or your own loop.md file.
The prompt-only form is handy when you can't predict how long something will take, because Claude sets the gap each time instead of you guessing one up front.
Intervals and how Claude rounds them
You can write intervals in s, m, h or d for seconds, minutes, hours and days. Two rounding rules apply, because scheduling uses cron and cron works to the minute.
- Seconds are rounded up to the nearest minute.
- Intervals that don't map to a clean cron step, such as 7m or 90m, are rounded to the nearest one that does, and Claude tells you which it picked.
For one-shot tasks where timing matters, the docs suggest an off-peak minute: 3 9 * * * rather than 0 9 * * *. I'd follow that for anything that runs at a set time of day.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
What a scheduled fire won't run
This one trips people up. A scheduled fire only runs skills that Claude is allowed to invoke itself. These reach Claude as plain text instead of executing:
- Built-in commands such as /permissions, /model or /clear.
- Skills marked disable-model-invocation: true.
- Skills withheld by a skillOverrides setting or a Skill deny rule.
- MCP prompts.
So if you schedule /clear every hour expecting a fresh context, it won't happen. Claude will just see the words. Build scheduled prompts around plain instructions and skills Claude can call.
To see how it all fits together, read my Claude Mobile App breakdown.
My verdict on Claude Code scheduled tasks
I'd use /loop for anything you're watching today, like a deploy or a pull request, because it's one line and it stops when you're done. I'd use a Desktop task if it needs your local files and your machine's on most of the day. I'd skip both for anything that has to run while your laptop's shut or for longer than a week; that's what cloud tasks are for. And put a reminder in your calendar for day 6 on any /loop task you care about.
Want the details on the other half? Try the Claude Code Review guide.
Frequently asked questions
How long do Claude Code scheduled tasks last?
Recurring session tasks expire 7 days after creation. They fire one final time, then delete themselves.
Do Claude Code scheduled tasks run when my computer is off?
Only cloud tasks. As of October 2026 Desktop and /loop tasks run on your machine, so it has to be on, and /loop also needs the session open.
What's the shortest interval for /loop?
One minute. Seconds are rounded up to the nearest minute, because cron has one-minute granularity.
Can a scheduled task run /clear or /model?
No. Built-in commands such as /permissions, /model and /clear reach Claude as plain text instead of executing.
Do /loop tasks survive a restart?
They're restored on --resume or --continue, as long as they haven't expired.