Skip to main content
Tips

practitioner tip

Choosing Between /loop, Desktop Tasks, and Cloud Tasks

AIErudit angle: Automating recurring AI work is a delivery-planning decision, not a keyboard shortcut — where a task runs determines whether it survives a closed laptop or sees your uncommitted code. Claude Code offers three native schedulers (/loop needs an open session, Desktop tasks need your machine on, Cloud tasks run on Anthropic infrastructure) plus legacy system cron. Knowing the one-line rule for each keeps you from reaching for crontab when a native option fits.

schedulingautomationclaude-codetips
Tip visual

Published: Apr 8, 2026 Updated: 2026-06-01

Original: https://wmedia.es/en/tips/claude-code-schedule-vs-loop-vs-cron

TL;DR Claude Code has three native ways to schedule recurring work — /loop, Desktop tasks, and Cloud tasks — plus the old-school option: system cron with claude -p. The key difference in one line: /loop needs an open session, Desktop tasks need your machine powered on, and Cloud tasks run on Anthropic's infrastructure even when your laptop is off. And if what you're after is not just recurrence but understanding every way to send Claude Code to background (including Agent View for parallel local sessions and headless -p for single-shot), the map of the four mechanisms zooms out one level.

"Recurring task", "cron", "scheduled", and "schedule" get used for different things inside Claude Code. /loop is not /schedule, and neither is the same as setting up a system cron. If you've been mixing them up, here's the difference in a table and the rule for picking one.

Result:

# /loop — watch something while you keep working
> /loop 5m check if the staging deploy finished
Loop started (every 5m). Task ID: loop-a1b2c3

# /schedule — creates a Cloud task
> /schedule daily PR review at 9am
Setting up a scheduled task. Which repo? Which environment?...

The three native options

/loopDesktop taskCloud task
Runs onYour machineYour machineAnthropic cloud
Needs open sessionYesNoNo
Needs machine onYesYesNo
Survives restartNoYesYes
Access to local filesYesYesNo (fresh clone)
Minimum interval1 min1 min1 hour
Auto-expiry7 daysNoNo
How to createCLI: /loop <prompt>Desktop app → Schedule → New task → New local taskCLI: /schedule, or web claude.ai/code/scheduled, or Desktop app → New remote task

To react to events instead of polling inside your active session, none of these is the right answer — for stdout of local processes, Monitor; for external push from other systems, Channels. For the full picture of all 6 autonomous primitives in a 2×3 matrix, see the map.

How to pick (one-line rule)

  • Watching something while you work in your current session → /loop
  • Daily task that needs access to your local code → Desktop task (from the Desktop app)
  • Task that must run even when your laptop is off → Cloud task / Routine (via /schedule in the CLI or from the web)
  • System cron + claude -p → reserve it for rare cases where none of the three native options fits
  • Full local parallel sessions (not just recurrence) → Agent View (claude agents) — outside this tip's scope, but covered in the global map

Setup

1. /loop — during your current session

/loop 15m check open PRs for new comments

Runs in the background while the session stays open. Cancels when you close the terminal and auto-expires after 7 days. Track its progress in the /tasks panel, where it converges with the rest of your parallel work. Full details in the dedicated /loop tip.

2. Desktop task — persistent on your machine

Created only from the Desktop app: Schedule in the sidebar → New task → New local task. You define name, prompt, frequency, permissions, and working folder. You can also ask Claude in natural language inside any Desktop session: "set up a daily code review that runs every morning at 9am".

Runs on your machine with access to your local files (including uncommitted changes) and survives restarts, but needs the computer awake at the scheduled time. If your laptop is asleep at 9am, the run is skipped (with catch-up on wake).

3. Cloud task (Routine) — persistent without your machine

/schedule daily code review at 9am

Claude walks you through it conversationally: you pick the GitHub repo, the prompt, the schedule, the environment (network access, env vars, setup script), and the MCP connectors. The task runs on Anthropic's infrastructure even when your laptop is off, but starts from a fresh clone of the repo — it doesn't see your uncommitted changes. Minimum interval: 1 hour.

You can also create them from claude.ai/code/scheduled or from the Desktop app by picking New remote task.

4. System cron (the old way)

0 9 * * * claude -p "review my PRs" --allowedTools "Bash(gh *)"

Survives everything. No context between runs. Use it only if the three native options don't fit — which today is rare. See the headless mode tip.

Why the three exist

/loop was built for watching inside the session: each iteration sees your context, the files you changed, the whole conversation. That's impossible with system cron, which starts from scratch every time.

Desktop tasks and Cloud tasks were built for unattended, persistent work: things you want to happen even when you close Claude Code. The difference between them is where they run and what they see: Desktop uses your machine and your real files (including uncommitted changes); Cloud uses Anthropic's infrastructure and a fresh clone of the repo.

System cron is still around for historical compatibility and unusual cases, but today the three native options cover 90% of what you need without touching crontab.

Reference

AspectDetail
Session command/loop [interval] <prompt>
Cloud task command/schedule <natural language description>
Desktop tasksOnly from the Desktop app (no equivalent CLI command)
Internal tools (session-scoped)CronCreate, CronList, CronDelete
Cron expression (5 fields)minute hour day-of-month month day-of-week
TimezoneLocal, not UTC
Disable /loop + session cronCLAUDE_CODE_DISABLE_CRON=1

Official docs: Run prompts on a schedule · Cloud scheduled tasks · Desktop scheduled tasks