# Scheduled Claude Code tasks: /loop, cloud routines, and automations

Schedule Claude Code for a weekly documentation check or a short CI watch. Choose between /loop, local Desktop tasks, Anthropic cloud routines, and Replicas automations based on what must stay running and what the agent needs to access.

- Canonical: https://replicas.dev/resources/scheduled-claude-code-tasks

## Which Claude Code scheduler should you use?

Start with the job: does it need your uncommitted files, or should it run while your laptop is closed? A five-minute CI watch and a weekly repository audit need different schedulers. Checked October 6, 2026. Replicas publishes this guide and is one of the options below.

| Option | Laptop can be off? | Use it for | Setup requirement |
| --- | --- | --- | --- |
| /loop | No, when running locally | Polling during an active session | A running Claude Code session |
| Desktop local task | No | Recurring work on local files and tools | Your machine and Claude Desktop running |
| Anthropic cloud routine | Yes | Scheduled repository work in Claude Code | Claude account, repository, cloud environment |
| Replicas automation | Yes | Team maintenance in configured cloud workspaces | Replicas environment, repository, Claude Code credentials |

### Official scheduling comparison

Source: https://code.claude.com/docs/en/scheduled-tasks

Anthropic separates session loops, Desktop tasks, and cloud routines. A session loop is useful for a short watch; it is not a replacement for a durable weekly schedule.

## Use /loop for a short CI watch

In an existing Claude Code session, enter: /loop 5m check the CI status of PR 123 and report any new failures; do not push changes or merge it.

Use an explicit interval and prompt so the watch has a clear scope. Ask Claude to list scheduled tasks and cancel the job when you finish.

- Local loops need Claude Code running. They do not execute while the computer sleeps.
- Recurring session tasks expire seven days after creation. With claude --resume or claude --continue, tasks created with CronCreate are restored unless expired or a one-shot task’s scheduled time has passed. Self-paced loops must be restarted.
- Busy sessions do not replay every missed interval. Use a CI event trigger when you need to respond to each failure.

## Set up a weekly Anthropic cloud routine

Choose this path if you want hosted Claude Code scheduling with your Claude account. Routines are a research preview on Pro, Max, Team, and Enterprise. Runs use your account’s plan limits; the minimum recurring interval is one hour. Check the linked documentation for current availability and limits.

### Create a routine in Claude Code

Source: https://code.claude.com/docs/en/routines

Open claude.ai/code/routines, choose New routine, name the job, and paste a self-contained prompt. Select the repository and a cloud environment with the dependencies and network access the job needs. Add a weekly schedule and check its timezone. Remove connectors the job does not need.

Save it, then use Run now. Inspect the resulting session and changes before relying on the schedule. Each run starts from a fresh clone rather than your local working tree. You can also create a scheduled routine conversationally with /schedule in a supported CLI version.

## Example: a documentation-drift check

Start with one repository and a weekly schedule. Replace the paths and test command to match your repository.

- **Task prompt:** Inspect commits merged to the default branch in the last seven days. Compare changes to public APIs and configuration with docs/ and README.md. Fix only documentation you can prove is stale from the code. Do not modify runtime code, add features, publish, or merge. Before creating a branch, look for an open PR for the same correction and skip duplicates. If no correction is needed, return a short no-change report. Otherwise run the repository documentation checks, open one draft PR, and include the source commit, changed paths, check results, and anything you could not verify.
- **Environment setup:** Provide repository access, the documentation build tools, and the exact check command in the repository instructions. Keep the initial job limited to committed code and docs so it does not depend on another session’s memory.
- **Acceptance check:** Run it manually against a known documentation mismatch. Confirm the diff fixes that mismatch, the checks actually ran, and the output links the source commit. Run it again to check that the existing draft PR prevents another duplicate.

- A successful scheduler fire is not evidence that the documentation check succeeded. Read the run output and checks.
- Review the first few runs before expanding the prompt to more repositories or enabling writes to other systems.

## Run the same job with a Replicas automation

Use Replicas when your team wants the job in its configured agent environments and a workspace it can inspect and steer. Compare the platform plan and agent usage costs before choosing; a hosted schedule alone may already meet your needs.

### Configure the automation

Source: https://docs.replicas.dev/features/automations

Create an automation with the prompt above, select the repository and environment, and explicitly choose Claude Code under the agent overrides. Add a weekly schedule, check the displayed timezone, and use a new workspace each run for this repository audit. Choose sleep or archive when done so the workspace does not stay active unnecessarily.

Trigger a manual run and inspect its workspace, diff, and check output. Replicas schedules have a minimum recurring interval of 60 minutes. Use a GitHub event trigger for PR activity instead of trying to reproduce a five-minute /loop schedule.

## When a scheduled task does not produce useful work

Separate the trigger, environment, and task outcome. A run can start on time but fail because dependencies, repository access, or a required connector are missing.

- **Nothing starts:** Check that the schedule is enabled and its timezone matches your expectation. For local work, confirm the machine and required app or session are still running.
- **Run starts but cannot check docs:** Read the command output. Confirm setup installed the documentation tools and that credentials and network access cover the repository and any required services.
- **Repeated PRs or broad changes:** Narrow the prompt to one repository and one kind of correction. Require an existing-PR check and a no-change result when there is no proven mismatch.
- **Usage grows without useful changes:** Reduce the frequency, pause the schedule while debugging, and inspect completed runs. Review platform and inference usage separately where they are billed separately.

## FAQ

### Can Claude Code run scheduled tasks with my laptop closed?
Yes, with cloud routines or a hosted platform such as Replicas. A local /loop session and local Desktop scheduled tasks need your machine running.

### Is /loop the same as a cloud routine?
No. /loop repeats work inside a running session. A cloud routine saves a prompt, repositories, environment, and triggers for independent runs.

### How should I test a weekly task before enabling it?
Run it manually against a known case, inspect the changes and actual check output, then run it again to verify duplicate handling.

## Related docs

- [Claude Code in the cloud](https://replicas.dev/resources/claude-code-in-the-cloud): Compare hosted and self-managed Claude Code environments.
- [Claude Code session scheduling](https://code.claude.com/docs/en/scheduled-tasks): Official /loop behavior and limitations.
- [Claude Code routines](https://code.claude.com/docs/en/routines): Official cloud routine setup, triggers, and usage limits.
- [Replicas automations](https://docs.replicas.dev/features/automations): Environment, agent, schedule, and workspace controls.
- [Replicas pricing](https://replicas.dev/pricing): Check platform costs before choosing a hosted workflow.
