CloudCodeTree LogoCloudCodeTree
AI NewsTutorialsAbout
CloudCodeTree Logo
CloudCodeTree
  • AI News
  • Tutorials
  • About
← Back to AI News
From Cron to Cloud Agent: Automate Any Dev Workflow With Claude Code Routines

From Cron to Cloud Agent: Automate Any Dev Workflow With Claude Code Routines

Chris Harper

3 min read

Jul 13, 2026 · 12:13 UTC

AI
Workflow
Claude Code
Agents
Best Practices

Claude Code Routines let you run a full agent on a cron schedule, a webhook call, or a GitHub event — on Anthropic-managed cloud, no laptop or CI runner required.

Some tasks run better unattended: nightly backlog grooming, automated PR review, alert-triggered debugging, docs-drift detection. Routines are Claude Code's answer: a saved configuration (prompt + repositories + connectors + triggers) that runs on Anthropic-managed cloud infrastructure automatically. Available on Pro, Max, Team, and Enterprise.

Three trigger types

1. Schedule (cron-style)

Create from any Claude Code session with /schedule or at claude.ai/code/routines. Built-in frequencies: hourly, daily, weekdays, weekly. Custom intervals via cron expression. One-off runs (fire once, then auto-disable) don't count against the daily routine cap.

/schedule nightly at 11pm, review open PRs and add labels
/schedule in 2 weeks, remove the feature flag from the auth module

2. API trigger (webhook/pipeline)

Each routine gets a dedicated /fire endpoint. POST to it from CI, a monitoring alert, or any script:

curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDE.../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. Stack trace: TypeError at auth.ts:42"}'

The response returns a claude_code_session_url you can open to watch the run live. The routine receives the alert body in text, can correlate it with recent commits, and open a draft PR — no one at a terminal.

3. GitHub event trigger

React to pull_request.opened, pull_request.closed, or release events. Filters narrow which events fire: base branch, draft state, labels, author. Example: a PR review routine set to is draft: false on base: main runs before any human opens the PR.

Key setup rules

  • Claude pushes to claude/-prefixed branches by default; enable Allow unrestricted branch pushes per-repository if needed
  • All connected MCP connectors are included by default — remove any the routine doesn't need (they run with full write access, no approval prompts)
  • Environments control network access; the default allowlist covers package registries and common cloud APIs. Add domains under Settings > Connectors for anything outside it
  • Routines belong to your individual account; commits and PR actions appear under your GitHub identity

Create at claude.ai/code/routines or from the CLI with /schedule. To add an API or GitHub trigger, use the web UI — the CLI handles schedules only.

Sources: Automate work with Routines — Claude Code Docs · Trigger a routine via API — Claude Platform Docs