-
Notifications
You must be signed in to change notification settings - Fork 1
feat(routines): B-0507 and B-0508 cloud-schedule schema definition #3937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
docs/research/2026-05-14-cloud-routines-api-auth-registration-surface-b0507.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # B-0507 — Cloud Routines API, Auth, and Registration Surface Research | ||
|
|
||
| ## 1. Is Cloud Routines GA or still research-preview? | ||
| Cloud Routines is an active feature as of May 2026, operating with production-ready endpoints for automated coding workflows running on Anthropic's managed cloud infrastructure. While previously in research-preview, it is currently widely available to Pro, Max, Team, and Enterprise users. | ||
|
|
||
| ## 2. Authentication Mechanism | ||
| Routines require a **per-routine bearer token**. This is explicitly distinct from a general Anthropic API key or Claude.ai OAuth token. | ||
| The bearer token is scoped specifically to the individual routine and provides no read access to the general account or other routines. | ||
| *Beta Header Requirement:* API requests must include the header `anthropic-beta: experimental-cc-routine-2026-04-01`. | ||
|
|
||
| ## 3. Registration Surface | ||
| Registration and configuration are performed via the Web UI at **claude.ai/code/routines**. | ||
| - There is no direct CLI command for initial routine registration. | ||
| - Once created in the web UI, you can generate a token by adding an "API" trigger. | ||
| - The execution endpoint is: `POST https://api.anthropic.com/v1/claude_code/routines/[routine-id]/fire` | ||
|
|
||
| ## 4. Does `scheduled-tasks` MCP wrap Cloud Routines? | ||
| No. `scheduled-tasks` is a local MCP for running things via the local OS scheduling. Cloud Routines run persistently on Anthropic's managed cloud infrastructure, independent of the local machine state. | ||
|
|
||
| ## 5. Trigger types available | ||
| - **API**: HTTP POST requests with a routine-specific Bearer token. | ||
| - **GitHub Events**: Webhook-based integration (requires the Claude GitHub App). | ||
| - **Scheduled**: Cron-style triggers native to the Anthropic cloud infrastructure. | ||
|
|
||
| ## 6. Daily Quota | ||
| Cloud Routines use a dual-layer usage framework tied to the main account subscription: | ||
| - A rolling 5-hour window. | ||
| - A 7-day weekly cap. | ||
| Routine execution draws from this shared pool (along with Claude Desktop and claude.ai usage). Complex tasks use more active compute quota. | ||
|
|
||
| ## 7. Which plan is the Zeta factory running on? | ||
| The CLI `claude` instance indicates `Claude Enterprise` in its interactive header. This implies the Zeta factory is running on the Enterprise plan, which benefits from the highest rolling window limits. | ||
|
|
||
| ## 8. Do GitHub event triggers require a GitHub App installation? | ||
| Yes. It explicitly requires installing the **Claude GitHub App** on the repository to listen for webhook events (e.g., `pull_request.opened`). Running `/web-setup` locally is not sufficient for triggering Cloud Routines via GitHub events, as that only grants local clone access. | ||
|
|
||
| ## Next Steps for Slices 2–5 | ||
| - **Schema Impact (B-0508):** `cloud-schedule.json` schema needs to model: | ||
| - `trigger: "api" | "github" | "scheduled"` | ||
| - For API triggers: Needs a mechanism to securely inject the Bearer token (e.g., via environment variable reference). | ||
| - For GitHub triggers: Needs to define the event type and filters. | ||
| - **Registration Flow (B-0511):** The installer cannot automatically register Cloud Routines completely autonomously via CLI. It must guide the human/agent to `claude.ai/code/routines` to manually create the routine and configure the GitHub App or generate the API token. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "Cloud Routine Schedule", | ||
| "description": "Configuration for an Anthropic Cloud Routine", | ||
| "type": "object", | ||
| "required": ["trigger"], | ||
| "properties": { | ||
| "taskId": { | ||
| "type": "string", | ||
| "description": "Optional; the unique identifier of the routine. When present, MUST match the containing directory name (install.ts derives the canonical taskId from the directory at tools/routines/install.ts ~line 131-181). Listed here for self-documentation and for cloud-side tooling that consumes cloud-schedule.json without a filesystem layout; if omitted, the directory name is authoritative." | ||
| }, | ||
| "trigger": { | ||
| "type": "object", | ||
| "oneOf": [ | ||
| { | ||
| "properties": { | ||
| "type": { | ||
| "const": "scheduled" | ||
| }, | ||
| "cronExpression": { | ||
| "type": "string", | ||
| "description": "Cron expression for the schedule" | ||
| } | ||
| }, | ||
| "required": ["type", "cronExpression"] | ||
| }, | ||
| { | ||
| "properties": { | ||
| "type": { | ||
| "const": "github_event" | ||
| }, | ||
| "event": { | ||
| "type": "string", | ||
| "description": "The GitHub webhook event to listen for (e.g. pull_request.opened)" | ||
| }, | ||
| "repos": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Trigger-scope: GitHub repositories whose webhook events fire this routine (e.g. Lucent-Financial-Group/Zeta). Distinct from the top-level `repos` field which controls runtime-environment repo access." | ||
| } | ||
| }, | ||
| "required": ["type", "event", "repos"] | ||
| }, | ||
| { | ||
| "properties": { | ||
| "type": { | ||
| "const": "api" | ||
| } | ||
| }, | ||
| "required": ["type"] | ||
| } | ||
| ] | ||
| }, | ||
| "repos": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Runtime-scope: GitHub repositories the routine's cloud environment is granted access to (read/write per cloud-side ACL). Distinct from the trigger-scope `trigger.repos` (only valid when `trigger.type == \"github_event\"`), which selects which repos' webhooks fire the routine." | ||
| }, | ||
|
AceHack marked this conversation as resolved.
|
||
| "connectors": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Additional connectors or tool integrations to provision in the cloud environment" | ||
| }, | ||
| "description": { | ||
| "type": "string", | ||
| "description": "A short description of the routine" | ||
| }, | ||
| "notes": { | ||
| "type": "string", | ||
| "description": "Free-form notes, ignored by the installer" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.