Claude Code Routines: What Runs in the Cloud, What Stays on Your Machine, and How to Choose

Routines are Claude Code's way to run a saved prompt without you: on a schedule, on an API call or on a GitHub event, as a cloud session on a fresh clone of your repository. They are in research preview. Claude Code also has two local ways to schedule work, Desktop scheduled tasks and /loop, and the three do not behave alike: minimum interval, access to your local files, permission prompts, what happens when the laptop sleeps. This guide lays out the three with the limits from the documentation, then explains why our own seven nightly agents run on a local machine instead.

Claude Code now has three ways to run a prompt without you typing it, and their names overlap enough to confuse anyone: routines, Desktop scheduled tasks, and /loop. The desktop app even creates the first two from the same page. They differ on the one thing that matters when you automate work: where the agent runs, and therefore what it can see.

This guide goes through the three with the limits written in the documentation (checked on 4 October 2026, routines are in research preview and Anthropic says behavior, limits and the API surface may change). Then it explains what we do ourselves: seven agents start every evening on our side, and none of them is a routine. The reasons are specific, and they may or may not apply to you.

What a routine is

A routine is a saved Claude Code configuration: a prompt, one or more GitHub repositories, and a set of connectors, packaged once and run automatically. It runs on Anthropic-managed cloud infrastructure, or on your organization's self-hosted environment when routed there. Your laptop can be closed.

Each run is a full cloud session. Four consequences follow, and they are the ones to remember:

  • A fresh clone every time. Each repository is cloned at the start of a run, from the default branch. Claude pushes its work to a branch prefixed with claude/ unless your prompt says otherwise. Nothing uncommitted on your machine exists for the routine.
  • No permission prompts. There is no permission-mode picker. The session runs shell commands, uses the skills committed to the repository, and calls every tool of every included connector, writes included, without stopping to ask.
  • Connectors, not your local MCP servers. All the connectors of your claude.ai account are included by default, and the docs tell you to remove the ones the routine does not need. Servers added locally with claude mcp add live on your machine and are not in the list. A committed .mcp.json is the other way in.
  • It acts as you. Routines belong to your individual account. Commits and pull requests carry your GitHub user, Slack messages and Linear tickets use your linked accounts.

Routines are available on Pro, Max, Team and Enterprise plans. You create them at claude.ai/code/routines, from the desktop app (Code tab, Routines, New routine, Cloud), or from the CLI.

The three triggers

A routine can carry one trigger or several at once.

Schedule. Hourly, daily, weekdays or weekly, in your local time, or a single run at a future timestamp. The minimum interval is one hour. One detail from the docs worth knowing: a run scheduled exactly on the hour can start several minutes late, so pick 9:07 instead of 9:00 when timing matters.

API. Each routine gets its own endpoint and its own bearer token, generated on the web (the CLI cannot create or revoke tokens). A POST starts a session and returns its URL:

curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \
  -H "Authorization: Bearer sk-ant-oat01-xxxxx" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"text": "Sentry alert SEN-4521 fired in prod."}'

The text field does not reach the routine as an instruction. It arrives wrapped in a block that labels it as untrusted data, so the saved prompt has to opt in ("investigate the alert described in the routine-fire-payload block"), otherwise the text is inert context. That is the right default: anyone holding the token can send text.

GitHub. Pull request events and release events, with filters on author, title, body, base branch, head branch, labels, draft and merged state. The Claude GitHub App must be installed on the repository. Each event starts its own session, and events beyond the hourly cap are dropped.

From the CLI: /schedule

/schedule creates a scheduled routine by conversation, and /routines is an alias.

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

/schedule update is where a custom cron expression goes. Adding a GitHub trigger from the CLI needs Claude Code v2.1.225 or later; API triggers are web only.

If /schedule answers "Unknown command", the usual cause is authentication: the command requires a claude.ai subscription login. An ANTHROPIC_API_KEY in your shell, an apiKeyHelper in settings.json, or a Bedrock or Vertex login hides it.

The limits to know before you rely on it

Routines draw down your subscription usage like any interactive session. On top of that, each way of starting a run has an hourly cap with no overage:

ActionLimitCounted for
Scheduled runs, one-off runs included100 per hourYour account
Run now, API fires, re-arming a one-off30 per hourEach routine
API fires100 per hourYour account

Three more things from the documentation that bite in practice. A missing or expired GitHub connection makes the routine skip its runs for up to 72 hours, then turn itself off. A paused subscription puts routines on hold. And a green run does not mean the task worked: it means the session started and exited without an infrastructure error.

The two local options

Desktop scheduled tasks are the Local choice of the same New routine button. They run on your machine, with your files as they are, uncommitted changes included, unless you tick the worktree option. Each task has its own permission mode. The catch is in one sentence of the docs: tasks only run while the desktop app is running and your computer is awake. A run that falls during sleep is skipped, and on wake the app starts exactly one catch-up run for the most recent missed time in the last seven days. The prompt lives in ~/.claude/scheduled-tasks/<task-name>/SKILL.md.

/loop repeats a prompt inside one open CLI session: /loop 5m check the deploy. It inherits the session's permissions and MCP servers, holds up to 50 tasks, and a recurring task expires after seven days. Close the terminal and it stops. It is made for babysitting a build or a pull request for an afternoon, not for a nightly job.

Side by side, as the documentation puts it:

