Start a Claude Code cloud task from any automation with one HTTP POST
Your laptop has to be open for Claude Code to work on a task. A scheduled task (called a routine) runs on Anthropic's cloud instead, and you can start it from anywhere that can send an authenticated HTTP request. That's 6 steps. Heads up: it is a research preview, so behavior, limits and the API may change.
You need a paid claude.ai plan (Pro, Max, Ultra, Team or Enterprise) and a GitHub repo Claude can clone. Runs use your subscription usage. Docs: https://code.claude.com/docs/en/routines
  1. Go to claude.ai/code/routines and create a new task. Write a self-contained prompt: it runs on its own, so say exactly what to do and what success looks like.
  2. In Advanced settings, pick your GitHub repo(s) and a cloud environment, and remove connectors (the links to your other apps) the task does not need.
  3. In the prompt, point at the incoming text, for example: "Investigate the alert described in the routine-fire-payload block". Without that line, Claude treats your text as background only.
  4. Open the task, click the menu next to its name, then Edit. In the Trigger row click +, choose API, copy the Fire URL and click Generate token. The token is shown once, so store both as secrets in your automation tool. This step only works on the web, not from the CLI.
  5. Send a POST from your automation (API reference: https://platform.claude.com/docs/en/api/claude-code/routines-fire):
curl -X POST https://api.anthropic.com/v1/claude_code/routines/$ROUTINE_ID/fire -H "Authorization: Bearer $ROUTINE_TOKEN" -H "anthropic-version: 2026-10-21" -H "Content-Type: application/json" -d '{"text": "Sentry alert SEN-4521 fired in prod. Stack trace attached."}'
The text field is optional, freeform, up to 65,536 characters. The anthropic-beta header shown on the routines page is optional.
  1. A 200 response gives you claude_code_session_url. Open it to watch the run or continue the chat.
Gotcha: there is no idempotency key, so if your webhook retries, you get duplicate sessions. Limits are 30 fires per hour per task and 100 API fires per hour per account, and you get a 429 with a Retry-After header beyond that.
What would you trigger first with this?
I'm building an AI agency, https://ethiaagency.com, and sharing here what has been most useful to me.
10
10 comments
Theo Ethia
6
Start a Claude Code cloud task from any automation with one HTTP POST
AI Automation Society
skool.com/ai-automation-society
Learn to get paid for AI solutions, regardless of your background.
Leaderboard (30-day)
Powered by