How to run a Claude Code task in the cloud on a schedule or a GitHub event
Based on a guide by Anthropic on the Claude Code Docs · Nov 20, 2026
You'll end with: A saved Claude Code task with a prompt, repositories, and connectors that runs on a schedule, an API call, or a GitHub event.
Why it's worth having: Runs happen on Anthropic's cloud or your own self-hosted environment, so a nightly check keeps going with your laptop closed.
At a glance
The method, in short
- 1Write the prompt once, and pick the repositories and connectors the task can use.
- 2Create the task at claude.ai/code/routines, or from the Claude Code CLI with /schedule.
- 3Attach a trigger: a recurring schedule, an API call to the task's endpoint, or a matching GitHub event.
- 4Review each run's results and adjust the prompt before you widen what the task can touch.
Read the full guide from Anthropic on the Claude Code Docs
Scheduled tasks, formerly routines, are a research preview, so behavior, limits, and the API can change.