What you will learn in this article

What Claude Code Routines are and what they can do
Steps to create routines from Web, CLI, and Desktop
How to use the three triggers: Schedule, API, and GitHub
Differences from Desktop Scheduled Tasks (local version)
Limitations you should know before using
On April 15, 2026, Anthropic officially released "Claude Code Routines" as a research preview. It is a featured capability that has even reached the number one spot on Hacker News. Simply put, it is a mechanism to run Claude Code as a "cloud-resident agent," allowing tasks like backlog organization and PR reviews to run automatically even when your laptop is closed.
Those who have been using the /loop command or Desktop Scheduled Tasks (local version) might wonder, "So, what is the difference anyway?" In this article, based on the primary source official documentation, I will explain everything from setup and the specific usage of the three triggers to the differences from the local version, without skipping any steps.
What are Claude Code Routines?
Quoting the definition from the official documentation, a routine is a "Claude Code configuration that packages and saves prompts, repositories, and connectors." Once created, it will automatically execute using the following three types of triggers.
Scheduled: Periodic execution such as hourly, daily, or weekly
API: Execution by sending an HTTP POST to a dedicated endpoint
GitHub: Execution in response to repository events such as pull requests or pushes
It is also possible to combine multiple triggers for a single routine; for example, you can consolidate "running at a set time every night," "being called via API after deployment," and "running when a new PR is created" into the same routine.
The execution environment is Anthropic-managed cloud infrastructure, so the key point is that it does not stop even if your local machine is closed.
Supported PlansClaude Code Routines are available on the following plans:
Pro
Max
Team
Enterprise
In all cases, you must have "Claude Code on the web" enabled. It is not available on the free plan.
Creation Steps (via Web)
The management UI is located at claude.ai/code/routines. Creating it from the browser is the easiest way, so I will start by introducing that method.
Step 1. Open a new routineclaude.ai/code/routines and click the New routine button.
Step 2. Set the name and promptEnter the routine name and the prompt you want Claude to execute every time. This is the most important part. Since routines run autonomously without anyone watching, the prompt must be self-contained and clearly define what needs to be done and what success looks like.
There is a model selection below the prompt input field, so you can also specify the execution model here.
Step 3. Select a repositoryAdd one or more GitHub repositories for Claude to work on. Each repository is cloned every time it runs, starting from the default branch.
By default, Claude can only push to branches with the claude/ prefix. This is a safety mechanism to prevent accidental overwriting of protected or long-lived branches. If you want to allow pushes to arbitrary branches, enable Allow unrestricted branch pushes for that repository.
Step 4. Select an environmentSpecify the execution environment for the cloud session. The environment controls the following:
Network access: The level of internet access during execution
Environment variables: Sensitive information such as API keys and tokens
Setup script: Initialization commands that run before the session starts (e.g., dependency installation)
A Default environment is provided from the start, so if you don't need custom settings, you can leave it as is.
Step 5. Choose a triggerSelect a trigger section, choose how to start it. You can use a single type or a combination of multiple. Details for each trigger will be described later.
Step 6. Check ConnectorsAll connected MCP connectors are included by default. You should remove any that are unnecessary for this routine. It is safer to limit them to only the external services the routine needs to access, such as Slack, Linear, or Google Drive.
Step 7. CreateCreate to add the routine to your list. If you want to try it out immediately, you can run it right away by pressing the Run now button on the details page.
Creation Steps (via CLI)
You can create a scheduled routine interactively by running the /schedule command during a session. You can also pass the description directly to the command.
/schedule daily PR review at 9am
You can only create routines with schedule triggers via the CLI. If you want to add API or GitHub triggers, you must edit them via the Web UI after creation.
Management commands for existing routines are also available.
/schedule list: Display a list of routines
/schedule update: Update a routine
/schedule run: Run immediately
Creation Steps (via Desktop App)
From the Schedule page in the Desktop app, select New task → New remote task to open the same form as on the web.
A note of caution here: there is also an option for New local task on the same screen, but this refers to Desktop Scheduled Tasks that run on your local machine. The clear difference is that routines run in the cloud, while local tasks run on your own machine.
How to Use the Three Triggers
Schedule TriggerChoose from preset frequencies (hourly, daily, weekdays only, weekly). You can enter the time in your local time zone, and the cloud side will automatically convert it, so you don't need to worry about time differences.
Limitations:
The minimum execution interval is 1 hour (cron expressions shorter than that will be rejected)
Execution may be delayed by a few minutes due to staggering from the scheduled time (the delay amount is consistent each time)
If you need a custom interval like "every 2 hours" or "the 1st of every month," select the closest preset in the web form, then run /schedule update in the CLI to specify a cron expression.
API TriggerThe API trigger generates a dedicated HTTP endpoint. By sending a POST request to it with a bearer token, a new session will start and the session URL will be returned. Its strength lies in the ability to call Claude Code from "anywhere that can send an HTTP request," such as alert notifications, deployment pipelines, or internal tools.
The steps to add an API trigger are as follows (this must be done via the web; it is currently not possible via the CLI).
claude.ai/code/routines to open the target routine
Open Edit routine from the pencil icon
Select a trigger section, select Add another trigger → API
Copy the URL displayed in the modal, and click Generate token to generate a token
The token is only displayed once, so save it to a secure location immediately
Example call:
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. Stack trace attached."'
The text field in the request body is optional; the string passed here will be appended to the routine's main prompt as an "additional one-time user turn." This is useful for passing alert bodies or failure logs.
Upon success, a JSON response like the following will be returned.
"type": "routine_fire", "claude_code_session_id": "session_01HJKLMNOPQRSTUVWXYZ", "claude_code_session_url": "https://claude.ai/code/session_01HJKLMNOPQRSTUVWXYZ"
Open the claude_code_session_url in your browser to view the running session in real time.
Important: The /fire endpoint can only be called via the beta header experimental-cc-routine-2026-04-01. The request/response format, rate limits, and token specifications may change during the research preview. Breaking changes will be released as new dated headers, and the two most recent versions will maintain compatibility, ensuring time for migration.
GitHub TriggerA session will start in response to GitHub events. Configuration is only possible via the Web UI.
As a prerequisite, you must install the Claude GitHub App on the target repository. Please note that the CLI's /web-setup only grants permissions for cloning; installing the GitHub App and webhook delivery are separate processes. You will be guided to the installation screen when setting up the trigger.
Main event categories you can subscribe to:
Pull request (open/close/label/synchronize, etc.)
Pull request review
Push
Release
Issues
Issue comment
Check run / Check suite
Workflow run / Workflow job
Merge queue entry
Discussion / Discussion comment
You can also set detailed filters for PRs. For example, combinations like the following are possible.
Review only Auth-related PRs: base branch is main and head branch contains auth-provider
Prioritize external contributors: from fork is true
Exclude drafts: is draft is false
Only those with backport labels: labels contain needs-backport
Limitations: During the research preview, there are hourly caps per routine and per account; events exceeding these will be discarded until the window resets. You can check the current limits at claude.ai/code/routines.
Differences from Desktop Scheduled Tasks (Local Version)
This is the most confusing part. The Schedule page in the Desktop app has two types: local task and remote task. The former is the traditional Desktop Scheduled Tasks, and the latter is a routine. The criteria for choosing between them are as follows:
Use cases suited for routines (remote tasks):
You want it to run even when your laptop is closed
You want to trigger it using GitHub events
You want to call it from an external system via API
I want to delegate routine tasks for team repositories
Use cases suitable for Desktop Scheduled Tasks (local tasks):
Access to local files is required
Using tools or environment variables available only locally
Handling data you do not want to send to the cloud
Since routines run in a cloud environment, Desktop Scheduled Tasks are more suitable for cases where you need to read a local Vault or use a local MCP server. Conversely, for "routine tasks you want to run 24/7," it is overwhelmingly easier to shift them to Routines.
Limitations to know before you start
Here is a summary of points you should definitely check before putting them into production.
Linked to a personal accountRoutines are linked to your personal claude.ai account. They cannot be shared with team members. GitHub commits and PRs are recorded as your own GitHub user, and writes to Slack or Linear are done via your own linked accounts. If you want to create shared automations for your team, this point is a common pitfall.
Usage countingRoutine execution consumes the same subscription usage as interactive sessions. In addition, there is a daily execution limit specific to routines. You can check your current consumption and remaining executions at claude.ai/code/routines or claude.ai/settings/usage.
If the limit is reached, organizations with Extra usage enabled can continue running via metered overage, but if disabled, execution will be rejected until the next window.
No permission modeBecause routines run as fully autonomous Claude Code cloud sessions, there is no permission mode selection or approval prompt. The scope that a routine can touch is determined by the selected repository and its branch settings, the environment's network access rights, and the included connectors. It is safer to narrow the scope using the principle of least privilege.
Sessions are independentWith GitHub triggers, a new session is started for every matched event. It does not reuse "one session" for "two pushes"; instead, two independent sessions are created.
Summary
Claude Code Routines is an official feature for shifting the "resident AI" operations you previously handled with /loop or Desktop Scheduled Tasks to the cloud side. Its main strengths are cloud execution that works even when your laptop is closed, the flexibility to combine three types of triggers, and native event integration via the GitHub App.
On the other hand, in cases where local file integration is required or team sharing is a prerequisite, there are situations where existing Desktop Scheduled Tasks or GitHub Actions may be more suitable. We recommend choosing the right tool for the job.
Next Actionsclaude.ai/code/routines to try creating your first one (a nightly repository cleanup is a safe bet)
Try creating one interactively from the CLI, such as /schedule daily PR review at 9am
Audit your existing local recurring tasks to see which ones can be moved to the cloud
Since behavior, limitations, and API specifications may change during the research preview, it is recommended to always check the official documentation for the latest specifications before integrating them into production workflows.