Claude Code Routines: Schedule, API, and GitHub-Trigger Your AI Agents
Claude Code Routines is Anthropic's new way to run saved Claude Code configurations automatically -- by schedule, API call, or GitHub event. Routines run on Anthropic's cloud infrastructure with a prompt, repo, and MCP connectors. Available in research preview on Pro, Max, Team, and Enterprise plans.
Anthropic shipped Claude Code Routines on April 14, 2026, turning Claude Code from a session you start into a background agent that fires on its own. A Routine is a saved configuration -- a prompt, one or more repos, and a set of MCP connectors -- that runs on Anthropic's cloud whenever a schedule, an HTTP call, or a GitHub event triggers it. The launch lands as a research preview on Pro, Max, Team, and Enterprise plans, with daily run caps and a beta API header that signals breaking changes are still expected.
Update, August 22, 2026. This page has been re-verified against
Anthropic's routines documentation and two things
this article got wrong or that have since changed are corrected below rather than quietly
rewritten. GitHub triggers cover two event categories, not six: pull request and release.
This article originally listed push, issues, check_runs, and discussions as well, and two
of the five recipes below were built on triggers that do not exist; both are rewritten. And
the routines docs no longer publish per-plan daily run numbers -- they point you at a live
counter in your account instead, and describe metered overage for accounts with usage credits
turned on, while the April 14 launch post still lists Pro 5, Max 15, and Team and Enterprise 25
runs per day. Routines is still a research preview.
Key Takeaways
- Routines = saved prompt + repos + MCP connectors + trigger
- Three trigger types: cron schedule, HTTP API endpoint with bearer token, GitHub events (pull request and release only)
- Runs on Anthropic web infrastructure -- no laptop required
- Stateless: every detail must live in the prompt; no memory between runs
- A daily per-account run cap applies; the launch post says Pro 5, Max 15, Team and Enterprise 25 runs per day, and the docs point you at the live in-product counter
- One-off runs scheduled for a single future time do not count against the daily cap
What Is a Claude Code Routine?
A Routine is a packaged Claude Code session you do not have to babysit. Anthropic's framing in the official docs is precise: a saved Claude Code configuration -- a prompt, one or more repositories, and a set of connectors -- packaged once and run automatically. You build it once, point it at a trigger, and Claude does the work in the cloud whenever that trigger fires.
The four ingredients are simple. You give the Routine a prompt that explains the job in plain language. You attach the GitHub repos the prompt should read or write to. You wire in the MCP connectors the prompt will need at runtime -- Slack to post summaries, Linear to file tickets, Asana to update tasks, Google Drive to drop reports, or any of the MCP servers worth plugging into a Routine today. Finally, you pick a trigger that decides when to run it.
The runtime is Claude Code on the web, not your local CLI. That matters: the Routine is not bound to your laptop being open. You can shut your machine and the 3am stale-PR sweep still runs. When you reopen the desktop app you see past sessions in the sidebar, ready to inspect -- a flow described in more detail in the recent Claude desktop redesign coverage.
The Three Ways to Trigger a Routine
A Routine can subscribe to one trigger or all three at the same time. The right choice depends on what kicks the work off in the real world.
Schedule trigger. Use this for cadenced work that does not need to react to anything specific. The web UI offers preset cadences -- hourly, daily, nightly, weekdays, weekly -- and the CLI exposes the full control surface via /schedule update, where you can supply a custom cron string. The minimum interval is 1 hour, so sub-hourly polling is off the table.
HTTP API trigger. Each Routine ships with a unique HTTPS endpoint and a bearer token. Anything that can POST to a URL can fire it: a release script, a Stripe webhook, a Vercel deploy hook, a one-line shell alias. The request can carry an optional text payload, which Claude reads as additional context. The endpoint is gated by a dated beta header, experimental-cc-routine-2026-04-01. The header is dated, which is the conventional Anthropic pattern for signaling that the spec will change; expect a migration window for breaking revisions.
GitHub event trigger. As of August 22, 2026 a Routine can subscribe to two event categories: pull request and release. Within each you either pick a specific action, such as pull_request.opened, or react to every action in the category. Pull request triggers accept filters on author, title, body, base branch, head branch, labels, draft state, and merged state, each paired with an operator (equals, contains, starts with, is one of, is not one of, matches regex). The matches regex operator tests the whole field, so a title filter for anything containing hotfix has to be written .*hotfix.*.
The trigger requires the Claude GitHub App installed on the target repository. /web-setup grants repository access for cloning but does not install the app or enable webhook delivery. Adding a GitHub trigger from the CLI needs Claude Code v2.1.225 or later; the web UI prompts you to install the app when it is missing. During the research preview, GitHub webhook events are also subject to per-routine and per-account hourly caps, and events beyond the limit are dropped rather than queued.
Correction, August 22, 2026. This article originally listed push, issues, check_runs, and discussions alongside pull requests and releases. Anthropic's docs today list only the two categories above, so a "PR shepherd" that fires on pushes and check completions is not something you can build with a GitHub trigger. Use a schedule trigger, or call the HTTP endpoint from a GitHub Action, for anything outside pull requests and releases.
Setting Up Your First Routine
The fastest path is the web UI at claude.ai/code/routines -- it walks you through trigger selection, repo selection, and connector permissions in a single flow. The Claude Code desktop app works too: click Routines in the Code tab sidebar, then New routine, and choose Cloud. Choosing Local there creates a Desktop scheduled task that runs on your machine instead, which is a different product with a one-minute floor rather than the cloud routine's one hour. The Claude Code CLI is the third surface: run /schedule (aliased to /routines) in any session to create one conversationally, or pass the description straight in, as in /schedule daily PR review at 9am. All three write to the same account, so a routine created in one appears in the others. Routines requires Claude Code on the web enabled on your account, and Team and Enterprise owners can switch the whole feature off for their members.
The minimum viable Routine takes four steps. First, write the prompt as if you were briefing a teammate who has never seen the project -- because the Routine is stateless, every detail you assume the model "remembers" from a past conversation has to be in the prompt itself. Second, attach the GitHub repos. More repos means more context to load on every run, so scope tight. Third, enable the MCP connectors the prompt will reference and grant the OAuth scopes they ask for. Fourth, pick the trigger and save.
Once it is live, you can fire a Routine on demand from the web UI to test it before the trigger takes over. For schedule changes, run /schedule update inside an attached Claude Code session to edit the cron string, swap a preset, or pause the Routine without leaving the CLI. Past runs stream into the desktop app's session sidebar, so you can scroll through what Claude did and what it returned, the same way you inspect any other Claude Code conversation.
Five Practical Routines Worth Building This Week
Anthropic's launch post highlighted four use cases -- verifying deployments, triaging alerts, maintaining docs, and proposing code changes for human review -- and the community on day one was already building variants of all four. Here are five concrete Routines a developer can configure today.
1. Nightly stale-PR sweep. Schedule a Routine to fire at 3am local time. Wire in the GitHub and Slack MCP connectors, scope it to your main repo, and prompt it to list every open PR last updated more than 7 days ago, group by author, and post the digest to #engineering. The team sees the list at standup instead of letting old PRs rot.
2. Auto-triage new pull requests. Trigger on the pull request category, action opened, with the draft filter set to false so it skips work in progress. Use just the GitHub MCP. Prompt the Routine to read the diff, classify the area (frontend, API, infra, docs), apply the matching label, request the right reviewer, and comment asking for a test plan when the PR does not have one. Frees the on-call from grooming the queue at 9am. (This recipe originally triggered on issues.opened, which is not a supported event; issue triage needs a scheduled Routine that queries the issue list through the GitHub connector instead.)
3. Docs sync after merges. There is no push trigger, so run this one of two ways: a pull request trigger filtered to is merged = true, or a nightly schedule. Scope it to the repo. Prompt the Routine to diff the day's merged changes against the README, identify any drift between exported APIs and what the docs claim, and -- if there is drift -- open a PR with proposed updates. The PR still requires a human review and merge, which is the point: the Routine surfaces the gap, your team decides what ships.
4. Hourly deploy verification. Schedule it hourly. Attach GitHub and Slack (or the MCP for whichever CI platform you use). Prompt it to read the latest CI run, summarize pass and fail counts, list any new failures with the failing test name, and post the digest to #deploys. This is the deployment-verification example Anthropic called out, scoped tight enough to fit comfortably under the daily caps.
5. Webhook-driven release notes. Trigger via the HTTP API endpoint, called from your release script's last step. Scope to the repo. Prompt it to read every commit since the last tag, group changes by area, write user-facing release notes in your house style, and append the result to CHANGELOG.md via a PR. One curl command at the end of the release script and the notes write themselves.
Routines is not the only tool offering scheduled-and-triggered AI sessions. The comparison with Cursor Automations walks through how each major platform approaches the same five jobs.
What Routines Cannot Do Yet
A research preview is a research preview, and Anthropic was direct about the gaps.
The biggest one is the stateless model. There is no memory between runs. If a Routine ran 10 minutes ago and learned a project convention, the next run starts from scratch. Anything you want it to "know" has to live in the prompt, the repo, or a connector the prompt explicitly queries.
The 1-hour minimum schedule interval rules out sub-hour polling, and the daily cap will bite you if you wire a Routine to a noisy GitHub trigger -- subscribing to every pull request action on a busy monorepo can burn the day's allowance before lunch. The fix is to filter the trigger, or move the work to a schedule-driven Routine that runs once a day on the rolled-up state. The trigger set is also narrower than it looks: pull requests and releases only, so anything driven by pushes, issues, checks, or discussions has to come in through the HTTP endpoint.
Code changes still require human review. A Routine can open a PR, but it cannot merge one. That is intentional: Anthropic is shipping autonomous triggers, not autonomous deployments. The shape matches the broader pattern in the 2026 AI tools landscape so far, where the leading tools are betting on supervised autonomy over full autopilot.
The HTTP API uses a dated beta header today. The spec will change. Plan for at least one migration window in the next 6 months when the header revises. Routines also requires a paid Claude plan with Claude Code on the web enabled -- no free tier, no API-credit-only path.
Pricing and Daily Caps
Routines is bundled into existing Claude paid plans. Runs draw down your normal subscription usage the same way an interactive session does, and on top of that a daily cap limits how many Routine runs can start per account.
Correction, August 22, 2026. This article originally published a per-plan table: Pro 5, Max 15, Team 25, Enterprise 25 runs per day. Those numbers still appear in the April 14 launch post, which says Pro users can run up to 5 routines per day, Max users up to 15, and Team and Enterprise users up to 25, with extra runs available on extra usage. The routines documentation, however, no longer states them. It directs you to your live consumption and remaining daily routine runs at claude.ai/code/routines or claude.ai/settings/usage, so treat the docs and the in-product counter as authoritative and the launch-post figures as the published baseline.
What the docs do specify:
| Behavior | What happens |
|---|---|
| Daily cap reached, usage credits on | Routines keep running on metered overage |
| Daily cap reached, usage credits off | Additional runs are rejected until the window resets |
| One-off run scheduled for a single future time | Does not count against the daily cap; draws normal subscription usage |
| Run already in progress when the cap is reached | Completes; a started run is never cut off |
Usage credits are switched on at claude.ai/settings/usage, or by an admin at claude.ai/admin-settings/usage on Team and Enterprise.
The practical implication is unchanged: treat Routine runs as a budget, not as an always-on resource, and read the remaining-runs counter before wiring a Routine to a trigger that can fire dozens of times a day. Teams making Routines work are picking 2-4 high-value Routines per repo, scoping triggers tightly, and leaning on schedule-driven runs over event-driven ones for anything that does not need real-time response. Start with one Routine, watch what it costs over a week, and add the next one only once you understand the budget shape.
Sources
- Claude Code routines documentation: https://code.claude.com/docs/en/routines (re-verified 2026-08-22)
- Schedule recurring tasks in Claude Code Desktop: https://code.claude.com/docs/en/desktop-scheduled-tasks (read 2026-08-28)
- Claude Code feature availability by plan: https://code.claude.com/docs/en/feature-availability (read 2026-08-22)
- Anthropic launch post, "Introducing routines in Claude Code," April 14, 2026: https://claude.com/blog/introducing-routines-in-claude-code (re-checked 2026-08-22, HTTP 200)
- Trigger a routine via API, Claude Platform API reference: https://platform.claude.com/docs/en/api/claude-code/routines-fire
The trigger categories, filter fields, cap behavior, overage rules, and CLI version requirement above all come from the routines documentation, re-fetched 2026-08-28. The per-plan run numbers this article originally carried are no longer present in the routines documentation; the launch post, re-fetched 2026-08-28, still lists them.
Frequently Asked Questions
How is Claude Code Routines different from GitHub Actions?
GitHub Actions runs deterministic workflows you script step by step. A Routine is a single Claude Code session triggered the same way, but it reasons about the repo and connectors using a natural-language prompt. You write intent, not YAML, and Claude decides which tools to call. Use Actions for compile/test/deploy and Routines for judgment-heavy work like triage and docs sync.
Can I trigger a Routine from an existing CI/CD pipeline?
Yes. Each Routine ships with a unique HTTP endpoint and bearer token, so any pipeline that can POST to a URL can fire it. Add a curl step to your release script to generate release notes, or call the endpoint from a GitHub Action to chain a Routine after deploy. Optional text payloads pass extra context.
Which GitHub events can a Routine subscribe to?
Two categories as of August 22, 2026: pull request and release. Within each you pick a specific action such as pull_request.opened, or react to every action in the category. Pull request triggers accept filters on author, title, body, base and head branch, labels, draft state, and merged state. There is no push, issue, check-run, or discussion trigger.
What happens if a Routine hits the daily cap mid-run?
A started run always completes. The launch post lists 5 runs a day on Pro, 15 on Max, and 25 on Team and Enterprise; the docs give no numbers and point you at your live remaining-runs counter. Above the cap, accounts with usage credits on continue on metered overage, and accounts without them are rejected until the window resets.