Every weeknight at 11pm, a Claude session wakes up on Anthropic's cloud, reads the issues my team opened that day, labels them, assigns owners, and posts a summary to Slack. My laptop is closed. I set this up once, in about three minutes, with one command.
Key Takeaways
- A routine is a saved Claude Code configuration — prompt + repos + connectors — that runs automatically in the cloud
- Three trigger types: schedule (hourly/nightly/weekly), API endpoint (POST to fire), and GitHub events (PR opened, release published)
- Create one with
/schedulein your terminal or at claude.ai/code/routines - Runs work with your laptop closed — they execute on Anthropic-managed infrastructure
- Daily run caps apply: 5/day on Pro, 15 on Max, 25 on Team and Enterprise
The mental shift
Most Claude Code use is conversational: you ask, it does, you watch. Routines flip that. You describe a job once, attach a trigger, and the work happens whether you're around or not. Each run is a full cloud session — it clones your repos, runs shell commands, uses your connectors — and you can open any run afterwards to read exactly what happened.
Setting one up from the terminal
The fastest path is the /schedule command inside any session:
/schedule daily PR review at 9am
Claude walks you through the rest conversationally: which repos, which connectors, what the prompt should say. One-off reminders work too:
/schedule in 2 weeks, open a cleanup PR that removes the feature flag
Manage existing routines with/schedule list,/schedule update, and/schedule run.
Three triggers, three workflows
Schedule — the classic. Nightly backlog grooming, weekly docs-drift checks. Minimum interval is one hour; for custom cron expressions (every 2 hours, first of the month), create with a preset then refine via /schedule update.
API — each routine can expose its own HTTPS endpoint with a bearer token. Your monitoring tool POSTs the alert body when an error threshold trips; the routine pulls the stack trace, correlates with recent commits, and opens a draft PR with a proposed fix. On-call reviews a PR instead of starting from a blank terminal.
GitHub events — run on pull_request.opened with filters (author, labels, base branch, draft status). The team-specific review checklist that no generic bot knows about? That's a routine.
What I'd tell you before you build one
💡 The prompt is everything. Routines run autonomously — no permission prompts, no clarifying questions. Write the prompt like instructions for a contractor you'll never meet: what to do, what success looks like, what to do with the results.
💡 Trim the connectors. All your connected MCP connectors are included by default, and the routine can use every tool on them — including writes — without asking. Remove what the job doesn't need.
💡 Runs act as you. Commits carry your GitHub identity; Slack messages come from your linked account. Worth knowing before you point one at a shared channel.
⚠️ 🔍 From the docs: a green status in the run list only means the session exited without infrastructure errors — not that the task succeeded. Open the transcript to confirm what actually happened. Blocked network requests surface there, not in the status dot.
⚠️ 🔍 From the docs: if/scheduleshows "Unknown command", you're likely authenticated with an API key instead of a claude.ai login, or a telemetry-disabling environment variable is set. The web UI at claude.ai/code/routines always works.
What routines can't do
❌ No sub-hour schedules — expressions that run more frequently than hourly are rejected.
❌ They can't reach your local machine. Need local files or uncommitted changes? Use Desktop scheduled tasks instead — same idea, runs locally.
❌ By default they only push toclaude/-prefixed branches. Unrestricted pushes are opt-in per repository.
Where to start
Pick the most boring recurring thing you do with your repo — the Monday dependency audit, the release-notes draft — and turn that into your first routine. Boring and repeatable is exactly the profile.
Official docs: Automate work with routines.