Work that runs on a clock
Claude Code has three places to run something repeatedly: cloud routines, Desktop scheduled tasks and the in-session /loop. They differ in where they run, how often they can fire and what survives.
Three places, three trade-offs
The first question is not how to schedule something. It is where it will run, because that decides everything else.
- Cloud routines, set up with
/schedule, run without your machine. The minimum interval is 1 hour. - Desktop scheduled tasks run on your machine. When Claude sets one, the minimum is 1 minute.
/loopruns inside an open session.
The rule is plain. If the job must happen when you are not there, it cannot depend on your machine being awake, and that costs you a coarser clock.
What is the shortest interval a cloud routine can use?
/loop in practice
/loop has three forms.
/loop 5m promptruns on a fixed interval./loop promptlets Claude pick the interval each time, which suits work where the right gap depends on what it sees.- A bare
/loopruns a built-in maintenance prompt, or your own.
Your own lives in .claude/loop.md in the project, which wins, or ~/.claude/loop.md for the user. It replaces the default bare-loop prompt, and edits apply on the next iteration, so you can tune a running loop by editing a file.
$ claude> /loop 5m check whether the deploy finished and tell me if it failed✻ Schedules the check every 5 minutes✻ Runs it, reports "still building"# Esc and Ctrl+C will not stop it. Ask Claude to cancel the loop.
That last point surprises people. To stop a fixed-interval loop, ask Claude to cancel it. Esc and Ctrl+C do not.
What a scheduled fire cannot do
A scheduled run has no one to answer it, so it is restricted. It cannot run built-in commands, skills marked disable-model-invocation, or MCP prompts. If your loop prompt depends on a slash command, it will not work the way it does when you type it.
Limits to know:
- A session holds at most 50 scheduled tasks.
- Each has an 8-character ID that
CronDeletetakes, andCronListshows the next run times. - Session tasks are restored on
--resumeunless they expired. The expiry is seven days.
Background work
Scheduling is not the only way to keep work going without you watching. claude --bg starts a background agent. claude --bg --exec 'pytest -x' runs a shell job in the background as a PTY job.
Two neighbours are worth knowing. For reacting to events instead of polling, use Channels. To keep working toward a condition, use /goal. A loop asks "is it time yet?" on a clock. These ask "did something happen?" or "are we there?", which is often what you actually meant.
How do you stop a fixed-interval /loop?
Chapter complete
You've finished chapter 4 of 6 in Parallel and unattended.
Claude Code reads settings from several scopes and merges them by a fixed order. Knowing which file wins, and what belongs in git, is what keeps a team's rules from becoming one person's habits.
Next chapter