Claude Routines: Cloud Automations Without Local Hardware

Routines run stateless Claude Code agents on Anthropic servers via prompts, GitHub repos, and triggers like schedules (min 1hr), APIs, or GitHub events—ideal for repetitive tasks like lead triage that self-heal without your machine.

Stateless Cloud Execution Frees You from Local Constraints

Claude Code's Routines execute automations entirely on Anthropic's cloud servers, eliminating the need for your laptop or terminal to stay on. Each run clones your specified GitHub repo(s), processes the task using your prompt and environment variables (e.g., API keys for form submissions), then tears down without persisting state—no cookies, local files, or memory across runs. All actions occur under your account: commits use your GitHub identity, Slack messages come from you.

Access requires Claude Code on the web (Pro/Max/Team/Enterprise plans as of April 14 research preview). Setup via claude.ai/code/routines, desktop app, or CLI (/schedule, but CLI limited to schedules). Prompts must explicitly pull secrets from cloud environment variables (e.g., "use API key from env var, not .env") since repos clone without .env files. Select Sonnet for most tasks, Opus for heavy reasoning. Default network access restricts to Anthropic-vetted domains; switch to full or custom allowlists for others. Connectors (Slack, Linear, Gmail, etc.) auto-include but trim unneeded ones to save tokens.

Resources per run: 4 vCPUs, 16GB RAM, 30GB disk—avoid massive monorepos. Runs draw from your interactive token pool; Pro limits 5/day, Max 15, Team/Enterprise 25 (exceedable with metered overage).

Stackable Triggers for Flexible Automation

Combine three triggers on one Routine for multi-entry workflows:

  • Schedules: Hourly min interval (local timezone auto-conversion); pick daily/weekly or use CLI cron for custom (e.g., every 2hrs).
  • API Endpoints: Each Routine gets a unique HTTP POST endpoint + bearer token. Append dynamic context via body text (e.g., error alerts trigger deploys). Responses include session ID/URL to watch real-time execution.
  • GitHub Events: Fires on PRs/pushes/issues; filter by author/branch. Requires separate Claude GitHub app install per repo (web setup insufficient).

Example: Nightly PR sweeps + deploy-script API calls + new-issue triggers all use the same prompt/repo.

Test with "Run Now" before scheduling; view green-check logs for full tool calls/decisions.

Production Tips and Trade-offs vs Local Tasks

Routines excel where scripts fail: full Claude agent reads claude.md/skills, reasons through errors, self-heals (e.g., API outage? Retry alternate). Migrate Zapier/N8N workflows by pasting JSON into a prompt for conversion.

Key setups:

  1. Lean repo per Routine (trim irrelevant claude.md context).
  2. Pre-run setup scripts in Claude env for packages/CLIs (avoids per-run installs).
  3. Failure fallbacks: Prompt "If step fails, Slack/text details."

Use cases: Morning lead triage (scan 24hr forms, draft Slack responses pre-wakeup), client reporting, pipeline cleanup—offload team's first 2hrs of drudgery.

Don't migrate everything: Routines suit API-only stateless jobs (hourly+). Keep local tasks for browser sessions/local files (min 1min loops). CLI /loop for session-bound checks. Hybrid view in app distinguishes local (top) vs remote (bottom).

Summarized by x-ai/grok-4.1-fast via openrouter

6593 input / 1465 output tokens in 22163ms

© 2026 Edge