Claude Routines: Run Claude Code on a Schedule

Claude routines run Claude Code in the cloud on a schedule, API call or GitHub event. How to create, list, update and run them, plus limits and plans.

Josh Pocock11 min read

Claude routines cover

AI Coding

Claude routines

Stride AI Academy

Claude routines are saved Claude Code tasks that run by themselves on Anthropic's cloud: you give one a prompt, one or more GitHub repositories and the connectors it needs, and it runs on a schedule, when you call its API endpoint, or when something happens on GitHub. Because it runs in the cloud, it keeps working when your laptop is closed. You create one with /schedule in Claude Code or at claude.ai/code/routines.

One naming note first. Anthropic now calls the feature cloud scheduled tasks, "formerly routines". The old name is still in the web address, the /routines alias, the API and some app labels, so you'll see both. This post uses "routine" because that's what most people search for. Everything here comes from Anthropic's scheduled tasks docs and the scheduling comparison page, checked November 7, 2026. The feature is in research preview, so limits and screens can change.

Claude routines at a glance

What it is A saved prompt, repositories and connectors that run as a full Claude Code cloud session
Triggers Schedule (recurring or one-off), API call, GitHub event
Create it /schedule in the CLI, claude.ai/code/routines, or the Desktop app's Code tab
Plans Pro, Max, Ultra, Team and Enterprise
Login needed A claude.ai subscription login, not a Console API key or a cloud provider
Shortest schedule Once per hour
Where it runs Anthropic-managed cloud, on a fresh clone of your repositories
Billing Uses your subscription usage, like an interactive session

What a routine is

A routine is a Claude Code configuration you set up once and run over and over. It has four parts:

  • A prompt. The instructions Claude follows on every run. The run has no one watching, so the prompt has to say exactly what to do and what done looks like.
  • Repositories. Each one is cloned at the start of every run. Claude starts on the default branch unless your prompt says otherwise.
  • Connectors. Your claude.ai connectors, such as Slack or Linear, so Claude can read from and write to other services.
  • Triggers. One or more of schedule, API and GitHub. A routine doesn't need a schedule: one with only an API trigger runs when you call it.

Each run is a full cloud session. Claude can run shell commands, use the skills committed to the repository and call the connectors you included. When it changes code, it pushes to a branch that starts with claude/ unless your prompt names another branch.

What happens on each run

  1. 1A trigger firesSchedule, API call or GitHub event
  2. 2Your repositories are cloned fresh
  3. 3Claude runs your saved promptAuto mode, with your connectors
  4. 4Work lands on a claude/ branch or in a connector
  5. 5You review the run in its History

Who can use Claude routines

Routines are on the Pro, Max, Ultra, Team and Enterprise plans. In the CLI, /schedule needs a claude.ai subscription login. With a Console API key, or through Amazon Bedrock, Google Cloud or Microsoft Foundry, the command is hidden. If ANTHROPIC_API_KEY is set in your shell, remove it, because it takes precedence over your claude.ai login. On Team and Enterprise plans, an Owner can turn routines off for the whole organization.

Routines belong to your own account. Teammates can't see them, and anything a run does through GitHub or a connector shows up as you.

How to create a routine from the CLI

Open Claude Code in any project and run:

/schedule

Claude asks about the schedule, the repositories and the prompt, then saves the routine to your claude.ai account. You can also describe it in one line:

/schedule daily PR review at 9am
/schedule in 2 weeks, open a cleanup PR that removes the feature flag

If Claude replies that you need to authenticate, nothing was saved. /routines works as an alias. To add an API trigger to a routine made this way, edit it on the web.

New to the CLI? Start with how to install Claude Code.

How to create a routine on the web

  1. Go to claude.ai/code/routines and click New task (some accounts show New routine).
  2. Name it and write the prompt.
  3. In the Trigger row, pick Schedule, GitHub event or API. Click + to add more than one.
  4. Under Advanced settings, pick the repositories and a cloud environment. The environment sets network access, variables and a setup script.
  5. Pick a model and effort level.
  6. On the Connectors tab, remove every connector the routine doesn't need. All of them are included by default, and Claude can write with any that stay.
  7. Click Create, then Run now to test it.

