Claude Code Routines: automation that keeps running when your laptop is closed (Aug 2026)
How Schedule/API/GitHub triggers work, and how to create routines with /schedule — per the official research-preview spec.
Source and caveat
Based on `code.claude.com/docs/en/routines`, fetched 2026-08-05. Officially labeled "research preview" — behavior, limits, and the API surface may change.
What routines are
A saved configuration (prompt + repos + connectors) that runs on Anthropic-managed cloud infrastructure, so it keeps working when your laptop is closed. Combines Schedule, API, and GitHub triggers.
Requirements
Pro/Max/Team/Enterprise with Claude Code on the web enabled. Console API keys and cloud-provider logins can't use `/schedule`; sign in with a claude.ai account.
Create from the CLI
Run `/schedule` and describe it in natural language, e.g. "daily PR review at 9am" or a one-off like "in 2 weeks, open a cleanup PR".
/schedule daily PR review at 9amAPI trigger
Each routine gets a dedicated URL and bearer token. The `text` you POST arrives wrapped in a `<routine-fire-payload>` tag as untrusted data — the routine's own prompt must opt in to acting on it.
GitHub trigger
Reacts to pull request or release events, with filters on author, branch, labels, draft state, and more. Each matching event starts a new session.
Limits
Routine runs draw down subscription usage plus a separate daily routine-run cap; one-off runs are exempt from that cap.