Routine (cloud)Desktop scheduled task/loop
Runs onAnthropic's cloudYour machineYour machine
Machine must be onNoYesYes
Open session neededNoNoYes
Local filesNo, fresh cloneYesYes
Permission promptsNonePer taskInherits the session
Minimum interval1 hour1 minute1 minute

How to choose

Three questions settle it.

Does the work live entirely in the repository and behind connectors? Label the issues, review each new pull request, check the docs against merged changes: a routine is the right tool. Nothing to keep awake, and the result arrives as a branch.

Does the work need something that only exists on your machine? A database behind a VPN, a browser where you are signed in, files that are not committed, a local MCP server: stay local. A routine would start from a clone that has none of it.

Does it need to run more often than every hour, or react within the minute? Local again, or the API trigger if an outside system can call it.

Why our seven nightly agents are not routines

We run seven scheduled agents every evening at 20:00 on a Mac mini. They read the day's commits, fix bugs, correct this website, post on social networks and email a report. The full setup and the prompts are in a separate article. When routines appeared, we asked the obvious question: why keep a machine on?

Four reasons, all checked against the docs above.

  1. They work in a shared, uncommitted tree. The agents pull, read each other's reports of the night, and commit as they go. Several of them touch the same checkout in the same hour. A fresh clone per run would lose the handoff between two steps of the same team.
  2. One of them publishes from a real browser. The social agent posts from a Chrome session signed in to three networks. That session is on the machine. A cloud VM has no such browser.
  3. They use local MCP tools. Backlog, project memory, the prompt library and the dev commands are MCP servers of the app running on that machine. They are not claude.ai connectors.
  4. They are not all Claude Code. A routine runs Claude Code on a claude.ai subscription. Our scheduler launches whichever CLI the task names.

So we use AgentsRoom's scheduled tasks: a trigger is a prompt, an agent or a team, and a frequency, launched on a machine we pick. It is an in-app scheduler, not a server: it fires while AgentsRoom is open on that machine, catches up a missed run at the next launch, and can arm the operating system's wake timer for the next run. That is the same constraint as Claude's Desktop scheduled tasks, with the difference that the agent can be Codex, Antigravity or any other CLI, and that a trigger can also fire on a webhook or when a ticket ships.

None of this makes routines the wrong choice. If our nightly work were "review every pull request with our checklist", we would run it as a routine with a GitHub trigger and turn the Mac mini off. And when the need is a disposable machine for one task rather than a recurring job, that is a different tool again, described in what "Claude remote agents" means.

Frequently asked questions

Are Claude Code routines the same as scheduled tasks?

Not quite. A routine runs in the cloud, as a full Claude Code cloud session on a fresh clone of your repository, and it can start on a schedule, on an API call or on a GitHub event. A Desktop scheduled task runs on your own machine with your local files, only while the Claude desktop app is open and the computer is awake. /loop repeats a prompt inside one open CLI session. The Routines page of the desktop app creates the first two: New routine, then Cloud or Local.

How often can a Claude Code routine run?

The minimum interval of a schedule trigger is one hour: a cron expression that fires more often is rejected. The presets are hourly, daily, weekdays and weekly, and /schedule update sets a custom cron expression. Separately from your subscription usage, an account can start 100 scheduled runs per hour, and Run now and API fires are capped at 30 per hour for each routine. Desktop scheduled tasks and /loop go down to one minute.

Do routines need my computer to be on?

No. A routine runs on Anthropic-managed cloud infrastructure, or on a self-hosted environment when your organization routes it there, so it keeps working with the laptop closed. The price is that it does not see your machine: it starts from a fresh clone of the default branch, with the connectors of your claude.ai account and the network access of its cloud environment. MCP servers you added locally with claude mcp add are not available unless you add them as connectors or commit a .mcp.json.

Do routines cost extra?

There is no separate price in the documentation: routines draw down subscription usage the same way interactive sessions do, on Pro, Max, Team and Enterprise plans. When a routine hits your usage limit, further runs are rejected until the window resets, unless usage credits are turned on, in which case they continue on metered overage. The hourly run caps have no overage.

Can a routine run Codex, Antigravity or another CLI?

No. A routine is a saved Claude Code configuration, and /schedule requires a claude.ai subscription login: it is hidden when Claude Code is authenticated with an API key or through a cloud provider. To schedule another CLI you need a scheduler outside Claude Code: cron and the CLI's headless mode, a CI schedule, or a tool that launches agents for any CLI, which is what AgentsRoom's scheduled tasks do.

Why does my routine show green when it did nothing?

Because the status describes the session, not the task. The documentation says it plainly: a green status means the session started and exited without an infrastructure error, not that the task in your prompt succeeded. Blocked network requests, missing connector tools and task-level failures only show in the transcript. Open the run, or ask the CLI: /schedule followed by a question about the routine lists its recent runs and reads the log, on Claude Code v2.1.227 or later.

Download AgentsRoom

Run all your AI agents, on all your projects, from a single window.

FreeDownload AgentsRoom

Companion app: monitor your agents on the go

Bring your own: Claude, Codex, Antigravity CLI, or other AI provider.

Get the extension
Chrome Web Store

Push bugs and requests straight to your public backlog.

Multiple projects
Multi-provider
Multiple agents
Live status
File diff & commit
Mobile companion
Live preview
Agent teams
Browser automation
Backlog-driven dev
Prompt Library
Skills Library
View all features

Keep reading