The web, the Desktop app and the CLI share one account, so a routine made in one shows up in the others.

Schedules: presets, cron and one-off runs

On the web you pick a preset such as hourly, daily or weekly, and enter the time in your local time zone. A few rules from the docs:

  • Avoid the exact hour. A run set for 9:00 can start several minutes late. Pick 9:07 to start close to on time.
  • Custom cron. Create the routine, then choose Custom in its edit dialog, or run /schedule update in the CLI. 0 */2 * * * runs every two hours.
  • Once an hour is the floor. Expressions that run more often than hourly are rejected.
  • Cron is in UTC. A plain five-field expression like 0 9 * * 1-5 means 9:00 AM UTC on weekdays. If the field starts with a CRON_TZ= prefix, write the hours in that zone instead.

A one-off schedule runs once at a set time, then turns itself off and shows as Completed. From the CLI, describe the time in plain words and Claude confirms the exact timestamp before saving:

/schedule tomorrow at 9am, summarize yesterday's merged PRs

API and GitHub triggers

API trigger. Add it on the web in the routine's edit dialog. You get a fire URL and a token, and the token shows only once, so store it straight away. Then any script, monitoring tool or deploy pipeline can start a run:

Terminal
curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_YOUR_ID/fire \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"text": "Deploy 412 finished. Run the smoke checks."}'

The optional text field reaches Claude marked as untrusted data. Claude won't act on it unless your saved prompt tells it to, for example "Investigate the alert in the routine-fire-payload block".

GitHub trigger. Runs a new session when a pull request, release or issue event happens. You can filter pull requests by author, title, branch, labels, draft state and more. The Claude GitHub App has to be installed on the repository. Our guide to Claude Code with GitHub covers connecting your account.

How to list, update and run routines

From the CLI:

/schedule list
/schedule update
/schedule run

list shows your routines, update changes one and run starts one now. You can also ask about past runs, such as /schedule why did my nightly review do nothing this morning?, and Claude reads the run logs to explain (v2.1.227 or later).

On the web, each routine's page has Run now, an on/off switch to pause it, and a menu with Edit and Delete. Click any run under History to open it as a full session, review the changes and open a pull request. A run marked as succeeded only means the session ended cleanly, so read the transcript to see if the work got done.

Where routines run and what they can reach

Runs happen on Anthropic's cloud on a fresh clone, so a routine can't see files on your computer. It reaches only the repositories, network access and connectors you give it.

The Default environment uses Trusted network access. That allows package registries, cloud provider APIs and common development domains, and blocks the rest with a 403. Connectors go through Anthropic's servers, so they work without changes. If a routine needs to reach a client's website or your own API, edit the environment's network access and add those domains. Store API keys as network secrets rather than plain environment variables, because anyone who uses the environment can see the variables.

Runs start in auto mode, where a classifier approves or blocks each action. A run stops and waits for you when an action matches an ask rule or blocks keep repeating. If your GitHub connection expires, the routine skips runs for up to 72 hours, then turns off until you turn it back on.

Usage and limits

Routines use your subscription usage the same way interactive sessions do. On top of that, each way of starting a run has an hourly cap:

Action Limit
Scheduled runs, including one-off runs 100 per hour per account
Run now, API fires and re-running a one-off 30 per hour per routine, shared
Run now and re-running a one-off 100 per hour per account
API fires 100 per hour per account
GitHub events Per-routine and per-account hourly caps

None of these hourly caps has overage. If a routine hits your plan's usage limit, it can keep going on usage credits if you've turned them on. Without them, runs are rejected until your usage window resets. Our Claude Code pricing guide explains how plan usage works.

Routines vs /loop, Desktop tasks and headless mode

Claude Code has three built-in ways to run work on a timer, plus the do-it-yourself route.

