More on the topic...
Generating detailed summary...
Failed to generate summary. Please try again.
Routines let you run Claude Code tasks on a schedule, via an API call, or in response to GitHub events. You pick one or more triggers—hourly, nightly, weekly schedules; a dedicated HTTP POST endpoint secured by a bearer token; or GitHub hooks on actions like pull_request.opened or pull_request.closed. Each routine clones specified GitHub repos, runs shell commands or connector calls (Slack, Linear, Google Drive), and pushes changes back under claude/-prefixed branches. You set network access, environment variables, and a setup script to prepare dependencies before each run.
Use cases span back-log grooming, alert triage, code review, deploy verification, docs drift fixes, and cross-library porting. For example, a nightly schedule checks new issues, labels them, assigns owners, and posts a Slack summary. An API trigger fires when error thresholds are crossed, correlating stack traces with recent commits and opening draft fix PRs. A GitHub trigger on pull_request.opened applies custom review checks and leaves inline comments for security or style issues. Another GitHub trigger on merged PRs ports code changes between SDK repos automatically.
You create routines through the web UI at claude.ai/code/routines, the Desktop app, or the CLI. The web form walks you through naming the routine, writing a prompt that defines tasks and success criteria, selecting repos and environment settings, and choosing triggers. In the CLI you run `/schedule` commands to list, create, update, and trigger routines. Desktop users click “New remote task” on the Schedule page. Each routine run shows up as a full Claude Code session where you can review output, inspect changes, and turn them into pull requests.
Questions about this article
No questions yet.