Builder16 min read€5 guide

Put Claude on a schedule: cloud scheduled tasks that run your chores

Set up cloud scheduled tasks that review PRs, check dependencies and triage CI while your laptop is closed, with 5 ready prompts.

Some work is the same every day: read the open pull requests, check for outdated packages, look at why CI went red. This guide is for developers who already use Claude Code in a session and want those chores to run on their own, in the cloud, while the laptop is shut. At the end you will have one working scheduled task, a safe way to scope it, and five tested prompts you can paste in.

A naming note first. Anthropic now calls this feature cloud scheduled tasks. It was called routines until recently, and the old name still shows up in the web address, the API path and some app labels. Both names mean the same thing.

What you will have at the end

  • A cloud scheduled task created from your terminal that runs on a schedule and reports back
  • A prompt structure that works unattended: one output, a stop rule, a never list, a definition of done
  • A task scoped to only the repositories, network hosts and connectors it needs
  • An API trigger your CI can call on failure, and a GitHub trigger that reacts to new issues
  • Five ready task prompts (the attached task-prompts folder): PR digest, dependency check, docs drift, CI triage, issue triage

Before you start

  • A claude.ai account on a Pro, Max, Ultra, Team or Enterprise plan. Those are the plans the docs list for scheduled tasks.
  • Claude Code signed in with that claude.ai account. /schedule needs a subscription login, and an API key in your shell (ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN) takes precedence over it, so remove those first.
  • A GitHub repository connected to Claude, so the task can clone it.
  • For GitHub event triggers later on: the Claude GitHub App installed on that repository. Adding a GitHub trigger from the CLI needs Claude Code v2.1.225 or later (source). Run claude --version to check.
  • On a Team or Enterprise plan: an Owner must not have turned the feature off under Organization settings, Capabilities, Remote sessions (source).

Step 1: pick the right scheduler and create your first task

Claude Code has three ways to run a prompt on a timer, and picking the wrong one is the most common reason a chore stops running. The docs keep a comparison table. In short:

Cloud scheduled task Desktop scheduled task /loop
Where it runs Anthropic's cloud by default Your machine Your machine, inside a session
Needs your machine on No Yes Yes
Sees local files No, it works on a fresh clone Yes Yes
Shortest interval 1 hour 1 minute when Claude sets it, 1 hour in the forms 1 minute

Use /loop to poll something for the next hour while you work. Use a Desktop task when the job needs files or tools that only exist on your computer, and accept that it skips runs while the machine sleeps. Use a cloud task for everything that should simply happen, every day, whether you are at your desk or not. The rest of this guide is about cloud tasks.

Now create one. Open Claude Code in the repository you want the task to work on and run:

/schedule daily PR review at 9am

/schedule creates, updates, lists and runs cloud scheduled tasks, and /routines is an alias for it. Claude does not save anything straight away. It asks follow-up questions about the schedule, the repositories and the prompt, then saves the task to your claude.ai account. If it instead tells you to authenticate, or says it cannot reach your claude.ai account, no task was created (source).

When Claude asks for the prompt, give it something small and read only for this first run:

List the open pull requests in this repository with
gh api "repos/OWNER/REPO/pulls?state=open&per_page=100".
Write one line per pull request: number, title, author, age in days.
If there are none, write "No open pull requests today." and stop.
Do not comment on, label, approve or merge anything.

Replace OWNER/REPO with your repository. Two details in that prompt matter more than they look. It uses gh api instead of gh pr, because in cloud sessions the GitHub proxy rejects gh subcommands that use GraphQL, such as gh pr and gh issue. And it says what to do when there is nothing to do, so a quiet morning ends quietly.

Next, check the task exists and start it once instead of waiting until tomorrow:

/schedule list
/schedule run

/schedule list shows your tasks and /schedule run starts one right now. Every run opens as a full session that you can watch at claude.ai/code/routines: click the task, then the run under History. Read the transcript. If the list of pull requests is there, your first cloud task works, and it will keep running at 9 every day with your laptop closed.

One more thing to know from day one: tasks belong to your own account. They are not shared with teammates, their runs count against your plan's usage, and any commit, comment or message they make shows up as you.

Next

Read next