Claude Code Routines: how they work and where the limits are
A routine is a saved Claude Code task that runs in the cloud on a schedule, from an API call or on GitHub events. How to set one up and where the limits are.

An automation in Zapier or n8n does exactly what you drew: if A happens, do B. If a customer phrases a question slightly differently than you planned for, the flow goes the wrong way. Claude Code Routines flip that around. You give Claude a goal and the means, and it works out how to get there itself, even with your laptop closed.
Anthropic introduced routines on 14 April 2026 as a research preview. This article explains how they work, how to set one up, and the limits that most enthusiastic write-ups leave out.
What are Claude Code Routines?
A routine is a saved Claude Code configuration: a prompt, one or more GitHub repositories and a set of connectors. You set it up once, and from then on it runs automatically on Anthropic's cloud infrastructure. Every run is a full Claude Code session you can read back afterwards.
Routines are available on the Pro, Max, Team and Enterprise plans. You manage them at claude.ai/code/routines, in the desktop app, or from the CLI with /schedule.
The alarm clock, the doorbell and the pull request
A routine starts from a trigger. There are three kinds, and you can combine them.
Schedule: the alarm clock
The routine runs at a fixed time: hourly, daily, on weekdays or weekly. From the CLI you can set a custom cron expression, but nothing more frequent than once an hour. You can also schedule a single run at a specific time, such as "in two weeks, clean up the feature flag".
API: the doorbell
Each routine can get its own HTTP endpoint with a bearer token. Another system (your monitoring, a deploy script, a form via n8n) sends a POST request and the routine starts. You can pass context in the text field, such as the body of an alert.
That text doesn't arrive as a plain instruction. Claude receives it wrapped in a <routine-fire-payload> block that marks it as untrusted data. Claude won't follow instructions inside it unless the routine's own prompt refers to it. So write something explicit like "Answer the request in the routine-fire-payload block", or the text you send stays inert context.
GitHub: the pull request
The routine reacts to events in a repository. During the research preview there are two categories: pull requests (opened, closed, labelled, updated) and releases. Filters on author, title, branch, labels or draft status decide which pull requests start a run. The Claude GitHub App has to be installed on the repository.
How is this different from Zapier, Make or n8n?
Those tools execute a fixed flow. A routine gets a goal and decides for itself which steps it needs: reading files, running commands, calling connectors. That makes it a better fit for work where the input is messy and you can't map out every case in advance.
You don't have to pick one. An n8n flow can catch the form submission and call a routine's API endpoint to do the thinking. The fixed flow handles the plumbing, the routine handles the content.
Setting up your first routine
- Name, prompt and model. Go to claude.ai/code/routines and click New routine. In the desktop app, choose Cloud; Local creates a scheduled task that runs on your own machine. Pick the model every run will use in the prompt field.
- Repositories. Add the GitHub repositories Claude works in. Every run clones them fresh from the default branch. A repository is also a good home for context several routines share, such as a style guide or price list: update the file and the next run reads the new version.
- Environment. The default environment has Trusted network access: only an allowlist of package registries, cloud APIs and similar. If the routine needs to read arbitrary websites, set network access to Custom with your own domains, or to Full. Connectors go through Anthropic's servers and don't need that change.
- Trigger. Choose a schedule, a GitHub event or API. You only get the API token after the routine is saved, and it's shown once.
- Connectors. All your connected connectors are included by default. Remove what the routine doesn't need.
- Test. Click Create, then Run now. Open the session and read what Claude did.
Once set up, an API call looks like this according to the documentation (routine ID and token are placeholders):
curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_.../fire \
-H "Authorization: Bearer sk-ant-oat01-..." \
-H "anthropic-beta: experimental-cc-routine-2026-04-01" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"text": "New enquiry from the contact form: ..."}'A prompt that works without you
A routine can't ask follow-up questions. The prompt has to contain everything a new colleague would need while you're unreachable. Five parts help:
- Role: "You handle new enquiries from the contact form."
- Goal: "Write a personal reply to the enquiry in the routine-fire-payload block."
- Steps: "Read the enquiry, look up the sender's company, use the price list in
docs/prices.md." - Output: "Save the reply as a Gmail draft and post a link in #sales."
- Limits: "Never send an email yourself. Don't promise prices that aren't on the price list."
Safety: the routine doesn't ask permission for anything
A routine has no permission mode. It runs shell commands and uses every tool of every included connector, writes included, without asking. And it all happens as you: commits carry your GitHub name, Slack messages come from your account.
A few rules of thumb follow from that. Have emails and messages saved as drafts so a human sends them. Limit connectors to what's needed. Code changes go to branches prefixed with claude/ by default, and Claude Code refuses to push to a protected branch or to one carrying someone else's commits.
Watch the status indicator too. A green status means the session started and exited without an infrastructure error, not that the task succeeded. A blocked network request or a missing connector only shows up in the transcript.
What does it cost, and how many runs do you get?
Routines draw on your regular subscription usage, just like interactive sessions. On top of that there's a daily cap on how many runs can start per account. At launch, Anthropic listed 5 runs a day for Pro, 15 for Max and 25 for Team and Enterprise. The documentation no longer gives fixed numbers and points to your usage page instead, so check your own limit. One-off scheduled runs don't count. With usage credits you can keep going past the cap on metered billing.
That cap decides which use cases are realistic. A morning briefing costs one run a day. A routine that answers every contact-form submission hits its ceiling on a Pro plan after five enquiries, and one that handles every email to info@ isn't workable that way.
Which tasks suit a routine?
Good fits are tasks that run infrequently, can go unsupervised and produce a result you can check. Anthropic's own examples are mostly development work: labelling and assigning new issues overnight, investigating an alert and opening a draft pull request with a fix, checking every new pull request against your own review checklist, scanning logs after a deploy.
The same patterns work outside software, as long as the systems involved are reachable as a connector or through the API endpoint. Think of a morning overview of calendar and email in Slack, a weekly summary of support tickets, or a weekly check of competitors' websites (with wider network access). A draft reply to a negative review or a polite reminder for an overdue invoice works too, if the system where that event happens can send an HTTP request.
Start with one routine that writes drafts
Pick one recurring task you now do yourself every week, have the routine prepare the result as a draft, and read every transcript in the first week. You'll see where the prompt is unclear before a mistake quietly repeats itself every day.
As of September 2026. Routines are a research preview; behaviour, limits and the API may still change. See the official documentation.


