Source: raw/Claude Code Routines.pdf (Nate Herk walkthrough), Anthropic official blog — Apr 14 2026, raw/reddit-1u7i5ow.md; trigger and standing-job discipline (2026-09-29): raw/How_To_Use_ChatGPT_Work_-_The_Complete_Beginner_s_Guide_2026.md and raw/GPT-6_Astra_Doesn_t_Need_Your_Instructions_Anymore..md (Nate B Jones); business-automation walkthrough (2026-10-28): raw/How_to_Use_Claude_Routines_Better_than_99%_of_People.md (Ben AI, YouTube, https://www.youtube.com/watch?v=LLE6oMh7SxE, 20:27, uploaded 2026-04-25) Authors: Nate Herk (AI Automation Society); Anthropic (official announcement) Published: April 14 2026 (Anthropic announcement); Nate Herk walkthrough April 2026
Routines are saved Claude Code tasks that run on Anthropic’s cloud servers — on a schedule, via API call, or in response to GitHub events — even when your laptop is closed. Announced April 14, 2026 in research preview, they represent the shift from “AI helps me code faster” to “AI handles entire repeatable workflows autonomously.”
Key Takeaways
- Routines run on Anthropic’s cloud, not your machine. Each run clones your repo fresh, works in an isolated environment, and destroys the environment after.
- Three trigger types: Schedule (cron, min 1 hour), API (POST with bearer token), GitHub (18+ event types including PRs, pushes, issues, releases, workflow runs).
- Changes push to
claude/-prefixed branches. Every run creates a reviewable session on claude.ai. - Actions happen as YOU — commits carry your GitHub user, Slack messages use your account.
- CLAUDE.md is read automatically every run because routines clone your repo. This is how you make routines context-aware.
- Routines cannot use local MCP servers. They use Connectors — Anthropic’s managed integrations (Slack, Linear, Jira, Google Drive, GitHub built-in).
- Existing Desktop Scheduled Tasks do NOT migrate. You must recreate them as new routines manually.
- Each run is stateless — no state carries between runs. If step 2 depends on something step 1 saved to disk yesterday, it won’t be there.
- Key advantage over n8n/Zapier/cron: routines inject a prompt into a full Claude Code agentic session with self-correction and context-aware problem solving, not a rigid flowchart.
Routines vs. Existing Options
| Routines (cloud) | Desktop Scheduled Tasks | /loop | |
|---|---|---|---|
| Runs on | Anthropic cloud | Your machine | Your machine |
| Needs machine on | No | Yes | Yes |
| Needs open session | No | No | Yes |
| Survives restarts | Yes | Yes | No |
| Local file access | No (fresh clone) | Yes | Yes |
| Permission prompts | None (fully autonomous) | Configurable | Inherits from session |
| Min interval | 1 hour | 1 minute | 1 minute |
Three Trigger Types
- Schedule: Cron-based (hourly, daily, weekly). Example: “Every weeknight at 9pm, triage new issues.”
- API: POST to a dedicated endpoint with bearer token. Example: “When Sentry fires an alert, Claude diagnoses and opens a fix PR.” Each routine gets a tokened
/fireendpoint for external systems (added Week 16). - GitHub: Reacts to repo events. Example: “On every new PR, run my team’s review checklist.” The trigger picker covers GitHub events with optional filters: author, title, body, base/head branch, labels, draft status, merged status, from fork (filter UI updated Week 16).
- You can combine multiple triggers on one routine (e.g., runs nightly AND on every new PR).
- Scaffold from terminal:
/schedule daily PR review at 9am— a terminal shortcut to define a routine’s schedule without opening the web UI (added Week 16).
Trigger discipline from other agent products (2026-09-29)
Two Nate B Jones videos about OpenAI’s products carry rules that transfer directly to routines. They are his advice, not Anthropic guidance.
- Test every event trigger both ways. From his ChatGPT Work guide: “start by trying a matching example and also trying a non-matching one,” so you know the trigger does the work you want without over-selecting. For a GitHub-triggered routine, that means firing it on a PR that should match the filter and on one that should not before you trust it.^[inferred — the GitHub mapping is this wiki’s; the rule is Jones’s]
- Give every trigger an end condition. “A monitor for a decision next month should not run forever. Say when it can stop. Say what deserves a notification and say what to do when nothing changes.”
- Check what one run costs before you repeat it. Jones says he was once “burning a hundred million tokens a day on repeated runs that I did not fully intend to repeat every day,” and “went to bed with a $300 budget allowance for a task I was working on and all of it got burned overnight and the task still didn’t get done.” A routine draws on normal subscription usage (see Limits and Quotas), so the same failure applies.
raw/How_To_Use_ChatGPT_Work_-_The_Complete_Beginner_s_Guide_2026.md - Six questions before creating a standing job. From his GPT-6 Astra video: “What part of my world am I handing over? What is this agent allowed to read and remember? Where can it get started without me? What can it promise? Who or what is watching it? And will they correct it?” His example of a well-scoped standing job is Vercel’s “ship closer” agent, whose “entire job is to check whether its public change log and its internal launch calendar agree”. When it is confident a launch happened it closes the record; when unsure it follows up in the team’s Slack thread.
raw/GPT-6_Astra_Doesn_t_Need_Your_Instructions_Anymore..md
Environments: The Big Gotcha
Your .env is .gitignored, so the fresh clone won’t have it. Routines solve this with Environments:
- Environment variables: API keys configured at claude.ai, read as normal env vars during the run.
- Network access: Trusted (default, whitelist only), Full (unrestricted outbound), None, or Custom (specific domains).
- Setup script: Install commands that run before each session (
npm install,pip install, etc.).
The .env gotcha: Nate’s first routine failed because scripts looked for .env (reinforced by CLAUDE.md). Fix: explicitly tell the routine “Use environment variables directly. Don’t look for a .env.” General fix: use os.environ["KEY_NAME"] instead of .env loading.
Network gotcha: If your routine needs external APIs (ClickUp, YouTube, etc.), you need Full mode. Trusted blocks those requests. Risk of Full: if Claude reads malicious content (crafted PR description, compromised dependency), it could be tricked into sending data to an external server. Practical risk for private repos where you control inputs: very low.
Connectors
Available at launch:
- Slack: read/post messages, respond to threads
- Linear: create/update issues, read project state
- Jira: ticket management
- Google Drive: read/write docs and files
- GitHub (built-in): PRs, issues, code changes
Each connector authenticates through your account. Nate’s tip: if you just need a notification, a Slack connector is often easier than a custom API call.
What Won’t Work
- Persistent browser sessions: Playwright/Puppeteer requiring login cookies. Environment is destroyed after each run. Workaround: use endpoint with cookie/header/API-key auth.
- Local-only services: Can’t reach localhost databases, local APIs, or machine services.
- Resource-heavy processes: Each run gets 4 vCPUs, 16 GB RAM, 30 GB disk. Exceed memory and the session terminates.
- Stateful workflows: No state between runs.
Limits and Quotas
| Plan | Runs/day |
|---|---|
| Pro | 5 |
| Max | 15 |
| Team | 25 |
| Enterprise | 25 |
- Orgs with extra usage enabled can exceed the cap on metered overage.
- Token budget: each run draws from normal subscription usage.
- Minimum schedule interval: 1 hour.
- Community-reported technique (not official) — usage-window shaping. The 5-hour usage window resets relative to the first message of a fresh session, so scheduling a daily low-cost Haiku “ping” Routine a few hours before your peak work block shifts the reset earlier and frees in-window headroom. Only fires when no session is already live. Dashboard: claude.ai/code/routines. (r/ClaudeAI, u/checkwithanthony, 625 upvotes, 2026-06-16.)
Security
- Branch safety: Default push only to
claude/-prefixed branches. Per-repo toggle for unrestricted (not recommended). - API trigger protection: Each routine gets its own bearer token (shown once, can be regenerated/revoked).
- Token leak risk: Attacker could spam-trigger runs and burn your daily cap. Revoke and regenerate immediately.
- Identity: Everything runs as YOU. Test thoroughly before connecting routines to communication tools.
- Never put
.envin your repo to solve the env var problem. Even in a private repo, history persists and collaborators get exposed.
Writing Good Routine Prompts
- Be specific. “Fix flaky tests” is bad. “Scan src/tests/ for tests that failed intermittently in the last 5 CI runs, identify the root cause, and open a fix PR for each” is good.
- Name the files and directories — Claude clones fresh with no prior context beyond CLAUDE.md.
- State what success looks like.
- Set boundaries (“Only modify files in src/utils/. Do not touch the API layer.”).
- Include the output format (“Push to claude/fix-flaky-tests branch and open a draft PR with summary.”).
- Leverage CLAUDE.md for stable instructions, keep run-specific instructions in the prompt.
- Tell it what to do on failure.
Nate’s W.A.T. framework (Workflows, Agents, Tools): when you push a normal automation to the cloud as a Python script, you lose the Agent. Only workflow and tools survive. With routines, all three stay together.
Use Cases
Event-driven (GitHub triggers):
- PR merge triggers auto-docs update
- PR opened triggers automated code review against CLAUDE.md and style guide
- PRs touching
/auth-providerget flagged and summarized to Slack
Scheduled (cron):
- Nightly bug triage: pull top Linear issue, attempt fix, open draft PR
- Flaky test cleanup, weekly backlog grooming
- Dependency audits, code cleanups, release notes on autopilot
- Weekly docs drift detection
API-triggered:
- CI/CD or Sentry/Grafana alerts trigger Claude to triage and post to oncall
- Post-deploy smoke tests: CD pipeline calls routine, Claude runs checks, posts go/no-go
Skill-first routines for business automations (Ben AI, added 2026-10-28)
Source: raw/How_to_Use_Claude_Routines_Better_than_99%_of_People.md. Creator: Ben AI · URL: https://www.youtube.com/watch?v=LLE6oMh7SxE · Duration: 20:27 · Platform: YouTube · Uploaded: 2026-04-25. Recorded eleven days after launch; trigger options and limits may have changed since.
Ben runs routines for business operations rather than code, and his main rule is that a routine should call a tested skill, not carry a long prompt.
- Where it lives. In the desktop app, switch to the Code tab → Routines (list plus calendar view) → New routine. Local runs only on a schedule and only while the desktop app is open, but can select a local folder: Ben calls it “basically the same thing” as scheduled tasks. Remote runs in the cloud with the laptop closed and is required for API (event) triggers.
- Four parts: the prompt, the trigger (schedule, API or GitHub), the repo and files, and the connectors.
- His three business routines:
- Failed-payment recovery (schedule, daily 7:00 a.m.): a skill checks Stripe for failed payments in the last 24 hours, checks the customer’s activity in his Circle community through its API, checks Gmail for earlier contact, and if there was none drafts a personalised email into Gmail drafts for review.
- Post-discovery-call proposal (event): when Fireflies finishes a sales-call transcript, a skill reads past Gmail threads with the client, drafts the proposal in markdown, fills the PandaDoc template through the PandaDoc MCP (name, company, introduction, scope of work), and saves a Gmail draft with the proposal link.
- Churn recovery and feedback (event): when Stripe reports a churned subscriber, a skill pulls the customer’s tenure from Stripe, Gmail threads and Circle activity, and drafts a personalised win-back or feedback email.
- One session per event. Each trigger starts a fresh session, so 30 churns in an hour become 30 separate runs rather than one overloaded context. Ben sees this as what lets routines handle bulk work (lead qualification, invoice processing) that previously needed n8n.
- No native app triggers yet (April 2026). The only triggers were schedule, GitHub and API, so an event in Stripe or Fireflies needs something in between. Ben uses n8n: a Stripe trigger node (e.g. “customer subscription updated”) → an HTTP Request node built with Import cURL from the routine’s API → See example curl, with the routine’s bearer token under Authorization and the event data (e.g. the churned customer) in the text value. He says Anthropic plans native triggers. See Building n8n Workflows with Claude Code for n8n basics.
- Skills reach remote routines through GitHub. Remote routines cannot see local files or skills. Ask Claude for the skill as a zip, unzip it, upload it to a new private GitHub repo (or ask Claude Code to create the repo), connect the GitHub connector, and select the repo in the routine. If the repo does not appear, grant the GitHub app access to all repositories and restart.
- Custom connectors need their own environment. Native connectors work in the default environment. A custom connector (his PandaDoc setup) needs a new cloud environment with that tool’s credentials in
.envformat; Claude can write the format for you. - Trim connectors per routine. Remove every connector the routine does not need so it cannot act in unrelated tools.
- Limits he lists: what appeared to be a one-hour cap per session, the daily run caps above (beyond them runs bill at API rates), no memory between runs, no team sharing of routine setups (you can share links to individual runs), and the trigger gap above.
His build order (opinion, but consistent with the prompt-writing advice above): (1) build the skill, optionally with a “process interviewer” skill that questions you about the process first; (2) test it with the skill-creator’s evals (“run five tests to make sure this skill actually functions the way it should,” ideally on a real case: his churn test caught a duplicate-email bug); (3) optionally optimise it with an auto-research loop; (4) only then create the routine, with a one-line prompt such as “use the churn recovery skill for this churned client”; (5) test the routine itself a few times. He says many people “will have non-functional routines because they built them with one-shot prompts.”
Implementation
Tool/Service: Claude Code Routines (research preview) Setup:
- Create at claude.ai/code, desktop app, or terminal (via scheduled remote agents)
- Configure: name, prompt, model, GitHub repo, cloud environment, cadence, connectors, permissions
- Create an Environment at claude.ai with env vars, network access, and setup script
- Test with “Run now” and watch live before trusting the schedule
Cost: Included in Pro/Max/Team/Enterprise plans. Runs draw from normal subscription usage. Daily run caps apply (5-25/day by plan). Integration notes: CLAUDE.md is critical — routines read it automatically on every run. Consider a dedicated repo per routine to keep context lean and avoid burning tokens on irrelevant CLAUDE.md content.
Final Setup Checklist
- Use “Run now” and watch the session live
- Verify all API keys are in cloud environment variables (not .env)
- Confirm network access is set correctly (Trusted vs. Full)
- Make sure prompt explicitly tells Claude where to find env vars
- Make sure prompt tells Claude what to do when it hits a wall
- Confirm CLAUDE.md isn’t dragging in irrelevant context
- Test failure paths, not just the happy path
Try It
- Go to claude.ai/code or the desktop app and create your first routine
- Start simple: a scheduled routine that opens a draft PR summarizing your repo’s open issues nightly
- Set up an Environment with any API keys needed
- Use “Run now” to test interactively before enabling the schedule
- Migrate one existing Desktop Scheduled Task to a cloud routine — compare reliability and output quality
- Add a Slack connector so routine results post to a channel for visibility
Related
- Claude Code in the Cloud: Field Guide — Anthropic’s guide to cloud sessions, environments, GitHub setup and routines as one of seven workflows
- What’s New — Week 44 — routines get an effort level in the model picker (v2.1.312)
- Cross-Topic Connections — cross-topic synthesis comparing Routines vs Managed Agents vs Dispatch with a decision framework
- Claude Managed Agents — Anthropic’s hosted agent service (different from routines: managed agents are API-invoked, routines are event-driven)
- Claude Code Subagents — Local parallel workers (routines are the cloud equivalent for scheduled/triggered work)
- Skills vs MCP vs Plugins — Routines use Connectors instead of local MCP servers
- Building Skills Guide — Skills can be used within routine prompts via CLAUDE.md
- Essential MCP Servers — Local MCP servers won’t work in routines; Connectors are the cloud alternative
- Cowork Sales Skills and Bulk Sub-Agents (Ben AI) — the same author’s earlier, desktop-bound versions of these sales automations
- Loop Engineering: Getting Started with Loops — Anthropic’s own post:
/scheduleis what turns a local/loopinto a durable, cloud-hosted “time-based loop”
Open Questions
- How does Anthropic plan to handle MCP server support in routines beyond the current Connector set?
- Will team-plan sharing of routines be supported?
- What is the token budget per run, and are there ways to optimize for cost?
- Will the minimum 1-hour schedule interval decrease as the feature matures?
- Native third-party triggers. Ben (2026-04-25) says Anthropic plans native event triggers for apps such as Stripe; no later source in the wiki confirms they shipped, so an n8n or similar webhook bridge is still assumed.
- Per-session time limit. Ben reports a one-hour limit per routine session (“there seems to be”); not confirmed in Anthropic’s docs ingested here.
- How does routine execution interact with the new Claude Opus 4.7 model’s stricter instruction adherence?