Routines (cloud) Desktop scheduled tasks /loop claude -p from cron
Runs on Anthropic's cloud Your machine Your machine Your machine or server
Machine must be on No Yes Yes Yes
Session must be open No No Yes No
Local files No, fresh clone Yes Yes Yes
Shortest interval 1 hour 1 minute when Claude sets it, 1 hour in the forms 1 minute Whatever your scheduler allows
Survives restarts Yes Yes Restored on --resume, and recurring tasks expire after 7 days Yes, it's your own scheduler
  • /loop repeats a prompt in your open session, like /loop 5m check if the deployment finished. Good for watching a build, not for weekly jobs.
  • Desktop scheduled tasks run on your computer. Use them when the job needs your local files.
  • Headless mode is claude -p "prompt" called from your own cron job. You manage the scheduler and logs. See our Claude Code headless mode guide.

Cloud routine or a local schedule?

Routine

Runs without your machine

  • Works with the laptop closed
  • Fresh clone of GitHub repos each run
  • Connectors for Slack, Linear and more
  • Hourly at the most

Local option

/loop, Desktop task or claude -p

  • Needs your machine on
  • Full access to local files and tools
  • Can run every minute
  • You handle reliability

Four routines for a small agency or business

Each prompt below is written to run unattended. Keep the connectors to the ones listed. For more connectors to pair with them, see the best MCP servers for Claude Code.

1. Weekly dependency check. Schedule: weekly, Monday 7:07 AM. Repository: the client's app.

Run npm outdated and npm audit. List each outdated or vulnerable
package with its current and latest version and the severity.
If a patch or minor update fixes a high or critical issue, apply it,
run the tests, and push the change to a claude/ branch with a short
summary. Never apply a major version update. If nothing needs
attention, say so in one line.

2. Weekly report pull request. Schedule: weekly, Friday 3:07 PM. Repository: the project repo.

Summarize every pull request merged in the last 7 days in plain
English for a non-technical client: what changed and why it matters.
Write it to reports/weekly-<today's date>.md and open a pull request
titled "Weekly report <date>". Do not change any other file.

3. Client site check. Schedule: daily, 6:07 AM. Add the client's domain to the environment's allowed domains first, or every request fails.

Request each URL in sitemap-urls.txt. List any page that does not
return 200, and any page whose title tag is missing or empty.
Post the list to the #client-alerts Slack channel. If every page
is fine, post one line saying so.

4. Monday backlog tidy. Schedule: weekly, Monday 8:07 AM. Connectors: your issue tracker and Slack only.

Read the issues opened since last Monday. Label each one by area
using the folder names in this repository, and flag any that look
like duplicates. Post a five-line summary of the new issues to the
#team Slack channel. Do not close or delete any issue.

Test each one with Run now and read the transcript before you trust the schedule.

Start with one routine

Pick a job you do by hand every week, write it as a self-contained prompt and run it as a routine. Keep its connectors and network access tight, and read its History after each early run.

To turn this kind of automation into client work, the Claude Code for agencies course walks through it, and members share their setups in the Claude Code community.

FAQ

What are Claude routines?

Saved Claude Code tasks that run on Anthropic's cloud on a schedule, from an API call or on a GitHub event. Anthropic now calls them cloud scheduled tasks. Each run is a full Claude Code session on a fresh clone of your repositories.

How do I create a routine in Claude Code?

Run /schedule in Claude Code and answer its questions, or pass a description like /schedule daily PR review at 9am. You can also create one at claude.ai/code/routines or in the Desktop app's Code tab.

Do Claude routines run when my computer is off?

Yes. They run on Anthropic-managed cloud infrastructure, so your machine can be off. /loop and Desktop scheduled tasks are the options that need your machine on.

How often can a routine run?

Once per hour at the most. Cron expressions that run more often are rejected. For checks every few minutes, use /loop in an open session.

Which plans include Claude routines?

Pro, Max, Ultra, Team and Enterprise. In the CLI you need to be signed in with your claude.ai account, not a Console API key or a cloud provider.

Do routines cost extra?

No separate fee. Runs use your subscription usage the same way interactive sessions do, and if you hit your limit, runs continue only if usage credits are turned on.

Build it with us in Stride AI Academy

Four courses, weekly live calls and a community of people building and selling AI. Or start with 310+ free guides.

Keep reading

Free AI Coding guides