modified
--- a/routines.md +++ b/routines.md @@ -1,4 +1,4 @@ -Scheduled tasks are in research preview. Behavior, limits, and the API surface may change. +Cloud scheduled tasks in Claude Code, which this page covers, are in research preview, including on Enterprise plans. Their behavior, limits, and API surface may change. On Enterprise plans with [Chat and Cowork unified](<https://support.claude.com/en/articles/17444462-set-up-and-manage-the-new-unified-claude-experience-for-your-enterprise-organization>) turned on, cloud scheduled tasks in claude.ai chat and Claude Cowork are generally available.On Team and Enterprise plans, one scheduled tasks toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>) must be on for either kind of task. An Owner can’t use it to allow the generally available kind and block the preview kind. A cloud scheduled task, formerly a routine, is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Scheduled tasks execute on Anthropic-managed cloud infrastructure, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there, so they keep working when your laptop is closed. Each scheduled task can have one or more triggers attached to it:
modified
--- a/routines.md +++ b/routines.md @@ -51,7 +51,7 @@ * If a menu opens with **Create with Claude** and **Set up manually** , select **Set up manually** to open the dialog. **Create with Claude** lets you describe the task in a chat and have Claude create it instead. * If a full page opens in place of the dialog, go to Full-page form. -If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. Otherwise, this dialog also creates scheduled tasks for claude.ai chat. To make yours what the dialog calls a Claude Code task, select a repository or add a GitHub event or API trigger in the steps that follow. That kind of task runs Claude Code in a cloud session. +If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. 2 @@ -81,7 +81,11 @@ Select repositories -In the **Repository** row below **Trigger** , select one or more GitHub repositories for Claude to work in. If the row isn’t there, expand **Advanced settings** and find **Repository** on the **General** tab.Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. +In the **Repository** row below **Trigger** , select one or more GitHub repositories for Claude to work in. If the row isn’t there, expand **Advanced settings** and find **Repository** on the **General** tab. + +If the row says **Picking a repository makes this a Claude Code task** , select a repository so the task runs Claude Code in a [cloud session](</docs/en/claude-code-on-the-web>). If you skip the repository in that case and add only a schedule trigger, you create a scheduled task for claude.ai chat. + +Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. 5 @@ -417,7 +421,7 @@ * **App** : in some accounts the sidebar entry and page title read **Routines** , the button reads **New routine** , and other labels say routine. To create a task there, see Full-page form. * **Web address** : `claude.ai/code/routines` - * **CLI** : the `/routines` alias for `/schedule`, the command’s description, and Claude’s replies while it sets up a task + * **CLI** : the `/routines` alias for `/schedule` * **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page * **Organization settings** : the **Scheduled tasks (Was Routines)** or **Routines** toggle @@ -439,6 +443,10 @@ ### Scheduled tasks are off for your organization Cloud scheduled tasks are off for your organization, and you can’t change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). + +### A scheduled task turned off with a usage credits notice + +If a task’s model [requires usage credits](</docs/en/model-config#fable-and-usage-credits>) on your plan, claude.ai can skip the next run and turn the task off. On the task’s detail page, turn the task back on to use usage credits, or change its model before you turn it on. ### Warnings under History
modified
--- a/routines.md +++ b/routines.md @@ -23,7 +23,7 @@ * **Backlog maintenance** : a schedule trigger runs every weeknight in your repository, with your issue tracker added as a connector. The scheduled task reads issues opened since the last run, applies labels, and assigns owners based on the area of code referenced. It then posts a summary to Slack so the team starts the day with a groomed queue. * **Alert triage** : your monitoring tool calls the scheduled task’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The task’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace and correlates it with recent commits in the repository. It then opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. - * **Bespoke code review** : a GitHub trigger runs on `pull_request.opened`. The scheduled task applies your team’s own review checklist and leaves inline comments for security, performance, and style issues. It also adds a summary comment so human reviewers can focus on design instead of mechanical checks. + * **Bespoke code review** : a GitHub trigger runs on `pull_request.opened`. The scheduled task applies your own review checklist and leaves inline comments for security, performance, and style issues. It also adds a summary comment so human reviewers can focus on design instead of mechanical checks. * **Deploy verification** : your CD pipeline calls the scheduled task’s API endpoint after each production deploy. The task runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. * **Docs drift** : a schedule trigger runs weekly. The scheduled task scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. * **Library port** : a GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The scheduled task ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. @@ -300,7 +300,7 @@ * **Failed** : the session didn’t finish normally. For example, it stopped unexpectedly, ended on an error, or was archived before the run started * **Cancelled** : the run didn’t fail, and its session was archived. If you archive the session of a run that succeeded, the run changes to **Cancelled**. Nothing in the task needs to change -If a warning appears under **History** , see “The last run” warnings. +If a warning appears under **History** , see Warnings under History. ### Edit and control scheduled tasks @@ -440,14 +440,14 @@ Cloud scheduled tasks are off for your organization, and you can’t change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). -### “The last run” warnings - -When a warning under **History** begins with “The last run”, find it in the first column and do what its row says. The warning clears once a later run starts. +### Warnings under History + +When a warning under **History** begins with “The last run” or “This didn’t run”, find it in the first column and do what its row says. The warning clears once a later run starts. Warning| What to do ---|--- -”The last run didn’t start because your organization had reached its limit on cloud sessions running at once.”| The task needs no change. Click **Run now** later, or wait for the next run -”The last run didn’t start because its cloud environment couldn’t be found or used.”| On the task’s detail page, open the menu next to its name, select **Edit** , and find the cloud environment selector. If it reads **Unavailable environment** , that environment was archived or is no longer available to your account, so choose another one there and save your changes. Otherwise, retry with **Run now** on the detail page, or pick another environment in the selector and save your changes +”This didn’t run” followed by the run’s time, then “You were at the limit for tasks Claude can work on at the same time.” or “Your organization was at its limit for tasks Claude can work on at the same time.”| The task needs no change. Click **Run now** later, or wait for the next run +”The last run didn’t start because its environment couldn’t be found or used.”| On the task’s detail page, open the menu next to its name, select **Edit** , and find the cloud environment selector. If it reads **Unavailable environment** , that environment was archived or is no longer available to your account, so choose another one there and save your changes. Otherwise, retry with **Run now** on the detail page, or pick another environment in the selector and save your changes ”The last run was blocked because it couldn’t access something it needs, or your organization’s policy doesn’t allow it.”| Check that your GitHub access covers the task’s repositories. If it does, ask an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization whether a policy blocks the task ”The last run didn’t start because of a problem that’s usually temporary.”| Click **Run now** to try again, or wait for the next run ”The last run didn’t start because its repository or branch wasn’t available.”| Check on GitHub that each repository in the task has the branch the run starts from. Also check that your GitHub access covers each repository, and reconnect GitHub if your connection expired
modified
--- a/routines.md +++ b/routines.md @@ -81,13 +81,13 @@ Select repositories -Expand **Advanced settings**. Under **Repository** on the **General** tab, select one or more GitHub repositories for Claude to work in.Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. +In the **Repository** row below **Trigger** , select one or more GitHub repositories for Claude to work in. If the row isn’t there, expand **Advanced settings** and find **Repository** on the **General** tab.Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. 5 Select an environment -After you select a repository, **Cloud environment** appears below it. Pick a [cloud environment](</docs/en/cloud-environments>) for the task. If an environment is already selected, you can keep it or select a different one. Environments control what the cloud session has access to: +Find **Cloud environment** below **Trigger** , or under **Advanced settings > General** if it isn’t there, and pick a [cloud environment](</docs/en/cloud-environments>) for the task. If an environment is already selected, you can keep it or select a different one. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret @@ -105,7 +105,7 @@ Review connectors -Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see Permission prompts during a run. +Expand **Advanced settings** and open the **Connectors** tab. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see Permission prompts during a run. 8 @@ -375,7 +375,7 @@ Open the environment selector -Go to **Advanced settings > General > Cloud environment**, expanding **Advanced settings** first if it’s collapsed. Click the cloud icon showing your environment’s name, such as **Default**. +Find **Cloud environment** below **Trigger** , or under **Advanced settings > General** if it isn’t there. Click the cloud icon showing your environment’s name, such as **Default**. 3 @@ -413,7 +413,7 @@ ## Where the name routines still appears -Scheduled tasks were previously called routines, and these places keep the earlier name. Each one refers to the same feature: +Scheduled tasks were previously called routines, and these places keep the earlier name: * **App** : in some accounts the sidebar entry and page title read **Routines** , the button reads **New routine** , and other labels say routine. To create a task there, see Full-page form. * **Web address** : `claude.ai/code/routines`
modified
--- a/routines.md +++ b/routines.md @@ -30,7 +30,7 @@ ## Create a scheduled task -Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. You don’t choose a permission mode when you create the task: see Permission prompts during a run for when a run stops to wait for you. What a scheduled task can reach is determined by: +Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include. Those skills include the ones committed to the cloned repository. For a task in a project, check [which threads load them](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). You don’t choose a permission mode when you create the task: see Permission prompts during a run for when a run stops to wait for you. What a scheduled task can reach is determined by: * The repositories you select * The [environment’s](</docs/en/cloud-environments>) network access and variables
modified
--- a/routines.md +++ b/routines.md @@ -425,9 +425,9 @@ ### `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type. Submitting it returns `Unknown command: /schedule`, except in the cases below that note a different answer. The cause is usually one of the following: - - * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well +If you submit `/schedule` when one of its requirements isn’t met, you see `Unknown command: /schedule` or a message that says why the command is unavailable. The cause is usually one of the following: + + * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it, since it takes precedence over a claude.ai login. If you use a profile or federation credential, switch that off as well * You are fully signed out, with no API key or other credential. With feature-flag fetching enabled, submitting `/schedule` shows `/schedule requires a claude.ai subscription. Run /login to sign in with your claude.ai account.` Before v2.1.268, a signed-out session showed the same Claude for Enterprise message as a Console API key * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage scheduled tasks from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which scheduled tasks require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule`
modified
Show diff (389 lines)
--- a/routines.md +++ b/routines.md @@ -17,11 +17,7 @@ Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. If your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), you also need a role that includes the scheduled tasks permission. An Owner can add it in a role’s **Remote sessions** section at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). -## - -​ - -Example use cases +## Example use cases Each example pairs a trigger type with the kind of work scheduled tasks are suited to: unattended, repeatable, and tied to a clear outcome. @@ -32,11 +28,7 @@ * **Docs drift** : a schedule trigger runs weekly. The scheduled task scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. * **Library port** : a GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The scheduled task ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. -## - -​ - -Create a scheduled task +## Create a scheduled task Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. You don’t choose a permission mode when you create the task: see Permission prompts during a run for when a run stops to wait for you. What a scheduled task can reach is determined by: @@ -46,11 +38,7 @@ Scope each of those to what the task needs. Scheduled tasks belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a scheduled task does through your connected GitHub identity or connectors appears as you. Commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. -### - -​ - -Create from the web +### Create from the web 1 @@ -125,19 +113,11 @@ Click **Create**. The dialog closes and the new task’s detail page opens. The task runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the detail page.To see what a run did, click it in the **History** list on the detail page. The run opens as a full session, a new one for each run, where you can see what Claude did, review changes, and create a pull request. -#### - -​ - -Dialog with Repositories and Environment in the main view +#### Dialog with Repositories and Environment in the main view Follow the steps to create from the web, and fill in each field in the dialog’s main view rather than under **Advanced settings**. This dialog creates only Claude Code tasks. Select the repository before you add a GitHub event trigger, because that trigger is unavailable until a repository is selected. -#### - -​ - -Full-page form +#### Full-page form In the Desktop app, if a menu with **Local** and **Cloud** opens, select **Cloud**. A page titled **New routine** or **New scheduled task** opens. Fill in its fields: @@ -148,11 +128,7 @@ If **Create** is unavailable, hover over it to see what the form still needs. Click **Create** , and the task’s detail page opens. -### - -​ - -Create from the CLI +### Create from the CLI Run `/schedule` in any session to create a scheduled task conversationally. You can also pass a description directly, for a recurring task like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web dialog collects, then saves the task to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no scheduled task was created; see Troubleshooting. A task you create with `/schedule` has a schedule trigger. You can also add the other trigger types: @@ -161,19 +137,11 @@ A scheduled task with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time. The CLI shows none when Claude saves or updates it. -## - -​ - -Configure triggers +## Configure triggers A scheduled task starts when one of its triggers matches. Add or remove a task’s triggers at any time in the **Trigger** row of the task’s edit dialog. When a task has two or more triggers, each one has a trash icon in that dialog. To remove a schedule or GitHub event trigger, click its trash icon, then **Save changes**. To remove an API trigger, delete its token instead. -### - -​ - -Add a schedule trigger +### Add a schedule trigger A schedule trigger runs the task on a recurring cadence, or once at a specific future time. In the task’s creation or edit dialog on the web, pick a preset frequency such as hourly, daily, or weekly: @@ -182,11 +150,7 @@ * **Time zone** : when you pick a preset frequency, enter the time in your local time zone. * **Cron expression time zone** : when the expression is five fields alone, write the hours in UTC, so `0 9 * * 1-5` runs at 9:00 AM UTC on weekdays. If the field opens with a `CRON_TZ=` prefix, keep it and write the hours in its zone, or delete it and write them in UTC. -#### - -​ - -Schedule a one-off run +#### Schedule a one-off run A one-off schedule runs the task a single time at a specific timestamp. For example, use it to: @@ -202,11 +166,7 @@ One-off runs count against the same hourly limit as other scheduled runs. See Usage and limits for details. -### - -​ - -Add an API trigger +### Add an API trigger An API trigger gives a scheduled task a dedicated HTTP endpoint. POSTing to the endpoint with the task’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. Add an API trigger on the web, either while you create the task or later with the steps below. You can’t add an API trigger or manage its token from the CLI. @@ -239,11 +199,7 @@ * **Turn off API access** : click **Delete token** , the trash icon next to **Regenerate**. This removes the API trigger * **Rotate the token** : click **Regenerate**. The previous token stops working, and the **Token generated** dialog shows the new one once -#### - -​ - -Trigger a scheduled task +#### Trigger a scheduled task Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the task alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the task receives it as a literal string. The `text` value doesn’t reach the routine as a bare message. It arrives wrapped in a `<routine-fire-payload>` block that labels it as untrusted data and tells Claude not to follow instructions inside it unless the routine’s own prompt says to. The same wrapping applies to text supplied with **Run now** in the web UI. This means a routine’s saved prompt must opt in to acting on fire text: write the prompt to reference the payload explicitly, for example “Investigate the alert described in the routine-fire-payload block”, or the routine treats the text as inert context. Anyone holding the bearer token can send `text`, so the wrapper makes fire text from a leaked token arrive labeled as untrusted data rather than as direct instructions to your routine. The example below triggers a scheduled task from a shell. The task ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: @@ -266,19 +222,11 @@ The `/fire` endpoint ships under the `experimental-cc-routine-2026-04-01` beta header. Request and response shapes, rate limits, and token semantics may change while the feature is in research preview. Breaking changes ship behind new dated beta header versions, and the two most recent previous header versions continue to work so that callers have time to migrate. -#### - -​ - -API reference +#### API reference For the full API reference, including all error responses, validation rules, and field limits, see [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) in the Claude Platform documentation. The `/fire` endpoint is available to claude.ai users only and is not part of the Claude Platform API surface. -### - -​ - -Add a GitHub trigger +### Add a GitHub trigger A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Claude Code doesn’t reuse sessions across events, so two PR updates produce two independent sessions. @@ -309,11 +257,7 @@ Change the repository if needed, choose an event from the supported events list, and optionally add filters. Then click **Save changes** at the bottom of the dialog to apply the trigger. -#### - -​ - -Supported events +#### Supported events Choose an event from any of the following categories. Within each category you can pick a specific action, such as `pull_request.opened`, or react to all actions in the category. @@ -323,11 +267,7 @@ Release| A release is created, published, edited, or deleted Issue| An issue is opened, edited, closed, reopened, labeled, assigned, or otherwise updated -#### - -​ - -Filter pull requests +#### Filter pull requests Use filters to narrow which pull requests start a new session. All filter conditions must match for the scheduled task to trigger. The available filter fields are: @@ -348,19 +288,11 @@ * **Ready-for-review only** : is draft is `false`. Skips drafts so the task only runs when the PR is ready for review. * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch task only when a maintainer tags the PR. -## - -​ - -Manage scheduled tasks +## Manage scheduled tasks Click a scheduled task in the list to open its detail page. The detail page shows the task’s repositories, connectors, prompt, schedule, API tokens, GitHub triggers, and a list of past runs. -### - -​ - -View and interact with runs +### View and interact with runs Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. Under **History** on the task’s detail page, each finished run’s row ends with **Error** if the run failed, **Cancelled** if it was cancelled, and neither word if it succeeded. The **Status** filter names the same three outcomes **Failed** , **Cancelled** , and **Succeeded**. These outcomes say how the session ended, not whether Claude completed the work your prompt describes, so open the run and read its transcript to see what happened. @@ -370,11 +302,7 @@ If a warning appears under **History** , see “The last run” warnings. -### - -​ - -Edit and control scheduled tasks +### Edit and control scheduled tasks From the detail page you can: @@ -383,19 +311,11 @@ * Open the menu next to the task’s name and select **Edit** to change the name, prompt, repositories, environment, connectors, or any of the task’s triggers. The **Edit scheduled task** dialog opens with the same layout as the creation dialog. To add a trigger, click **+** in the **Trigger** row. Click **Save changes** to apply your edits. API token actions take effect immediately, without **Save changes**. * Open the same menu and select **Delete** to delete the task. -### - -​ - -Manage scheduled tasks from the CLI +### Manage scheduled tasks from the CLI Run `/schedule list` to see your scheduled tasks, `/schedule update` to change one, or `/schedule run` to start one immediately. You can also ask about a scheduled task’s run history, for example `/schedule why did my nightly review do nothing this morning?`. Claude lists the task’s recent runs with their status and a link to open each run on the web. It also reads a run’s log to explain what happened, including tool errors, permission denials, and the final result. Requires Claude Code v2.1.227 or later. -### - -​ - -Repositories and branch permissions +### Repositories and branch permissions Scheduled tasks need GitHub access to clone repositories. When you create a scheduled task from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from. If it doesn’t, Claude adds a setup note naming how to grant it. @@ -403,11 +323,7 @@ If your GitHub connection is missing or expired when a run is due, the scheduled task skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the task resumes on its own. After 72 hours without a connection, the task turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. If a GitHub pull request event triggers the run and the pull request’s repository is the task’s first repository, that repository starts from the pull request’s head commit instead. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). -### - -​ - -Connectors +### Connectors Scheduled tasks can use your connected MCP connectors to read from and write to external services during each run. For example, a task that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a scheduled task: @@ -416,11 +332,7 @@ When you create a scheduled task, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the task’s creation or edit dialog. To manage or add connectors outside of that dialog, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. -### - -​ - -Permission prompts during a run +### Permission prompts during a run For a task that runs in your organization’s self-hosted environment, see [Permissions and tool approval](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>). @@ -431,19 +343,11 @@ If auto mode is unavailable, such as when your organization turned it off or the task’s model doesn’t support it, the run keeps the permission mode it launched in. To answer a waiting prompt, open the run from the task’s detail page. In a [project](</docs/en/claude-projects>), a run can continue a thread rather than start a new session. That run keeps whatever permission mode the thread is in at the time. When that thread was made, it started in auto mode unless auto mode was unavailable. To answer a prompt waiting in that thread, see [Unblock a thread waiting on approval](</docs/en/claude-projects#unblock-a-thread-waiting-on-approval>). -### - -​ - -When a run publishes an artifact without asking +### When a run publishes an artifact without asking During a run in auto mode, Claude publishes an [artifact](</docs/en/artifacts>) without asking you once the classifier allows the publish. You’re still asked first when, for example, the publish matches an [ask rule](</docs/en/permissions#manage-permissions>). A new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). The Accept edits rules that follow don’t apply in auto mode. When a scheduled task’s job is to keep a page current, give it an artifact you already published. -#### - -​ - -Artifacts in Accept edits mode +#### Artifacts in Accept edits mode When a scheduled task’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold: @@ -457,13 +361,9 @@ In every other case, including a run that an API or GitHub trigger starts, Claude asks first. -### - -​ - -Environments and network access - -Each scheduled task uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The task inherits the environment’s network policy on every run. The **Default** environment uses **Limited** access with **Allow package managers** checked, so its runs reach the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>). A request to a blocked host fails with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers, so the connectors you add to the task work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. +### Environments and network access + +Each scheduled task uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The task inherits the environment’s network policy on every run. The **Default** environment uses **Limited** access with **Allow package managers** checked, so its runs reach the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>). A request to a blocked host fails with [an error such as a `403` or `ENOTFOUND`](</docs/en/errors#host-not-allowed-in-a-cloud-session>). MCP connector traffic is routed through Anthropic’s servers, so the connectors you add to the task work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. 1 @@ -497,11 +397,7 @@ See [Network access](</docs/en/cloud-environments#network-access>) for details on access levels and the default allowlist. -## - -​ - -Usage and limits +## Usage and limits Scheduled tasks draw down subscription usage the same way interactive sessions do. See your current consumption at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). Separately from subscription usage, each way of starting a run has an hourly limit: @@ -515,11 +411,7 @@ None of these hourly limits has overage. When a scheduled task hits your subscription usage limit, organizations with usage credits turned on can keep running scheduled tasks on metered overage. Without usage credits, additional runs are rejected until your usage window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). While your subscription is paused, your scheduled tasks are put on hold and don’t run. Once your subscription is active again, turn them back on. -## - -​ - -Where the name routines still appears +## Where the name routines still appears Scheduled tasks were previously called routines, and these places keep the earlier name. Each one refers to the same feature: @@ -529,17 +421,9 @@ * **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page * **Organization settings** : the **Scheduled tasks (Was Routines)** or **Routines** toggle -## - -​ - -Troubleshooting - -### - -​ - -`/schedule` returns “Unknown command” +## Troubleshooting + +### `/schedule` returns “Unknown command” The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type. Submitting it returns `Unknown command: /schedule`, except in the cases below that note a different answer. The cause is usually one of the following: @@ -552,19 +436,11 @@ If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>). You need a Pro, Max, Ultra, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can’t create them on the web either. -### - -​ - -Scheduled tasks are off for your organization +### Scheduled tasks are off for your organization Cloud scheduled tasks are off for your organization, and you can’t change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). -### - -​ - -“The last run” warnings +### “The last run” warnings When a warning under **History** begins with “The last run”, find it in the first column and do what its row says. The warning clears once a later run starts. @@ -579,11 +455,7 @@ ”The last run stopped because a usage limit was reached.”| For when the task’s runs can start again after a usage limit, see Usage and limits ”The last run failed.”| Click **Run now** to try again, or wait for the next run. The failed run has no session to open -## - -​ - -Related resources +## Related resources * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files
modified
--- a/routines.md +++ b/routines.md @@ -105,7 +105,7 @@ * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret * **Setup script** : install dependencies and tools the task needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session -A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the task reach their services through Anthropic’s servers, so they don’t need allowlist changes.If your task needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. +A **Default** environment is provided with **Limited** network access and **Allow package managers** checked. Its runs reach the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>): package registries, cloud provider APIs, container registries, and common development domains. Connectors you add to the task reach their services through Anthropic’s servers, so they don’t need allowlist changes.If your task needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. 6 @@ -463,7 +463,7 @@ Environments and network access -Each scheduled task uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The task inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the task work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. +Each scheduled task uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The task inherits the environment’s network policy on every run. The **Default** environment uses **Limited** access with **Allow package managers** checked, so its runs reach the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>). A request to a blocked host fails with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers, so the connectors you add to the task work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. 1 @@ -485,9 +485,9 @@ 4 -Change the network access level - -In the **Edit cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. +Add the domains + +In the **Edit cloud environment** dialog, select **Limited** under **Network access** and enter your domains in **Allowed domains**. Check **Allow package managers** to allow the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your own domains. Select **Full** instead for unrestricted access. 5 @@ -588,6 +588,6 @@ * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions - * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; scheduled tasks created from a project appear on its **Scheduled tasks** tab + * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; scheduled tasks created from a project appear in its **Scheduled tasks** view * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events
modified
--- a/routines.md +++ b/routines.md @@ -15,7 +15,7 @@ Two other features schedule work on your machine instead of in the cloud: [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) and [`/loop`](</docs/en/scheduled-tasks>). To choose among all three, see [Compare scheduling options](</docs/en/scheduled-tasks#compare-scheduling-options>). -Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. If your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), you also need a role that includes the scheduled tasks permission. An Owner can add it in a role’s **Remote sessions** section at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). +Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. If your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), you also need a role that includes the scheduled tasks permission. An Owner can add it in a role’s **Remote sessions** section at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). ## @@ -527,7 +527,7 @@ * **Web address** : `claude.ai/code/routines` * **CLI** : the `/routines` alias for `/schedule`, the command’s description, and Claude’s replies while it sets up a task * **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page - * **Organization settings** : the **Scheduled tasks (Was Routines)** toggle + * **Organization settings** : the **Scheduled tasks (Was Routines)** or **Routines** toggle ## @@ -556,9 +556,9 @@ ​ -“Routines are disabled by your organization’s policy” - -An Owner in your Team or Enterprise organization has likely turned off the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). On Claude Code v2.1.227 or later, the same toggle also hides `/schedule` in the CLI. This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to turn scheduled tasks back on for your organization. +Scheduled tasks are off for your organization + +Cloud scheduled tasks are off for your organization, and you can’t change that from your local configuration. Ask your Team or Enterprise Owner whether they can turn on the **Scheduled tasks (Was Routines)** or **Routines** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). ###
modified
--- a/routines.md +++ b/routines.md @@ -99,7 +99,7 @@ Select an environment -After you select a repository, **Cloud environment** appears below it. Pick a [cloud environment](</docs/en/cloud-environments>) for the task. Environments control what the cloud session has access to: +After you select a repository, **Cloud environment** appears below it. Pick a [cloud environment](</docs/en/cloud-environments>) for the task. If an environment is already selected, you can keep it or select a different one. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret
modified
--- a/routines.md +++ b/routines.md @@ -11,7 +11,7 @@ * A task with only an API trigger runs when you call its endpoint. * A task with only a GitHub trigger runs when a matching repository event occurs. -Scheduled tasks are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. The earlier name, routines, still appears. +Scheduled tasks are available on Pro, Max, Ultra, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. The earlier name, routines, still appears. Two other features schedule work on your machine instead of in the cloud: [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) and [`/loop`](</docs/en/scheduled-tasks>). To choose among all three, see [Compare scheduling options](</docs/en/scheduled-tasks#compare-scheduling-options>). @@ -550,7 +550,7 @@ * An Owner turned off scheduled tasks for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the task when Claude tried to create or run it * Your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), and none of your roles includes the scheduled tasks permission under **Remote sessions**. Ask an Owner to add it to one of your roles -If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>). You need a Pro, Max, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can’t create them on the web either. +If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>). You need a Pro, Max, Ultra, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can’t create them on the web either. ###
modified
--- a/routines.md +++ b/routines.md @@ -69,7 +69,7 @@ Name the task and write the prompt -Give the scheduled task a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the task runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like. Select a model in the prompt input’s model selector. Claude uses it on every run.When a trigger fires, the session receives the saved prompt as its assignment and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account. The fired prompt is therefore not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. +Give the scheduled task a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the task runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.When a trigger fires, the session receives the saved prompt as its assignment and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account. The fired prompt is therefore not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. 3 @@ -109,11 +109,17 @@ 6 +Select a model and effort level + +Select a model in the prompt input’s model selector for Claude to use on every run. For a Claude Code task, if the model offers [effort levels](</docs/en/model-config#adjust-effort-level>), **Effort** in the same selector shows the current level. To change it, select another level. The selector’s **Default** option offers no levels. + +7 + Review connectors Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see Permission prompts during a run. -7 +8 Create the task @@ -136,7 +142,7 @@ In the Desktop app, if a menu with **Local** and **Cloud** opens, select **Cloud**. A page titled **New routine** or **New scheduled task** opens. Fill in its fields: * **Name** : enter one. - * **Instructions** : enter the prompt. In the same box, select the model, the repositories, and the environment. For what each one controls, see the steps under Create from the web. + * **Instructions** : enter the prompt. In the same box, select the model, the effort level if the model offers one, the repositories, and the environment. For what each one controls, see the steps under Create from the web. * **Select a trigger** : select **Schedule** , **GitHub event** , or **API**. For a schedule, see Add a schedule trigger. For a GitHub event, select a repository. For an API trigger, copy the token from the **API token** dialog that opens after you click **Create** , because it is shown once. To combine several triggers, click **Add another trigger**. * **Connectors** : all of your connected connectors are included by default, so remove the ones the task doesn’t need. @@ -153,7 +159,7 @@ * **API trigger** : edit the task on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>) * **GitHub trigger** : edit the task on the web, or ask Claude in the CLI. Adding one from the CLI requires Claude Code v2.1.225 or later -A scheduled task with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time. The CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these tasks. +A scheduled task with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time. The CLI shows none when Claude saves or updates it. ##
modified
Show diff (123 lines)
--- a/routines.md +++ b/routines.md @@ -11,7 +11,7 @@ * A task with only an API trigger runs when you call its endpoint. * A task with only a GitHub trigger runs when a matching repository event occurs. -Scheduled tasks are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. The earlier name, routines, still appears in the web address, the CLI, and the API. +Scheduled tasks are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. The earlier name, routines, still appears. Two other features schedule work on your machine instead of in the cloud: [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) and [`/loop`](</docs/en/scheduled-tasks>). To choose among all three, see [Compare scheduling options](</docs/en/scheduled-tasks#compare-scheduling-options>). @@ -56,7 +56,14 @@ Open the creation dialog -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>) and click **New task**. If a menu opens first, select **Set up manually**. The **New scheduled task** dialog opens. The menu’s other option, **Create with Claude** , lets you describe the task in a chat and have Claude create it instead.If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. Otherwise, this dialog also creates scheduled tasks for claude.ai chat. To make yours what the dialog calls a Claude Code task, select a repository or add a GitHub event or API trigger in the steps that follow. That kind of task runs Claude Code in a cloud session. +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>) and click **New task** to open the **New scheduled task** dialog. Check for these screens before you continue: + + * If the button reads **New routine** instead of **New task** , click **New routine** and continue with Full-page form. + * In the Desktop app, if a menu with **Local** and **Cloud** opens, go to Full-page form. + * If a menu opens with **Create with Claude** and **Set up manually** , select **Set up manually** to open the dialog. **Create with Claude** lets you describe the task in a chat and have Claude create it instead. + * If a full page opens in place of the dialog, go to Full-page form. + +If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. Otherwise, this dialog also creates scheduled tasks for claude.ai chat. To make yours what the dialog calls a Claude Code task, select a repository or add a GitHub event or API trigger in the steps that follow. That kind of task runs Claude Code in a cloud session. 2 @@ -120,6 +127,21 @@ Follow the steps to create from the web, and fill in each field in the dialog’s main view rather than under **Advanced settings**. This dialog creates only Claude Code tasks. Select the repository before you add a GitHub event trigger, because that trigger is unavailable until a repository is selected. +#### + +​ + +Full-page form + +In the Desktop app, if a menu with **Local** and **Cloud** opens, select **Cloud**. A page titled **New routine** or **New scheduled task** opens. Fill in its fields: + + * **Name** : enter one. + * **Instructions** : enter the prompt. In the same box, select the model, the repositories, and the environment. For what each one controls, see the steps under Create from the web. + * **Select a trigger** : select **Schedule** , **GitHub event** , or **API**. For a schedule, see Add a schedule trigger. For a GitHub event, select a repository. For an API trigger, copy the token from the **API token** dialog that opens after you click **Create** , because it is shown once. To combine several triggers, click **Add another trigger**. + * **Connectors** : all of your connected connectors are included by default, so remove the ones the task doesn’t need. + +If **Create** is unavailable, hover over it to see what the form still needs. Click **Create** , and the task’s detail page opens. + ### ​ @@ -152,6 +174,7 @@ * **Runs on the hour** : if you schedule a run exactly on the hour, such as 9:00, it can start several minutes late. To start close to the scheduled time, pick a few minutes past the hour, for example 9:07. * **Custom intervals** : for a cadence the presets lack, create the task and select **Custom** in its edit dialog. Then enter a cron expression, such as `0 */2 * * *` for every two hours. To set one from the CLI, run `/schedule update`. Expressions that run more often than once per hour are rejected. * **Time zone** : when you pick a preset frequency, enter the time in your local time zone. + * **Cron expression time zone** : when the expression is five fields alone, write the hours in UTC, so `0 9 * * 1-5` runs at 9:00 AM UTC on weekdays. If the field opens with a `CRON_TZ=` prefix, keep it and write the hours in its zone, or delete it and write them in UTC. #### @@ -286,12 +309,13 @@ Supported events -GitHub triggers can subscribe to either of the following event categories. Within each category you can pick a specific action, such as `pull_request.opened`, or react to all actions in the category. +Choose an event from any of the following categories. Within each category you can pick a specific action, such as `pull_request.opened`, or react to all actions in the category. Event| Triggers when ---|--- Pull request| A PR is opened, closed, assigned, labeled, synchronized, or otherwise updated Release| A release is created, published, edited, or deleted +Issue| An issue is opened, edited, closed, reopened, labeled, assigned, or otherwise updated #### @@ -332,9 +356,13 @@ View and interact with runs -Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. - -A green status in the run list means the session started and exited without an infrastructure error. It does not mean the work your prompt describes succeeded. Open the run to read the transcript and confirm what Claude actually did. Blocked network requests, missing connector tools, and failures in the work itself all surface there rather than in the status indicator. +Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. Under **History** on the task’s detail page, each finished run’s row ends with **Error** if the run failed, **Cancelled** if it was cancelled, and neither word if it succeeded. The **Status** filter names the same three outcomes **Failed** , **Cancelled** , and **Succeeded**. These outcomes say how the session ended, not whether Claude completed the work your prompt describes, so open the run and read its transcript to see what happened. + + * **Succeeded** : the session ended without Claude Code reporting a failure. Blocked network requests, missing connector tools, and work Claude couldn’t complete appear in the transcript rather than on the row + * **Failed** : the session didn’t finish normally. For example, it stopped unexpectedly, ended on an error, or was archived before the run started + * **Cancelled** : the run didn’t fail, and its session was archived. If you archive the session of a run that succeeded, the run changes to **Cancelled**. Nothing in the task needs to change + +If a warning appears under **History** , see “The last run” warnings. ### @@ -489,6 +517,7 @@ Scheduled tasks were previously called routines, and these places keep the earlier name. Each one refers to the same feature: + * **App** : in some accounts the sidebar entry and page title read **Routines** , the button reads **New routine** , and other labels say routine. To create a task there, see Full-page form. * **Web address** : `claude.ai/code/routines` * **CLI** : the `/routines` alias for `/schedule`, the command’s description, and Claude’s replies while it sets up a task * **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page @@ -525,6 +554,25 @@ An Owner in your Team or Enterprise organization has likely turned off the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). On Claude Code v2.1.227 or later, the same toggle also hides `/schedule` in the CLI. This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to turn scheduled tasks back on for your organization. +### + +​ + +“The last run” warnings + +When a warning under **History** begins with “The last run”, find it in the first column and do what its row says. The warning clears once a later run starts. + +Warning| What to do +---|--- +”The last run didn’t start because your organization had reached its limit on cloud sessions running at once.”| The task needs no change. Click **Run now** later, or wait for the next run +”The last run didn’t start because its cloud environment couldn’t be found or used.”| On the task’s detail page, open the menu next to its name, select **Edit** , and find the cloud environment selector. If it reads **Unavailable environment** , that environment was archived or is no longer available to your account, so choose another one there and save your changes. Otherwise, retry with **Run now** on the detail page, or pick another environment in the selector and save your changes +”The last run was blocked because it couldn’t access something it needs, or your organization’s policy doesn’t allow it.”| Check that your GitHub access covers the task’s repositories. If it does, ask an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization whether a policy blocks the task +”The last run didn’t start because of a problem that’s usually temporary.”| Click **Run now** to try again, or wait for the next run +”The last run didn’t start because its repository or branch wasn’t available.”| Check on GitHub that each repository in the task has the branch the run starts from. Also check that your GitHub access covers each repository, and reconnect GitHub if your connection expired +”The last run didn’t start because some of its settings weren’t accepted.”| On the task’s detail page, open the menu next to its name and select **Edit**. The dialog doesn’t mark which setting wasn’t accepted, so check each one there, including the task’s name, prompt, model, repositories, environment, connectors, and triggers +”The last run stopped because a usage limit was reached.”| For when the task’s runs can start again after a usage limit, see Usage and limits +”The last run failed.”| Click **Run now** to try again, or wait for the next run. The failed run has no session to open + ## ​
modified
--- a/routines.md +++ b/routines.md @@ -38,7 +38,7 @@ Create a scheduled task -Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include, all without stopping for approval apart from some artifact actions. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. What a scheduled task can reach is determined by: +Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. You don’t choose a permission mode when you create the task: see Permission prompts during a run for when a run stops to wait for you. What a scheduled task can reach is determined by: * The repositories you select * The [environment’s](</docs/en/cloud-environments>) network access and variables @@ -104,7 +104,7 @@ Review connectors -Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use every tool from an included connector, including writes, without asking for permission during a run. +Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use an included connector during a run, including writes. For when a run stops to ask you first, see Permission prompts during a run. 7 @@ -386,7 +386,30 @@ ​ +Permission prompts during a run + +For a task that runs in your organization’s self-hosted environment, see [Permissions and tool approval](</docs/en/self-hosted-environments-configuration#permissions-and-tool-approval>). + +When a run starts a new session on Anthropic’s cloud, that session begins in [auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) unless auto mode is unavailable. In auto mode, a classifier model allows or blocks actions that would otherwise wait for your approval. A run still stops and waits for an answer in cases such as these: + + * **Actions that prompt even in auto mode** : for example, an action that matches an [ask rule](</docs/en/permissions#manage-permissions>). See [How auto mode evaluates actions](</docs/en/permission-modes#how-auto-mode-evaluates-actions>) + * **Repeated blocks** : one block doesn’t end the run. Once blocks reach auto mode’s [repeated-block thresholds](</docs/en/permission-modes#repeated-block-thresholds>), a permission prompt appears in the run’s session and waits until someone answers it + +If auto mode is unavailable, such as when your organization turned it off or the task’s model doesn’t support it, the run keeps the permission mode it launched in. To answer a waiting prompt, open the run from the task’s detail page. In a [project](</docs/en/claude-projects>), a run can continue a thread rather than start a new session. That run keeps whatever permission mode the thread is in at the time. When that thread was made, it started in auto mode unless auto mode was unavailable. To answer a prompt waiting in that thread, see [Unblock a thread waiting on approval](</docs/en/claude-projects#unblock-a-thread-waiting-on-approval>). + +### + +​ + When a run publishes an artifact without asking + +During a run in auto mode, Claude publishes an [artifact](</docs/en/artifacts>) without asking you once the classifier allows the publish. You’re still asked first when, for example, the publish matches an [ask rule](</docs/en/permissions#manage-permissions>). A new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). The Accept edits rules that follow don’t apply in auto mode. When a scheduled task’s job is to keep a page current, give it an artifact you already published. + +#### + +​ + +Artifacts in Accept edits mode When a scheduled task’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold: @@ -398,7 +421,7 @@ * The publish doesn’t declare runtime capabilities for the page * The existing page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) -In every other case, including a run that an API or GitHub trigger starts, Claude asks first. When a scheduled task’s job is to keep a page current, give it an artifact you already published. +In every other case, including a run that an API or GitHub trigger starts, Claude asks first. ###
modified
--- a/routines.md +++ b/routines.md @@ -15,7 +15,7 @@ Two other features schedule work on your machine instead of in the cloud: [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) and [`/loop`](</docs/en/scheduled-tasks>). To choose among all three, see [Compare scheduling options](</docs/en/scheduled-tasks#compare-scheduling-options>). -Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. +Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. If your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), you also need a role that includes the scheduled tasks permission. An Owner can add it in a role’s **Remote sessions** section at [**Organization settings > Roles**](<https://claude.ai/admin-settings/roles>). ## @@ -38,7 +38,7 @@ Create a scheduled task -Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include, all without stopping for approval apart from some artifact actions. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), those skills include the ones committed to the cloned repository. What a scheduled task can reach is determined by: +Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include, all without stopping for approval apart from some artifact actions. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>)’s threads, those skills include the ones committed to the cloned repository. What a scheduled task can reach is determined by: * The repositories you select * The [environment’s](</docs/en/cloud-environments>) network access and variables @@ -110,7 +110,7 @@ Create the task -Click **Create**. The dialog closes and the new task’s detail page opens. The task runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the detail page.Each run creates a new session alongside your other sessions, where you can see what Claude did, review changes, and create a pull request. +Click **Create**. The dialog closes and the new task’s detail page opens. The task runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the detail page.To see what a run did, click it in the **History** list on the detail page. The run opens as a full session, a new one for each run, where you can see what Claude did, review changes, and create a pull request. #### @@ -149,9 +149,9 @@ A schedule trigger runs the task on a recurring cadence, or once at a specific future time. In the task’s creation or edit dialog on the web, pick a preset frequency such as hourly, daily, or weekly: - * **Time zone** : times are entered in your local zone and converted automatically, so the task runs at that wall-clock time regardless of where the cloud infrastructure is located. * **Runs on the hour** : if you schedule a run exactly on the hour, such as 9:00, it can start several minutes late. To start close to the scheduled time, pick a few minutes past the hour, for example 9:07. - * **Custom intervals** : for a custom interval such as every two hours, pick the closest preset in the dialog, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. + * **Custom intervals** : for a cadence the presets lack, create the task and select **Custom** in its edit dialog. Then enter a cron expression, such as `0 */2 * * *` for every two hours. To set one from the CLI, run `/schedule update`. Expressions that run more often than once per hour are rejected. + * **Time zone** : when you pick a preset frequency, enter the time in your local time zone. #### @@ -165,13 +165,13 @@ * Open a cleanup PR after a rollout finishes * Start follow-up work after an upstream change ships -After the task runs, it turns itself off and the web UI marks it as **Completed**. To run it again, open the task’s edit dialog on the web, which offers **One-time** for a one-off task, and set a new time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. +After the task runs, it turns itself off and the web UI marks it as **Completed**. To run it again, open the task’s edit dialog on the web and select **One-time** or **Once** , whichever label your dialog shows. Then set a new date and time in your local time zone and save. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. /schedule tomorrow at 9am, summarize yesterday's merged PRs /schedule in 2 weeks, open a cleanup PR that removes the feature flag -The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs count against the same hourly limit as other scheduled runs. See Usage and limits for details. +One-off runs count against the same hourly limit as other scheduled runs. See Usage and limits for details. ### @@ -378,7 +378,7 @@ Scheduled tasks can use your connected MCP connectors to read from and write to external services during each run. For example, a task that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a scheduled task: * **As a connector** : add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) - * **In the repository** : for a scheduled task with one repository outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), you can instead declare the server in a committed [`.mcp.json`](</docs/en/mcp#project-scope>). A scheduled task in a project doesn’t load `.mcp.json`, so add the server as a connector + * **In the repository** : for a scheduled task with one repository, you can instead declare the server in a committed [`.mcp.json`](</docs/en/mcp#project-scope>), unless the task runs as threads in a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>). If it does, add the server as a connector. When you create a scheduled task, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the task’s creation or edit dialog. To manage or add connectors outside of that dialog, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. @@ -490,8 +490,9 @@ * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage scheduled tasks from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which scheduled tasks require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule` * An Owner turned off scheduled tasks for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the task when Claude tried to create or run it - -Unless your organization’s policy disables scheduled tasks or cloud sessions, you can create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. + * Your Enterprise organization manages your access with [custom roles](<https://support.claude.com/en/articles/13930452>), and none of your roles includes the scheduled tasks permission under **Remote sessions**. Ask an Owner to add it to one of your roles + +If the cause is your CLI sign-in or being inside a cloud session, you can still create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>). You need a Pro, Max, Team, or Enterprise account there. If scheduled tasks or cloud sessions are off for your organization or missing from your roles, you can’t create them on the web either. ###
modified
--- a/routines.md +++ b/routines.md @@ -38,7 +38,7 @@ Create a scheduled task -Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some artifact actions. What a scheduled task can reach is determined by: +Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>), and calls any connectors you include, all without stopping for approval apart from some artifact actions. Outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), those skills include the ones committed to the cloned repository. What a scheduled task can reach is determined by: * The repositories you select * The [environment’s](</docs/en/cloud-environments>) network access and variables @@ -378,7 +378,7 @@ Scheduled tasks can use your connected MCP connectors to read from and write to external services during each run. For example, a task that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a scheduled task: * **As a connector** : add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) - * **In the repository** : for a scheduled task with one repository, you can instead declare the server in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository + * **In the repository** : for a scheduled task with one repository outside a [project](</docs/en/claude-projects#what-threads-pick-up-from-your-repositories>), you can instead declare the server in a committed [`.mcp.json`](</docs/en/mcp#project-scope>). A scheduled task in a project doesn’t load `.mcp.json`, so add the server as a connector When you create a scheduled task, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the task’s creation or edit dialog. To manage or add connectors outside of that dialog, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI.
modified
Show diff (571 lines)
--- a/routines.md +++ b/routines.md @@ -1,12 +1,21 @@ -Routines are in research preview. Behavior, limits, and the API surface may change. - -A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it: - - * **Scheduled** : run on a recurring cadence like hourly, nightly, or weekly, or once at a specific future time - * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token +Scheduled tasks are in research preview. Behavior, limits, and the API surface may change. + +A cloud scheduled task, formerly a routine, is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Scheduled tasks execute on Anthropic-managed cloud infrastructure, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there, so they keep working when your laptop is closed. Each scheduled task can have one or more triggers attached to it: + + * **Schedule** : run on a recurring cadence like hourly, nightly, or weekly, or once at a specific future time + * **API** : trigger on demand by sending an HTTP POST to the task’s own endpoint with a bearer token * **GitHub** : run automatically in response to repository events such as pull requests or releases -A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise Owners can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. +A single scheduled task can combine triggers. For example, a PR review task can run nightly, trigger from a deploy script, and also react to every new PR. A scheduled task doesn’t need a schedule: + + * A task with only an API trigger runs when you call its endpoint. + * A task with only a GitHub trigger runs when a matching repository event occurs. + +Scheduled tasks are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. The earlier name, routines, still appears in the web address, the CLI, and the API. + +Two other features schedule work on your machine instead of in the cloud: [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) and [`/loop`](</docs/en/scheduled-tasks>). To choose among all three, see [Compare scheduling options](</docs/en/scheduled-tasks#compare-scheduling-options>). + +Team and Enterprise Owners can turn off scheduled tasks for all members with the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). When the toggle is off, existing scheduled tasks stop running and members can’t create new ones. ## @@ -14,15 +23,28 @@ Example use cases -Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. - -## - -​ - -Create a routine - -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker, and the session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some artifact actions. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Each example pairs a trigger type with the kind of work scheduled tasks are suited to: unattended, repeatable, and tied to a clear outcome. + + * **Backlog maintenance** : a schedule trigger runs every weeknight in your repository, with your issue tracker added as a connector. The scheduled task reads issues opened since the last run, applies labels, and assigns owners based on the area of code referenced. It then posts a summary to Slack so the team starts the day with a groomed queue. + * **Alert triage** : your monitoring tool calls the scheduled task’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The task’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace and correlates it with recent commits in the repository. It then opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. + * **Bespoke code review** : a GitHub trigger runs on `pull_request.opened`. The scheduled task applies your team’s own review checklist and leaves inline comments for security, performance, and style issues. It also adds a summary comment so human reviewers can focus on design instead of mechanical checks. + * **Deploy verification** : your CD pipeline calls the scheduled task’s API endpoint after each production deploy. The task runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. + * **Docs drift** : a schedule trigger runs weekly. The scheduled task scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. + * **Library port** : a GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The scheduled task ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. + +## + +​ + +Create a scheduled task + +Create a scheduled task from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a scheduled task you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Scheduled** in the sidebar or in the sidebar’s **More** menu, then **New task** , and continue with Create from the web. Scheduled tasks run autonomously as full Claude Code cloud sessions. You don’t choose a permission mode. The session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some artifact actions. What a scheduled task can reach is determined by: + + * The repositories you select + * The [environment’s](</docs/en/cloud-environments>) network access and variables + * The connectors you include + +Scope each of those to what the task needs. Scheduled tasks belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a scheduled task does through your connected GitHub identity or connectors appears as you. Commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -32,63 +54,71 @@ 1 -Open the creation form - -Visit [claude.ai/code/routines](<https://claude.ai/code/routines>) and click **New routine**. +Open the creation dialog + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>) and click **New task**. If a menu opens first, select **Set up manually**. The **New scheduled task** dialog opens. The menu’s other option, **Create with Claude** , lets you describe the task in a chat and have Claude create it instead.If **Repositories** and **Environment** are already showing when the dialog opens, see how that dialog differs. Otherwise, this dialog also creates scheduled tasks for claude.ai chat. To make yours what the dialog calls a Claude Code task, select a repository or add a GitHub event or API trigger in the steps that follow. That kind of task runs Claude Code in a cloud session. 2 -Name the routine and write the prompt - -Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.When a trigger fires, the session receives the routine’s saved prompt as its assigned task and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account, so the fired prompt is not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. Before v2.1.213, the session received the same prompt framed as an untrusted background notification and could refuse to act on it.The prompt input includes a model selector. Claude uses the selected model on every run. +Name the task and write the prompt + +Give the scheduled task a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the task runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like. Select a model in the prompt input’s model selector. Claude uses it on every run.When a trigger fires, the session receives the saved prompt as its assignment and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account. The fired prompt is therefore not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. 3 +Select a trigger + +In the **Trigger** row, choose how the task starts. To combine several triggers, click **+** at the end of the row. + + * Schedule + + * GitHub event + + * API + +Pick a preset frequency for a recurring run. See Add a schedule trigger for timezone handling, late starts, custom cron intervals, and one-off runs. + +Select the repository, the event to react to, and optional filters. See Add a GitHub trigger for the full list of supported events and filter fields. + +Select **API** here. When you click **Create** , the **API token** dialog shows the token once, so copy it before you close the dialog. See Add an API trigger to copy the URL or generate a new token. + +4 + Select repositories -Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. - -4 +Expand **Advanced settings**. Under **Repository** on the **General** tab, select one or more GitHub repositories for Claude to work in.Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. + +5 Select an environment -Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: +After you select a repository, **Cloud environment** appears below it. Pick a [cloud environment](</docs/en/cloud-environments>) for the task. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret - * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session - -A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. - -5 - -Select a trigger - -Under **Select a trigger** , choose how the routine starts. You can pick one trigger type or combine several. - - * Schedule - - * GitHub event - - * API - -Pick a preset frequency for a recurring run, or schedule a single one-off run at a specific timestamp. See Add a schedule trigger for timezone handling, late starts, custom cron intervals, and one-off runs. - -Select the repository, the event to react to, and optional filters. See Add a GitHub trigger for the full list of supported events and filter fields. - -Select **API** here, then save the routine. The URL and token are generated after the routine is saved, since they depend on the routine ID. See Add an API trigger to copy the URL and generate a token. + * **Setup script** : install dependencies and tools the task needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session + +A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the task reach their services through Anthropic’s servers, so they don’t need allowlist changes.If your task needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. 6 Review connectors -Under **Connectors** at the bottom of the form, all of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the routine doesn’t need: Claude can use every tool from an included connector, including writes, without asking for permission during a run. +Switch to the **Connectors** tab of **Advanced settings**. All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the task doesn’t need: Claude can use every tool from an included connector, including writes, without asking for permission during a run. 7 -Create the routine - -Click **Create**. The routine appears in the list and runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the routine’s detail page.Each run creates a new session alongside your other sessions, where you can see what Claude did, review changes, and create a pull request. +Create the task + +Click **Create**. The dialog closes and the new task’s detail page opens. The task runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the detail page.Each run creates a new session alongside your other sessions, where you can see what Claude did, review changes, and create a pull request. + +#### + +​ + +Dialog with Repositories and Environment in the main view + +Follow the steps to create from the web, and fill in each field in the dialog’s main view rather than under **Advanced settings**. This dialog creates only Claude Code tasks. Select the repository before you add a GitHub event trigger, because that trigger is unavailable until a repository is selected. ### @@ -96,7 +126,12 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines. To add an API trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). You can add a GitHub trigger from the web or from the CLI. The CLI path requires Claude Code v2.1.225 or later. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. +Run `/schedule` in any session to create a scheduled task conversationally. You can also pass a description directly, for a recurring task like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web dialog collects, then saves the task to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no scheduled task was created; see Troubleshooting. A task you create with `/schedule` has a schedule trigger. You can also add the other trigger types: + + * **API trigger** : edit the task on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>) + * **GitHub trigger** : edit the task on the web, or ask Claude in the CLI. Adding one from the CLI requires Claude Code v2.1.225 or later + +A scheduled task with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time. The CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these tasks. ## @@ -104,7 +139,7 @@ Configure triggers -A routine starts when one of its triggers matches. You can attach any combination of schedule, API, and GitHub triggers to the same routine, and add or remove them at any time from the **Select a trigger** section of the routine’s edit form. +A scheduled task starts when one of its triggers matches. Add or remove a task’s triggers at any time in the **Trigger** row of the task’s edit dialog. When a task has two or more triggers, each one has a trash icon in that dialog. To remove a schedule or GitHub event trigger, click its trash icon, then **Save changes**. To remove an API trigger, delete its token instead. ### @@ -112,7 +147,11 @@ Add a schedule trigger -A schedule trigger runs the routine on a recurring cadence, or once at a specific future time. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. If you schedule a run exactly on the hour, such as 9:00, it can start several minutes late. To start close to the scheduled time, pick a few minutes past the hour, for example 9:07. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. +A schedule trigger runs the task on a recurring cadence, or once at a specific future time. In the task’s creation or edit dialog on the web, pick a preset frequency such as hourly, daily, or weekly: + + * **Time zone** : times are entered in your local zone and converted automatically, so the task runs at that wall-clock time regardless of where the cloud infrastructure is located. + * **Runs on the hour** : if you schedule a run exactly on the hour, such as 9:00, it can start several minutes late. To start close to the scheduled time, pick a few minutes past the hour, for example 9:07. + * **Custom intervals** : for a custom interval such as every two hours, pick the closest preset in the dialog, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. #### @@ -120,7 +159,13 @@ Schedule a one-off run -A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to start a follow-up task after an upstream change ships. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. +A one-off schedule runs the task a single time at a specific timestamp. For example, use it to: + + * Remind yourself later in the week + * Open a cleanup PR after a rollout finishes + * Start follow-up work after an upstream change ships + +After the task runs, it turns itself off and the web UI marks it as **Completed**. To run it again, open the task’s edit dialog on the web, which offers **One-time** for a one-off task, and set a new time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. /schedule tomorrow at 9am, summarize yesterday's merged PRs @@ -134,44 +179,44 @@ Add an API trigger -An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. API triggers are added to an existing routine from the web. The CLI can’t currently create, regenerate, or delete tokens. +An API trigger gives a scheduled task a dedicated HTTP endpoint. POSTing to the endpoint with the task’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. Add an API trigger on the web, either while you create the task or later with the steps below. You can’t add an API trigger or manage its token from the CLI. 1 -Open the routine for editing - -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then open the menu next to the routine’s name and select **Edit**. +Open the task for editing + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the scheduled task you want to trigger via API, then open the menu next to its name and select **Edit**. The **Edit scheduled task** dialog opens. 2 Add an API trigger -Scroll to the **Select a trigger** section below the **Instructions** box, click **Add another trigger** , and choose **API**. +In the **Trigger** row, click **+** and select **API** from the menu that opens. A panel with the **Fire URL** and **Token** for this task appears. 3 Copy the URL and generate a token -The modal shows the URL for this routine along with a sample curl command. Copy the URL, then click **Generate token** and copy the token immediately. The token is shown once and cannot be retrieved later, so store it somewhere secure such as your alerting tool’s secret store. +Copy the **Fire URL**. Click **Generate token** , then copy the token from the **Token generated** dialog immediately. The token is shown once and can’t be retrieved later, so store it somewhere secure such as your alerting tool’s secret store.The API trigger takes effect as soon as you generate the token. You don’t need to click **Save changes** , so close the dialog when you’re done. 4 Call the endpoint -Send the token in the `Authorization: Bearer` header when you POST to the URL. The Trigger a routine section below shows a complete example. - -Each routine has its own token, scoped to triggering that routine only. To turn off API access or rotate the token, return to the same modal: - - * **Turn off API access** : click **Delete token** , the trash icon next to **Regenerate** - * **Rotate the token** : click **Regenerate** +Send the token in the `Authorization: Bearer` header when you POST to the URL. Trigger a scheduled task shows a complete example. + +Each scheduled task has its own token, scoped to triggering that task only. To turn off API access or rotate the token, open the task’s **Edit scheduled task** dialog again. Both controls are next to the token in the API trigger’s panel and take effect immediately: + + * **Turn off API access** : click **Delete token** , the trash icon next to **Regenerate**. This removes the API trigger + * **Rotate the token** : click **Regenerate**. The previous token stops working, and the **Token generated** dialog shows the new one once #### ​ -Trigger a routine - -Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The `text` value doesn’t reach the routine as a bare message. It arrives wrapped in a `<routine-fire-payload>` block that labels it as untrusted data and tells Claude not to follow instructions inside it unless the routine’s own prompt says to. The same wrapping applies to text supplied with **Run now** in the web UI. This means a routine’s saved prompt must opt in to acting on fire text: write the prompt to reference the payload explicitly, for example “Investigate the alert described in the routine-fire-payload block”, or the routine treats the text as inert context. Anyone holding the bearer token can send `text`, so the wrapper makes fire text from a leaked token arrive labeled as untrusted data rather than as direct instructions to your routine. The example below triggers a routine from a shell. The routine ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: +Trigger a scheduled task + +Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the task alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the task receives it as a literal string. The `text` value doesn’t reach the routine as a bare message. It arrives wrapped in a `<routine-fire-payload>` block that labels it as untrusted data and tells Claude not to follow instructions inside it unless the routine’s own prompt says to. The same wrapping applies to text supplied with **Run now** in the web UI. This means a routine’s saved prompt must opt in to acting on fire text: write the prompt to reference the payload explicitly, for example “Investigate the alert described in the routine-fire-payload block”, or the routine treats the text as inert context. Anyone holding the bearer token can send `text`, so the wrapper makes fire text from a leaked token arrive labeled as untrusted data rather than as direct instructions to your routine. The example below triggers a scheduled task from a shell. The task ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \ -H "Authorization: Bearer sk-ant-oat01-xxxxx" \ @@ -198,7 +243,7 @@ API reference -For the full API reference, including all error responses, validation rules, and field limits, see [Trigger a routine via API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) in the Claude Platform documentation. The `/fire` endpoint is available to claude.ai users only and is not part of the Claude Platform API surface. +For the full API reference, including all error responses, validation rules, and field limits, see [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) in the Claude Platform documentation. The `/fire` endpoint is available to claude.ai users only and is not part of the Claude Platform API surface. ### @@ -208,24 +253,24 @@ A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Claude Code doesn’t reuse sessions across events, so two PR updates produce two independent sessions. -GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. +GitHub webhook events are subject to per-task and per-account hourly caps. Events beyond the limit are dropped until the window resets. The Claude GitHub App must be installed on the repository you want to subscribe to, whichever surface you configure the trigger from. * Configure GitHub triggers from the web UI, which prompts you to install the app when it’s missing. Follow the steps below to configure one on the web. - * From the CLI, install the app from the [GitHub App page](<https://github.com/apps/claude>) first, then ask Claude to attach a GitHub trigger to an existing routine, for example `/schedule add a GitHub trigger to my nightly review for pull requests opened in acme/webapp`. The CLI path requires Claude Code v2.1.225 or later. When Claude adds the trigger, it replies with a link to the routine the trigger fires. + * From the CLI, install the app from the [GitHub App page](<https://github.com/apps/claude>) first, then ask Claude to attach a GitHub trigger to an existing scheduled task, for example `/schedule add a GitHub trigger to my nightly review for pull requests opened in acme/webapp`. The CLI path requires Claude Code v2.1.225 or later. When Claude adds the trigger, it replies with a link to the task the trigger fires. 1 -Open the routine for editing - -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then open the menu next to the routine’s name and select **Edit**. +Open the task for editing + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the scheduled task, then open the menu next to its name and select **Edit**. The **Edit scheduled task** dialog opens. 2 Add a GitHub event trigger -Scroll to the **Select a trigger** section, click **Add another trigger** , and choose **GitHub event**. +In the **Trigger** row, click **+** and select **GitHub event** from the menu that opens. Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. @@ -233,7 +278,7 @@ Configure the trigger -Select the repository, choose an event from the supported events list, and optionally add filters. Save the trigger. +Change the repository if needed, choose an event from the supported events list, and optionally add filters. Then click **Save changes** at the bottom of the dialog to apply the trigger. #### @@ -254,7 +299,7 @@ Filter pull requests -Use filters to narrow which pull requests start a new session. All filter conditions must match for the routine to trigger. The available filter fields are: +Use filters to narrow which pull requests start a new session. All filter conditions must match for the scheduled task to trigger. The available filter fields are: Filter| Matches ---|--- @@ -270,16 +315,16 @@ Each filter pairs a field with an operator: equals, contains, starts with, is one of, is not one of, or matches regex. The `matches regex` operator tests the entire field value, not a substring within it. To match any title containing `hotfix`, write `.*hotfix.*`. Without the surrounding `.*`, the filter matches only a title that is exactly `hotfix` with nothing before or after. For literal substring matching without regex syntax, use the `contains` operator instead. A few example filter combinations: * **Auth module review** : base branch `main`, head branch contains `auth-provider`. Sends any PR that touches authentication to a focused reviewer. - * **Ready-for-review only** : is draft is `false`. Skips drafts so the routine only runs when the PR is ready for review. - * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch routine only when a maintainer tags the PR. - -## - -​ - -Manage routines - -Click a routine in the list to open its detail page. The detail page shows the routine’s repositories, connectors, prompt, schedule, API tokens, GitHub triggers, and a list of past runs. + * **Ready-for-review only** : is draft is `false`. Skips drafts so the task only runs when the PR is ready for review. + * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch task only when a maintainer tags the PR. + +## + +​ + +Manage scheduled tasks + +Click a scheduled task in the list to open its detail page. The detail page shows the task’s repositories, connectors, prompt, schedule, API tokens, GitHub triggers, and a list of past runs. ### @@ -289,28 +334,28 @@ Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. -A green status in the run list means the session started and exited without an infrastructure error. It does not mean the task in your prompt succeeded. Open the run to read the transcript and confirm what Claude actually did. Blocked network requests, missing connector tools, and task-level failures all surface there rather than in the status indicator. - -### - -​ - -Edit and control routines - -From the routine detail page you can: - - * Click **Run now** to start a run immediately without waiting for the next scheduled time. You can optionally supply run-specific text, which reaches the routine the same way as the API trigger’s `text` field. - * Use the on/off switch at the top of the page to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. - * Open the menu next to the routine’s name and select **Edit** to change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. - * Open the same menu and select **Delete** to delete the routine. - -### - -​ - -Manage routines from the CLI - -The CLI supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. You can also ask about a routine’s run history, for example `/schedule why did my nightly review do nothing this morning?`. Claude lists the routine’s recent runs with their status and a link to open each run on the web, and reads a run’s log to explain what happened, including tool errors, permission denials, and the final result. Requires Claude Code v2.1.227 or later. +A green status in the run list means the session started and exited without an infrastructure error. It does not mean the work your prompt describes succeeded. Open the run to read the transcript and confirm what Claude actually did. Blocked network requests, missing connector tools, and failures in the work itself all surface there rather than in the status indicator. + +### + +​ + +Edit and control scheduled tasks + +From the detail page you can: + + * Click **Run now** to start a run immediately without waiting for the next scheduled time. + * Use the on/off switch at the top of the page to pause or resume the schedule. Paused tasks keep their configuration but don’t run until you turn them back on. + * Open the menu next to the task’s name and select **Edit** to change the name, prompt, repositories, environment, connectors, or any of the task’s triggers. The **Edit scheduled task** dialog opens with the same layout as the creation dialog. To add a trigger, click **+** in the **Trigger** row. Click **Save changes** to apply your edits. API token actions take effect immediately, without **Save changes**. + * Open the same menu and select **Delete** to delete the task. + +### + +​ + +Manage scheduled tasks from the CLI + +Run `/schedule list` to see your scheduled tasks, `/schedule update` to change one, or `/schedule run` to start one immediately. You can also ask about a scheduled task’s run history, for example `/schedule why did my nightly review do nothing this morning?`. Claude lists the task’s recent runs with their status and a link to open each run on the web. It also reads a run’s log to explain what happened, including tool errors, permission denials, and the final result. Requires Claude Code v2.1.227 or later. ### @@ -318,7 +363,11 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. On Team and Enterprise plans, an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization has to turn on each method before you can use it; see [Connect GitHub](</docs/en/web-quickstart#connect-github>). If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. If a GitHub pull request event triggers the run and the pull request’s repository is the first repository in the routine, that repository starts from the pull request’s head commit instead. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). +Scheduled tasks need GitHub access to clone repositories. When you create a scheduled task from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from. If it doesn’t, Claude adds a setup note naming how to grant it. + +See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. On Team and Enterprise plans, an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization has to turn on each method before you can use it; see [Connect GitHub](</docs/en/web-quickstart#connect-github>). + +If your GitHub connection is missing or expired when a run is due, the scheduled task skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the task resumes on its own. After 72 hours without a connection, the task turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. If a GitHub pull request event triggers the run and the pull request’s repository is the task’s first repository, that repository starts from the pull request’s head commit instead. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). ### @@ -326,7 +375,12 @@ Connectors -Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>). For a routine with one repository, you can instead declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. +Scheduled tasks can use your connected MCP connectors to read from and write to external services during each run. For example, a task that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a scheduled task: + + * **As a connector** : add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) + * **In the repository** : for a scheduled task with one repository, you can instead declare the server in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository + +When you create a scheduled task, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the task’s creation or edit dialog. To manage or add connectors outside of that dialog, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. ### @@ -334,7 +388,7 @@ When a run publishes an artifact without asking -When a routine’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold: +When a scheduled task’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold: * You can edit the artifact and it belongs to your own organization * If the publish carries more than the page, such as supporting files, you own the artifact @@ -344,7 +398,7 @@ * The publish doesn’t declare runtime capabilities for the page * The existing page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) -In every other case, including a run that an API or GitHub trigger starts, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. +In every other case, including a run that an API or GitHub trigger starts, Claude asks first. When a scheduled task’s job is to keep a page current, give it an artifact you already published. ### @@ -352,19 +406,19 @@ Environments and network access -Each routine uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. +Each scheduled task uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The task inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the task work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. 1 -Open the routine for editing - -On the routine’s detail page, open the menu next to the routine’s name and select **Edit**. +Open the task for editing + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the scheduled task, then open the menu next to its name and select **Edit**. The **Edit scheduled task** dialog opens. 2 Open the environment selector -Below the **Instructions** box, select the cloud icon showing your environment’s name, such as **Default**. +Go to **Advanced settings > General > Cloud environment**, expanding **Advanced settings** first if it’s collapsed. Click the cloud icon showing your environment’s name, such as **Default**. 3 @@ -382,7 +436,7 @@ Save -Click **Save changes**. The new policy applies from the next run. +Click **Save changes** in the **Edit cloud environment** dialog, then close the **Edit scheduled task** dialog behind it. The new policy applies from the next run. See [Network access](</docs/en/cloud-environments#network-access>) for details on access levels and the default allowlist. @@ -392,17 +446,30 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. See your current consumption at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). Separately from subscription usage, each way of starting a run has an hourly limit: +Scheduled tasks draw down subscription usage the same way interactive sessions do. See your current consumption at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). Separately from subscription usage, each way of starting a run has an hourly limit: Action| Limit| Counted for| Over the limit ---|---|---|--- Scheduled runs, including one-off runs| 100 per hour| Your account| The run waits until the limit resets -**Run now** , API fires, and setting a one-off routine to run again| 30 per hour| Each routine, one count shared by all three| The action fails until the limit resets -**Run now** and setting a one-off routine to run again| 100 per hour| Your account| Same +**Run now** , API fires, and setting a one-off task to run again| 30 per hour| Each scheduled task, one count shared by all three| The action fails until the limit resets +**Run now** and setting a one-off task to run again| 100 per hour| Your account| Same API fires| 100 per hour| Your account, counted separately from **Run now**| Same GitHub events| See Add a GitHub trigger| | -None of these hourly limits has overage. When a routine hits your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until your usage window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. +None of these hourly limits has overage. When a scheduled task hits your subscription usage limit, organizations with usage credits turned on can keep running scheduled tasks on metered overage. Without usage credits, additional runs are rejected until your usage window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). While your subscription is paused, your scheduled tasks are put on hold and don’t run. Once your subscription is active again, turn them back on. + +## + +​ + +Where the name routines still appears + +Scheduled tasks were previously called routines, and these places keep the earlier name. Each one refers to the same feature: + + * **Web address** : `claude.ai/code/routines` + * **CLI** : the `/routines` alias for `/schedule`, the command’s description, and Claude’s replies while it sets up a task + * **API** : the `/fire` endpoint path, its beta header, its response `type`, the `<routine-fire-payload>` tag, and the [Trigger a routine through the API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) reference page + * **Organization settings** : the **Scheduled tasks (Was Routines)** toggle ## @@ -420,11 +487,11 @@ * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well * You are fully signed out, with no API key or other credential. With feature-flag fetching enabled, submitting `/schedule` shows `/schedule requires a claude.ai subscription. Run /login to sign in with your claude.ai account.` Before v2.1.268, a signed-out session showed the same Claude for Enterprise message as a Console API key - * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead - * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which routines require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule` - * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it - -Unless your organization’s policy disables routines or cloud sessions, you can create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. + * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage scheduled tasks from the [web UI](<https://claude.ai/code/routines>) instead + * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which scheduled tasks require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule` + * An Owner turned off scheduled tasks for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the task when Claude tried to create or run it + +Unless your organization’s policy disables scheduled tasks or cloud sessions, you can create and manage scheduled tasks at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. ### @@ -432,7 +499,7 @@ “Routines are disabled by your organization’s policy” -An Owner in your Team or Enterprise organization has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). On Claude Code v2.1.227 or later, the same toggle also hides `/schedule` in the CLI. This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to enable routines for your organization. +An Owner in your Team or Enterprise organization has likely turned off the **Scheduled tasks (Was Routines)** toggle at [**Organization settings > Capabilities > Remote sessions**](<https://claude.ai/admin-settings/capabilities>). On Claude Code v2.1.227 or later, the same toggle also hides `/schedule` in the CLI. This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to turn scheduled tasks back on for your organization. ## @@ -443,6 +510,6 @@ * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions - * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; routines created from a project appear on its **Routines** tab + * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; scheduled tasks created from a project appear on its **Scheduled tasks** tab * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events
modified
--- a/routines.md +++ b/routines.md @@ -55,7 +55,7 @@ Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so in an Anthropic-hosted environment, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. @@ -376,7 +376,7 @@ Change the network access level -In the **Edit environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. +In the **Edit cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. 5
modified
--- a/routines.md +++ b/routines.md @@ -22,15 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker, and the session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some [artifact](</docs/en/artifacts>) actions. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. When the routine’s schedule or **Run now** starts a run, Claude republishes an existing artifact without asking only when all of these hold: - - * You can edit the artifact and it belongs to your own organization - * The artifact isn’t shared publicly - * If the artifact is shared with specific people or your organization, its viewers don’t automatically see each new version - * The publish carries only the page, with no supporting files or anything else added, and doesn’t force over a newer version - * The page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) - -In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker, and the session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some artifact actions. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -142,7 +134,7 @@ Add an API trigger -An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. API triggers are added to an existing routine from the web. The CLI cannot currently create or revoke tokens. +An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. API triggers are added to an existing routine from the web. The CLI can’t currently create, regenerate, or delete tokens. 1 @@ -168,7 +160,10 @@ Send the token in the `Authorization: Bearer` header when you POST to the URL. The Trigger a routine section below shows a complete example. -Each routine has its own token, scoped to triggering that routine only. To rotate or revoke it, return to the same modal and click **Regenerate** or **Revoke**. +Each routine has its own token, scoped to triggering that routine only. To turn off API access or rotate the token, return to the same modal: + + * **Turn off API access** : click **Delete token** , the trash icon next to **Regenerate** + * **Rotate the token** : click **Regenerate** #### @@ -337,6 +332,24 @@ ​ +When a run publishes an artifact without asking + +When a routine’s schedule or **Run now** starts a run, Claude can publish a new [artifact](</docs/en/artifacts>) without asking. The new artifact is visible only to you until you [share it](</docs/en/artifacts#share-an-artifact>). If the publish declares runtime capabilities for the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) or [file downloads](</docs/en/artifacts#offer-a-file-download>), Claude asks first. In those runs, Claude republishes an existing artifact without asking only when all of these hold: + + * You can edit the artifact and it belongs to your own organization + * If the publish carries more than the page, such as supporting files, you own the artifact + * The artifact isn’t shared publicly + * If the artifact is shared with specific people or your organization, its viewers don’t automatically see each new version + * The publish doesn’t force over a newer version + * The publish doesn’t declare runtime capabilities for the page + * The existing page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) + +In every other case, including a run that an API or GitHub trigger starts, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. + +### + +​ + Environments and network access Each routine uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead.
modified
--- a/routines.md +++ b/routines.md @@ -54,7 +54,7 @@ Select repositories -Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run, starting from the default branch. Claude creates `claude/`-prefixed branches for its changes. +Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run. Claude creates `claude/`-prefixed branches for its changes. 4 @@ -323,7 +323,7 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. On Team and Enterprise plans, an [Owner](</docs/en/server-managed-settings#access-control>) of your Claude organization has to turn on each method before you can use it; see [Connect GitHub](</docs/en/web-quickstart#connect-github>). If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. If a GitHub pull request event triggers the run and the pull request’s repository is the first repository in the routine, that repository starts from the pull request’s head commit instead. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). ###
modified
--- a/routines.md +++ b/routines.md @@ -63,7 +63,7 @@ Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [API credentials](</docs/en/cloud-environments#add-api-credentials>) instead. That section also lists the requests that never get a credential + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [network secrets](</docs/en/cloud-environments#add-network-secrets>) instead. That section also lists the requests that never get a secret * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first.
modified
--- a/routines.md +++ b/routines.md @@ -363,7 +363,7 @@ Change the network access level -In the **Edit cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. +In the **Edit environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. 5
modified
--- a/routines.md +++ b/routines.md @@ -323,11 +323,7 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: - - * The branch is protected on GitHub - * Someone else has an open pull request from that branch - * The branch carries commits authored by someone other than you +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to a branch prefixed with `claude/` unless your prompt directs it to push to another branch. To control which branches a run can push to, use branch protection rules or rulesets on GitHub. For runs on Anthropic-managed infrastructure, and for self-hosted runs that push through [Anthropic’s git proxy](</docs/en/self-hosted-environments-deploy#use-the-anthropic-git-proxy>), GitHub applies them to the GitHub access you connected, so a rule that access can bypass doesn’t block a run’s push. A self-hosted run that pushes with the git credentials your deployment provides is checked against those instead. See [Configure git](</docs/en/self-hosted-environments-deploy#configure-git>). ### @@ -367,7 +363,7 @@ Change the network access level -In the **Update cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. +In the **Edit cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. 5
modified
--- a/routines.md +++ b/routines.md @@ -30,7 +30,7 @@ * The publish carries only the page, with no supporting files or anything else added, and doesn’t force over a newer version * The page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) -In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and their runs count against your account’s usage and limits. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -134,7 +134,7 @@ /schedule in 2 weeks, open a cleanup PR that removes the feature flag -The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs do not count against the daily routine run cap. See Usage and limits for details. +The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs count against the same hourly limit as other scheduled runs. See Usage and limits for details. ### @@ -213,7 +213,7 @@ A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Claude Code doesn’t reuse sessions across events, so two PR updates produce two independent sessions. -During the research preview, GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. See your current limits at [claude.ai/code/routines](<https://claude.ai/code/routines>). +GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. The Claude GitHub App must be installed on the repository you want to subscribe to, whichever surface you configure the trigger from. @@ -383,7 +383,17 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session. While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. +Routines draw down subscription usage the same way interactive sessions do. See your current consumption at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). Separately from subscription usage, each way of starting a run has an hourly limit: + +Action| Limit| Counted for| Over the limit +---|---|---|--- +Scheduled runs, including one-off runs| 100 per hour| Your account| The run waits until the limit resets +**Run now** , API fires, and setting a one-off routine to run again| 30 per hour| Each routine, one count shared by all three| The action fails until the limit resets +**Run now** and setting a one-off routine to run again| 100 per hour| Your account| Same +API fires| 100 per hour| Your account, counted separately from **Run now**| Same +GitHub events| See Add a GitHub trigger| | + +None of these hourly limits has overage. When a routine hits your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until your usage window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. ##
modified
--- a/routines.md +++ b/routines.md @@ -25,7 +25,8 @@ Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker, and the session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some [artifact](</docs/en/artifacts>) actions. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. When the routine’s schedule or **Run now** starts a run, Claude republishes an existing artifact without asking only when all of these hold: * You can edit the artifact and it belongs to your own organization - * The artifact isn’t shared publicly, and isn’t shared with specific people or your organization with the latest version chosen as the version viewers see + * The artifact isn’t shared publicly + * If the artifact is shared with specific people or your organization, its viewers don’t automatically see each new version * The publish carries only the page, with no supporting files or anything else added, and doesn’t force over a newer version * The page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) @@ -79,7 +80,7 @@ * API -Pick a preset frequency for a recurring run, or schedule a single one-off run at a specific timestamp. See Add a schedule trigger for timezone handling, stagger, custom cron intervals, and one-off runs. +Pick a preset frequency for a recurring run, or schedule a single one-off run at a specific timestamp. See Add a schedule trigger for timezone handling, late starts, custom cron intervals, and one-off runs. Select the repository, the event to react to, and optional filters. See Add a GitHub trigger for the full list of supported events and filter fields. @@ -119,7 +120,7 @@ Add a schedule trigger -A schedule trigger runs the routine on a recurring cadence, or once at a specific future time. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. +A schedule trigger runs the routine on a recurring cadence, or once at a specific future time. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. If you schedule a run exactly on the hour, such as 9:00, it can start several minutes late. To start close to the scheduled time, pick a few minutes past the hour, for example 9:07. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. ####
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,14 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker, and the session runs shell commands, uses [skills](</docs/en/skills>) committed to the cloned repository, and calls any connectors you include, all without stopping for approval apart from some [artifact](</docs/en/artifacts>) actions. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. When the routine’s schedule or **Run now** starts a run, Claude republishes an existing artifact without asking only when all of these hold: + + * You can edit the artifact and it belongs to your own organization + * The artifact isn’t shared publicly, and isn’t shared with specific people or your organization with the latest version chosen as the version viewers see + * The publish carries only the page, with no supporting files or anything else added, and doesn’t force over a newer version + * The page holds no grant that reaches beyond the page, such as [connector calls](</docs/en/artifacts#pull-live-data-with-mcp-connectors>) + +In every other case, including publishing a new artifact, Claude asks first. When a routine’s job is to keep a page current, give it an artifact you already published. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -315,7 +322,7 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. If your GitHub connection is missing or expired when a run is due, the routine skips runs until you reconnect, for up to 72 hours. Reconnect GitHub within that window and the routine resumes on its own. After 72 hours without a connection, the routine turns off, and you turn it back on after reconnecting GitHub. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: * The branch is protected on GitHub * Someone else has an open pull request from that branch @@ -335,7 +342,7 @@ Environments and network access -Each routine uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains: +Each routine uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains on one of your own environments, follow these steps. An [organization-shared environment](</docs/en/cloud-environments#organization-shared-environments>) opens read-only here, so an Owner changes its network access from the **Cloud environments** page in [admin settings](<https://claude.ai/admin-settings>) instead. 1 @@ -375,7 +382,7 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session. +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session. While your subscription is paused, your routines are put on hold and don’t run. Once your subscription is active again, turn them back on. ## @@ -393,7 +400,7 @@ * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well * You are fully signed out, with no API key or other credential. With feature-flag fetching enabled, submitting `/schedule` shows `/schedule requires a claude.ai subscription. Run /login to sign in with your claude.ai account.` Before v2.1.268, a signed-out session showed the same Claude for Enterprise message as a Console API key - * You are inside a cloud session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead + * You are inside a cloud session, where submitting `/schedule` answers that the command isn’t available in that environment. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which routines require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule` * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it
modified
--- a/routines.md +++ b/routines.md @@ -140,7 +140,7 @@ Open the routine for editing -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then click the pencil icon to open **Edit routine**. +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then open the menu next to the routine’s name and select **Edit**. 2 @@ -216,7 +216,7 @@ Open the routine for editing -Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then click the pencil icon to open **Edit routine**. +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then open the menu next to the routine’s name and select **Edit**. 2 @@ -297,9 +297,9 @@ From the routine detail page you can: * Click **Run now** to start a run immediately without waiting for the next scheduled time. You can optionally supply run-specific text, which reaches the routine the same way as the API trigger’s `text` field. - * Use the toggle in the **Repeats** section to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. - * Click the pencil icon to open **Edit routine** and change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. - * Click the delete icon to remove the routine. Past sessions created by the routine remain in your session list. + * Use the on/off switch at the top of the page to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. + * Open the menu next to the routine’s name and select **Edit** to change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. + * Open the same menu and select **Delete** to delete the routine. ### @@ -327,7 +327,7 @@ Connectors -Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), or declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. +Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>). For a routine with one repository, you can instead declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. ### @@ -341,7 +341,7 @@ Open the routine for editing -On the routine’s detail page, click the pencil icon to open **Edit routine**. +On the routine’s detail page, open the menu next to the routine’s name and select **Edit**. 2 @@ -416,5 +416,6 @@ * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions + * [Projects](</docs/en/claude-projects>): ongoing work Claude coordinates across parallel cloud sessions; routines created from a project appear on its **Routines** tab * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events
modified
--- a/routines.md +++ b/routines.md @@ -120,7 +120,7 @@ Schedule a one-off run -A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. +A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to start a follow-up task after an upstream change ships. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. /schedule tomorrow at 9am, summarize yesterday's merged PRs @@ -389,22 +389,15 @@ `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key or an Anthropic profile with feature-flag fetching enabled. The cause is usually one of the following: - - * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well - * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead - * Your organization’s policy disables [Claude Code on the web](</docs/en/claude-code-on-the-web>), which routines run on +The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type. Submitting it returns `Unknown command: /schedule`, except in the cases below that note a different answer. The cause is usually one of the following: + + * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, and feature-flag fetching enabled, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well + * You are fully signed out, with no API key or other credential. With feature-flag fetching enabled, submitting `/schedule` shows `/schedule requires a claude.ai subscription. Run /login to sign in with your claude.ai account.` Before v2.1.268, a signed-out session showed the same Claude for Enterprise message as a Console API key + * You are inside a cloud session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead + * Your organization’s policy disables [cloud sessions](</docs/en/claude-code-on-the-web>), which routines require. In this case, submitting `/schedule` answers [`Cloud sessions are disabled by your organization's policy`](</docs/en/errors#cloud-sessions-are-disabled-by-your-organizations-policy>) instead. Before v2.1.268, it returned `Unknown command: /schedule` * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it -Unless your organization’s policy disables routines or Claude Code on the web, you can create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. - -### - -​ - -`/schedule` asks you to authenticate - -If `/schedule` runs but Claude responds that you need to authenticate with a claude.ai account first, the CLI has no stored claude.ai login. API accounts aren’t supported for routines. Run `/login`, sign in with your claude.ai account, then run `/schedule` again. +Unless your organization’s policy disables routines or cloud sessions, you can create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. ###
modified
--- a/routines.md +++ b/routines.md @@ -55,7 +55,7 @@ Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so store keys for the APIs Claude calls during a run as [API credentials](</docs/en/cloud-environments#add-api-credentials>) instead. That section also lists the requests that never get a credential + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so on Pro and Max plans, store keys for the APIs Claude calls during a run as [API credentials](</docs/en/cloud-environments#add-api-credentials>) instead. That section also lists the requests that never get a credential * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first.
modified
--- a/routines.md +++ b/routines.md @@ -120,11 +120,7 @@ Schedule a one-off run -A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. - -One-off scheduling from the CLI is rolling out gradually and may not be available on your account yet. If `/schedule` only offers recurring schedules, create the one-off run from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>) instead. - -Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. +A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. /schedule tomorrow at 9am, summarize yesterday's merged PRs @@ -396,7 +392,6 @@ The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key or an Anthropic profile with feature-flag fetching enabled. The cause is usually one of the following: * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well - * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings-reference#all-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [Claude Code on the web](</docs/en/claude-code-on-the-web>), which routines run on * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it
modified
--- a/routines.md +++ b/routines.md @@ -6,7 +6,7 @@ * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token * **GitHub** : run automatically in response to repository events such as pull requests or releases -A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise Owners can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. +A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise Owners can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. ## @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. If **Routines** is missing from the Desktop sidebar, routines aren’t available to your account: they need a Pro, Max, Team, or Enterprise plan with Claude Code on the web enabled, and on Team and Enterprise plans an Owner can turn them off with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar or in the sidebar’s **More** menu, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -55,7 +55,7 @@ Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so add credentials with that in mind + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so store keys for the APIs Claude calls during a run as [API credentials](</docs/en/cloud-environments#add-api-credentials>) instead. That section also lists the requests that never get a credential * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first.
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. If **Routines** is missing from the Desktop sidebar, routines aren’t available to your account; see “Routines are disabled by your organization’s policy”. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. If **Routines** is missing from the Desktop sidebar, routines aren’t available to your account: they need a Pro, Max, Team, or Enterprise plan with Claude Code on the web enabled, and on Team and Enterprise plans an Owner can turn them off with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -319,7 +319,7 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub connected and prompts you to run `/web-setup` if it doesn’t. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub access for the repository you ran it from and, if it doesn’t, adds a setup note naming how to grant it. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: * The branch is protected on GitHub * Someone else has an open pull request from that branch
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. If **Routines** is missing from the Desktop sidebar, routines aren’t available to your account; see “Routines are disabled by your organization’s policy”. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ###
modified
--- a/routines.md +++ b/routines.md @@ -396,7 +396,7 @@ The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key or an Anthropic profile with feature-flag fetching enabled. The cause is usually one of the following: * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well - * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on + * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings-reference#all-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead * Your organization’s policy disables [Claude Code on the web](</docs/en/claude-code-on-the-web>), which routines run on * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app’s **Code** tab, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ###
modified
--- a/routines.md +++ b/routines.md @@ -40,7 +40,7 @@ Name the routine and write the prompt -Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.When a trigger fires, the session receives the routine’s saved prompt as its assigned task and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account, so the fired prompt is not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. Before v2.1.214, the session received the same prompt framed as an untrusted background notification and could refuse to act on it.The prompt input includes a model selector. Claude uses the selected model on every run. +Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.When a trigger fires, the session receives the routine’s saved prompt as its assigned task and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account, so the fired prompt is not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. Before v2.1.213, the session received the same prompt framed as an untrusted background notification and could refuse to act on it.The prompt input includes a model selector. Claude uses the selected model on every run. 3 @@ -96,7 +96,7 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines. To add an API trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). You can add a GitHub trigger from the web or from the CLI. The CLI path requires Claude Code v2.1.225 or later. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. ## @@ -211,7 +211,10 @@ During the research preview, GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. See your current limits at [claude.ai/code/routines](<https://claude.ai/code/routines>). -GitHub triggers are configured from the web UI only. +The Claude GitHub App must be installed on the repository you want to subscribe to, whichever surface you configure the trigger from. + + * Configure GitHub triggers from the web UI, which prompts you to install the app when it’s missing. Follow the steps below to configure one on the web. + * From the CLI, install the app from the [GitHub App page](<https://github.com/apps/claude>) first, then ask Claude to attach a GitHub trigger to an existing routine, for example `/schedule add a GitHub trigger to my nightly review for pull requests opened in acme/webapp`. The CLI path requires Claude Code v2.1.225 or later. When Claude adds the trigger, it replies with a link to the routine the trigger fires. 1 @@ -225,15 +228,9 @@ Scroll to the **Select a trigger** section, click **Add another trigger** , and choose **GitHub event**. +Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. + 3 - -Install the Claude GitHub App - -The Claude GitHub App must be installed on the repository you want to subscribe to. The trigger setup prompts you to install it if it isn’t already. - -Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. - -4 Configure the trigger @@ -312,6 +309,14 @@ ​ +Manage routines from the CLI + +The CLI supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. You can also ask about a routine’s run history, for example `/schedule why did my nightly review do nothing this morning?`. Claude lists the routine’s recent runs with their status and a link to open each run on the web, and reads a run’s log to explain what happened, including tool errors, permission denials, and the final result. Requires Claude Code v2.1.227 or later. + +### + +​ + Repositories and branch permissions Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub connected and prompts you to run `/web-setup` if it doesn’t. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: @@ -388,13 +393,15 @@ `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key with feature-flag fetching enabled. The cause is usually one of the following: - - * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login +The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key or an Anthropic profile with feature-flag fetching enabled. The cause is usually one of the following: + + * You are authenticated with a Console API key, an [Anthropic profile or federation credential](</docs/en/authentication#anthropic-profiles-and-federation-credentials>), or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key or a profile, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login. A profile or federation credential takes precedence too, so switch that off as well * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead - -You can always create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. + * Your organization’s policy disables [Claude Code on the web](</docs/en/claude-code-on-the-web>), which routines run on + * An Owner turned off routines for your Team or Enterprise organization. Before v2.1.227, the command still appeared in this case, and claude.ai rejected the routine when Claude tried to create or run it + +Unless your organization’s policy disables routines or Claude Code on the web, you can create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. ### @@ -408,9 +415,9 @@ ​ -”Routines are disabled by your organization’s policy” - -An Owner in your Team or Enterprise organization has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to enable routines for your organization. +“Routines are disabled by your organization’s policy” + +An Owner in your Team or Enterprise organization has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). On Claude Code v2.1.227 or later, the same toggle also hides `/schedule` in the CLI. This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to enable routines for your organization. ##
modified
--- a/routines.md +++ b/routines.md @@ -14,7 +14,7 @@ Example use cases -Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. The sections below walk through creating a routine and configuring each of these trigger types. +Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. ## @@ -130,7 +130,7 @@ /schedule in 2 weeks, open a cleanup PR that removes the feature flag -The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs do not count against the daily routine run cap. They consume your plan’s regular subscription usage like any other session. See Usage and limits for details. +The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs do not count against the daily routine run cap. See Usage and limits for details. ### @@ -207,7 +207,7 @@ Add a GitHub trigger -A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Each matching event starts its own session. +A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Claude Code doesn’t reuse sessions across events, so two PR updates produce two independent sessions. During the research preview, GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. See your current limits at [claude.ai/code/routines](<https://claude.ai/code/routines>). @@ -231,7 +231,7 @@ The Claude GitHub App must be installed on the repository you want to subscribe to. The trigger setup prompts you to install it if it isn’t already. -Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. GitHub triggers require installing the Claude GitHub App, which the trigger setup prompts you to do. +Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. 4 @@ -277,14 +277,6 @@ * **Ready-for-review only** : is draft is `false`. Skips drafts so the routine only runs when the PR is ready for review. * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch routine only when a maintainer tags the PR. -#### - -​ - -How sessions map to events - -Each matching GitHub event starts a new session. Session reuse across events is not available for GitHub-triggered routines, so two PR updates produce two independent sessions. - ## ​ @@ -382,7 +374,7 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session. ##
modified
--- a/routines.md +++ b/routines.md @@ -1,6 +1,6 @@ Routines are in research preview. Behavior, limits, and the API surface may change. -A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it: +A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, or on your organization’s [self-hosted environment](</docs/en/self-hosted-environments>) when routed there, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it: * **Scheduled** : run on a recurring cadence like hourly, nightly, or weekly, or once at a specific future time * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token
modified
--- a/routines.md +++ b/routines.md @@ -396,9 +396,9 @@ `/schedule` returns “Unknown command” -The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: - - * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login +The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule` in every case below except a Console API key with feature-flag fetching enabled. The cause is usually one of the following: + + * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. With a Console API key, submitting `/schedule` instead shows `/schedule is available with Claude for Enterprise — ask your admin about migrating from API-key access`. With a cloud-provider login, you still see `Unknown command: /schedule`. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -80,9 +80,9 @@ 6 -Review connectors and permissions - -The **Connectors** and **Permissions** tabs at the bottom of the form control what the routine can reach.Under Connectors, all of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the routine doesn’t need. Claude can use every tool from an included connector, including writes, without asking for permission during a run.Under Permissions, enable **Allow unrestricted branch pushes** for any repository where Claude should be able to push to existing branches instead of only `claude/`-prefixed ones. +Review connectors + +Under **Connectors** at the bottom of the form, all of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the routine doesn’t need: Claude can use every tool from an included connector, including writes, without asking for permission during a run. 7 @@ -322,7 +322,11 @@ Repositories and branch permissions -Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub connected and prompts you to run `/web-setup` if it doesn’t. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. By default, Claude can only push to branches prefixed with `claude/`. This prevents routines from accidentally modifying protected or long-lived branches. To remove this restriction for a specific repository, enable **Allow unrestricted branch pushes** for that repository when creating or editing the routine. +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub connected and prompts you to run `/web-setup` if it doesn’t. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. Claude pushes its work to branches prefixed with `claude/`, which are always accepted. When your prompt directs Claude to push to another branch, Claude Code checks the push first and rejects it if any of the following is true: + + * The branch is protected on GitHub + * Someone else has an open pull request from that branch + * The branch carries commits authored by someone other than you ###
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/cloud-environments>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -52,13 +52,13 @@ Select an environment -Pick a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for the routine. Environments control what the cloud session has access to: +Pick a [cloud environment](</docs/en/cloud-environments>) for the routine. Environments control what the cloud session has access to: * **Network access** : set the level of internet access available during each run - * **Environment variables** : provide API keys, tokens, or other secrets Claude can use - * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/claude-code-on-the-web#environment-caching>), so the script doesn’t re-run on every session - -A **Default** environment is provided with **Trusted** network access, which allows the [default set](</docs/en/claude-code-on-the-web#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains, but blocks everything else. If your routine needs to reach your own services or a domain outside that list, edit the environment’s [network access](</docs/en/claude-code-on-the-web#network-access>) before running. To use a separate environment, [create one](</docs/en/claude-code-on-the-web#configure-your-environment>) first. + * **Environment variables** : provide values Claude can use during each run. They’re [visible to anyone who uses the environment](</docs/en/cloud-environments#what-carries-over-from-your-setup>), so add credentials with that in mind + * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/cloud-environments#environment-caching>), so the script doesn’t re-run on every session + +A **Default** environment is provided with **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains through the session’s network. Connectors you add to the routine reach their services through Anthropic’s servers, so they don’t need allowlist changes. If your routine needs to reach your own services directly, or a domain outside that list, edit the environment’s [network access](</docs/en/cloud-environments#network-access>) before running. To use a separate environment, [create one](</docs/en/cloud-environments#configure-your-environment>) first. 5 @@ -338,7 +338,7 @@ Environments and network access -Each routine runs in a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access: the [default allowlist](</docs/en/claude-code-on-the-web#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains is reachable, but arbitrary domains are not. Outbound requests to other hosts fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains: +Each routine uses a [cloud environment](</docs/en/cloud-environments>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access, which allows only the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) through the session’s network. Requests on that path to hosts outside the allowlist fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers rather than that path, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains: 1 @@ -362,7 +362,7 @@ Change the network access level -In the **Update cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/claude-code-on-the-web#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. +In the **Update cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/cloud-environments#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. 5 @@ -370,7 +370,7 @@ Click **Save changes**. The new policy applies from the next run. -See [Network access](</docs/en/claude-code-on-the-web#network-access>) for details on access levels and the default allowlist. +See [Network access](</docs/en/cloud-environments#network-access>) for details on access levels and the default allowlist. ## @@ -424,6 +424,6 @@ * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files - * [Cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>): configure the runtime environment for cloud sessions + * [Cloud environments](</docs/en/cloud-environments>): configure network access, environment variables, and setup scripts for cloud sessions * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Remote** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Cloud** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ###
modified
--- a/routines.md +++ b/routines.md @@ -40,7 +40,7 @@ Name the routine and write the prompt -Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.The prompt input includes a model selector. Claude uses the selected model on every run. +Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.When a trigger fires, the session receives the routine’s saved prompt as its assigned task and carries it out, rather than treating it as untrusted content that arrived mid-conversation. The trigger attests only that the prompt was stored ahead of time by an authorized session on your account, so the fired prompt is not live user input and can’t act as approval or consent for actions during the run. Content the session fetches during the run keeps its normal handling. Before v2.1.214, the session received the same prompt framed as an untrusted background notification and could refuse to act on it.The prompt input includes a model selector. Claude uses the selected model on every run. 3
modified
--- a/routines.md +++ b/routines.md @@ -330,7 +330,7 @@ Connectors -Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), or declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI. +Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), or declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>) or use `/schedule update` in the CLI. ### @@ -378,7 +378,7 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits from **Settings > Billing** on claude.ai. One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits at [claude.ai/settings/usage](<https://claude.ai/settings/usage>). On Team and Enterprise plans, an admin turns them on for the organization at [claude.ai/admin-settings/usage](<https://claude.ai/admin-settings/usage>). One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. ##
modified
--- a/routines.md +++ b/routines.md @@ -96,7 +96,7 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. The command is also available under the alias `/routines`. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. ##
modified
--- a/routines.md +++ b/routines.md @@ -14,7 +14,7 @@ Example use cases -Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. The sections below walk through creating a routine and configuring each of these trigger types. +Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine’s prompt tells Claude to investigate the alert in the fire payload, so it pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. The sections below walk through creating a routine and configuring each of these trigger types. ## @@ -96,7 +96,7 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. A routine with no schedule trigger, such as one started only by API calls or GitHub events, has no next run time, and the CLI shows none when Claude saves or updates it. Before v2.1.211, the CLI reported a next run time in the year 1 for these routines. ## @@ -172,7 +172,7 @@ Trigger a routine -Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The example below triggers a routine from a shell. The routine ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: +Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The `text` value doesn’t reach the routine as a bare message. It arrives wrapped in a `<routine-fire-payload>` block that labels it as untrusted data and tells Claude not to follow instructions inside it unless the routine’s own prompt says to. The same wrapping applies to text supplied with **Run now** in the web UI. This means a routine’s saved prompt must opt in to acting on fire text: write the prompt to reference the payload explicitly, for example “Investigate the alert described in the routine-fire-payload block”, or the routine treats the text as inert context. Anyone holding the bearer token can send `text`, so the wrapper makes fire text from a leaked token arrive labeled as untrusted data rather than as direct instructions to your routine. The example below triggers a routine from a shell. The routine ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \ -H "Authorization: Bearer sk-ant-oat01-xxxxx" \ @@ -311,7 +311,7 @@ From the routine detail page you can: - * Click **Run now** to start a run immediately without waiting for the next scheduled time. + * Click **Run now** to start a run immediately without waiting for the next scheduled time. You can optionally supply run-specific text, which reaches the routine the same way as the API trigger’s `text` field. * Use the toggle in the **Repeats** section to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. * Click the pencil icon to open **Edit routine** and change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. * Click the delete icon to remove the routine. Past sessions created by the routine remain in your session list.
modified
--- a/routines.md +++ b/routines.md @@ -96,7 +96,7 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. A successful start looks like a conversation: Claude asks follow-up questions about the schedule, repositories, and prompt before saving. If Claude instead replies that you need to authenticate or that it can’t connect to your remote claude.ai account, no routine was created; see Troubleshooting. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. ## @@ -120,7 +120,11 @@ Schedule a one-off run -A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. +A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. + +One-off scheduling from the CLI is rolling out gradually and may not be available on your account yet. If `/schedule` only offers recurring schedules, create the one-off run from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>) instead. + +Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. /schedule tomorrow at 9am, summarize yesterday's merged PRs @@ -168,7 +172,7 @@ Trigger a routine -Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The example below triggers a routine from a shell: +Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The example below triggers a routine from a shell. The routine ID and token shown are placeholders: replace them with the URL and token you copied when adding the API trigger, or the request fails with a `401` authentication error: curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \ -H "Authorization: Bearer sk-ant-oat01-xxxxx" \ @@ -386,16 +390,23 @@ ​ -`/schedule` shows “No commands match” or “Unknown command” - -The CLI hides `/schedule` when one of its requirements isn’t met, so the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: +`/schedule` returns “Unknown command” + +The CLI hides `/schedule` when one of its requirements isn’t met: the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead - * Your CLI is older than v2.1.81. Run `claude update` You can always create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. + +### + +​ + +`/schedule` asks you to authenticate + +If `/schedule` runs but Claude responds that you need to authenticate with a claude.ai account first, the CLI has no stored claude.ai login. API accounts aren’t supported for routines. Run `/login`, sign in with your claude.ai account, then run `/schedule` again. ###
modified
--- a/routines.md +++ b/routines.md @@ -390,7 +390,7 @@ The CLI hides `/schedule` when one of its requirements isn’t met, so the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: - * You are authenticated with a Console API key or a cloud provider such as Bedrock, Vertex, or Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login + * You are authenticated with a Console API key or a cloud provider such as Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead * Your CLI is older than v2.1.81. Run `claude update`
modified
--- a/routines.md +++ b/routines.md @@ -6,7 +6,7 @@ * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token * **GitHub** : run automatically in response to repository events such as pull requests or releases -A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise admins can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. +A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise Owners can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. ## @@ -386,9 +386,9 @@ ​ -`/schedule` returns “Unknown command” - -The CLI hides `/schedule` when one of its requirements is not met. The cause is usually one of the following: +`/schedule` shows “No commands match” or “Unknown command” + +The CLI hides `/schedule` when one of its requirements isn’t met, so the command menu shows `No commands match "/schedule"` while you type, and submitting it returns `Unknown command: /schedule`. The cause is usually one of the following: * You are authenticated with a Console API key or a cloud provider such as Bedrock, Vertex, or Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on @@ -403,7 +403,7 @@ ”Routines are disabled by your organization’s policy” -Your Team or Enterprise admin has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). This is a server-side organization setting, so it cannot be overridden from your local configuration. Contact your admin to request that routines be enabled for your organization. +An Owner in your Team or Enterprise organization has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). This is a server-side organization setting, so it cannot be overridden from your local configuration. Ask an Owner to enable routines for your organization. ##
modified
--- a/routines.md +++ b/routines.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - Routines are in research preview. Behavior, limits, and the API surface may change. A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it:
modified
--- a/routines.md +++ b/routines.md @@ -392,6 +392,21 @@ ​ +`/schedule` returns “Unknown command” + +The CLI hides `/schedule` when one of its requirements is not met. The cause is usually one of the following: + + * You are authenticated with a Console API key or a cloud provider such as Bedrock, Vertex, or Foundry. `/schedule` requires a claude.ai subscription login. If `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` is set in your shell, or `apiKeyHelper` is set in `settings.json`, remove it first, since these take precedence over a claude.ai login + * `DISABLE_TELEMETRY`, `DO_NOT_TRACK`, `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`, or `DISABLE_GROWTHBOOK` is set in your shell environment or in the `env` block of a [`settings.json` file](</docs/en/settings#available-settings>). These disable feature-flag fetching, which `/schedule` depends on + * You are inside a Claude Code on the web session. Manage routines from the [web UI](<https://claude.ai/code/routines>) instead + * Your CLI is older than v2.1.81. Run `claude update` + +You can always create and manage routines at [claude.ai/code/routines](<https://claude.ai/code/routines>) regardless of how the CLI is configured. + +### + +​ + ”Routines are disabled by your organization’s policy” Your Team or Enterprise admin has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). This is a server-side organization setting, so it cannot be overridden from your local configuration. Contact your admin to request that routines be enabled for your organization.
modified
--- a/routines.md +++ b/routines.md @@ -380,7 +380,7 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai. One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with usage credits turned on can keep running routines on metered overage. Without usage credits, additional runs are rejected until the window resets. Turn on usage credits from **Settings > Billing** on claude.ai. One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. ##
modified
--- a/routines.md +++ b/routines.md @@ -332,7 +332,7 @@ Connectors -Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI. +Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. Connectors are the [claude.ai integrations](</docs/en/mcp#use-mcp-servers-from-claude-ai>) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](<https://claude.ai/customize/connectors>), or declare it in a committed [`.mcp.json`](</docs/en/mcp#project-scope>) so it is part of the cloned repository. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI. ###
modified
--- a/routines.md +++ b/routines.md @@ -12,7 +12,7 @@ * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token * **GitHub** : run automatically in response to repository events such as pull requests or releases -A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. +A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. Team and Enterprise admins can disable routines for all members with the Routines toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). When disabled, existing routines stop running and members cannot create new ones. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. ## @@ -386,6 +386,20 @@ ​ +Troubleshooting + +### + +​ + +”Routines are disabled by your organization’s policy” + +Your Team or Enterprise admin has likely turned off the **Routines** toggle at [claude.ai/admin-settings/claude-code](<https://claude.ai/admin-settings/claude-code>). This is a server-side organization setting, so it cannot be overridden from your local configuration. Contact your admin to request that routines be enabled for your organization. + +## + +​ + Related resources * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session
modified
--- a/routines.md +++ b/routines.md @@ -64,7 +64,7 @@ * **Environment variables** : provide API keys, tokens, or other secrets Claude can use * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/claude-code-on-the-web#environment-caching>), so the script doesn’t re-run on every session -A **Default** environment is provided. To use a custom environment, [create one](</docs/en/claude-code-on-the-web#the-cloud-environment>) before creating the routine. +A **Default** environment is provided with **Trusted** network access, which allows the [default set](</docs/en/claude-code-on-the-web#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains, but blocks everything else. If your routine needs to reach your own services or a domain outside that list, edit the environment’s [network access](</docs/en/claude-code-on-the-web#network-access>) before running. To use a separate environment, [create one](</docs/en/claude-code-on-the-web#configure-your-environment>) first. 5 @@ -152,7 +152,7 @@ Add an API trigger -Scroll to the **Select a trigger** section below the prompt, click **Add another trigger** , and choose **API**. +Scroll to the **Select a trigger** section below the **Instructions** box, click **Add another trigger** , and choose **API**. 3 @@ -303,6 +303,8 @@ Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. +A green status in the run list means the session started and exited without an infrastructure error. It does not mean the task in your prompt succeeded. Open the run to read the transcript and confirm what Claude actually did. Blocked network requests, missing connector tools, and task-level failures all surface there rather than in the status indicator. + ### ​ @@ -336,9 +338,41 @@ ​ -Environments - -Each routine runs in a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) that controls network access, environment variables, and setup scripts. Configure environments before creating a routine to give Claude access to APIs, install dependencies, or restrict network scope. See [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for the full setup guide. +Environments and network access + +Each routine runs in a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) that controls network access, environment variables, and setup scripts. The routine inherits the environment’s network policy on every run. The **Default** environment uses **Trusted** network access: the [default allowlist](</docs/en/claude-code-on-the-web#default-allowed-domains>) of package registries, cloud provider APIs, container registries, and common development domains is reachable, but arbitrary domains are not. Outbound requests to other hosts fail with `403` and `x-deny-reason: host_not_allowed`. MCP connector traffic is routed through Anthropic’s servers, so the connectors you add to the routine work without adding their hosts to **Allowed domains**. Remove any connectors you don’t need under Connectors. To allow additional domains: + +1 + +Open the routine for editing + +On the routine’s detail page, click the pencil icon to open **Edit routine**. + +2 + +Open the environment selector + +Below the **Instructions** box, select the cloud icon showing your environment’s name, such as **Default**. + +3 + +Open the environment settings + +Hover over the environment in the list and click the settings icon that appears on the right. + +4 + +Change the network access level + +In the **Update cloud environment** dialog, change **Network access** to **Custom** and enter your domains in **Allowed domains**. Check **Also include default list of common package managers** to keep the [default allowlist](</docs/en/claude-code-on-the-web#default-allowed-domains>) alongside your custom domains. Select **Full** instead for unrestricted access. + +5 + +Save + +Click **Save changes**. The new policy applies from the next run. + +See [Network access](</docs/en/claude-code-on-the-web#network-access>) for details on access levels and the default allowlist. ##
modified
--- a/routines.md +++ b/routines.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + Routines are in research preview. Behavior, limits, and the API surface may change. A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it:
modified
--- a/routines.md +++ b/routines.md @@ -22,7 +22,7 @@ Create a routine -Create a routine from the web, the Desktop app, or the CLI. All three surfaces write to the same cloud account, so a routine you create in the CLI shows up at claude.ai/code/routines immediately. In the Desktop app, click **New task** and choose **New remote task** ; choosing **New local task** instead creates a [local Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine and is not a routine. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. +Create a routine from the web at [claude.ai/code/routines](<https://claude.ai/code/routines>), from the Desktop app, or from the CLI. All three surfaces write to the same cloud account, so a routine you create in one shows up in the others immediately. In the Desktop app, click **Routines** in the sidebar, then **New routine** , and choose **Remote** ; choosing **Local** instead creates a [Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine rather than in the cloud. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. ### @@ -46,7 +46,7 @@ Select repositories -Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run, starting from the default branch. Claude creates `claude/`-prefixed branches for its changes. To allow pushes to any branch, enable **Allow unrestricted branch pushes** for that repository. +Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run, starting from the default branch. Claude creates `claude/`-prefixed branches for its changes. 4 @@ -80,9 +80,9 @@ 6 -Review connectors - -All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any that the routine doesn’t need. Connectors give Claude access to external services like Slack, Linear, or Google Drive during each run. +Review connectors and permissions + +The **Connectors** and **Permissions** tabs at the bottom of the form control what the routine can reach.Under Connectors, all of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any the routine doesn’t need. Claude can use every tool from an included connector, including writes, without asking for permission during a run.Under Permissions, enable **Allow unrestricted branch pushes** for any repository where Claude should be able to push to existing branches instead of only `claude/`-prefixed ones. 7 @@ -97,14 +97,6 @@ Create from the CLI Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. - -### - -​ - -Create from the Desktop app - -Open the **Schedule** page in the Desktop app, click **New task** , and choose **New remote task**. The Desktop app shows both local scheduled tasks and routines in the same grid. See [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for details on the local option. ##
modified
--- a/routines.md +++ b/routines.md @@ -2,7 +2,7 @@ A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it: - * **Scheduled** : run on a recurring cadence like hourly, nightly, or weekly + * **Scheduled** : run on a recurring cadence like hourly, nightly, or weekly, or once at a specific future time * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token * **GitHub** : run automatically in response to repository events such as pull requests or releases @@ -72,7 +72,7 @@ * API -Pick a preset frequency: hourly, daily, weekdays, or weekly. See Add a schedule trigger for timezone handling, stagger, and custom cron intervals. +Pick a preset frequency for a recurring run, or schedule a single one-off run at a specific timestamp. See Add a schedule trigger for timezone handling, stagger, custom cron intervals, and one-off runs. Select the repository, the event to react to, and optional filters. See Add a GitHub trigger for the full list of supported events and filter fields. @@ -96,7 +96,7 @@ Create from the CLI -Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, as in `/schedule daily PR review at 9am`. Claude walks through the same information the web form collects, then saves the routine to your account. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, for a recurring routine like `/schedule daily PR review at 9am` or a one-off like `/schedule clean up feature flag in one week`. Claude walks through the same information the web form collects, then saves the routine to your account. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. ### @@ -120,7 +120,21 @@ Add a schedule trigger -A schedule trigger runs the routine on a recurring cadence. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. +A schedule trigger runs the routine on a recurring cadence, or once at a specific future time. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. + +#### + +​ + +Schedule a one-off run + +A one-off schedule fires the routine a single time at a specific timestamp. Use it to remind yourself later in the week, to open a cleanup PR after a rollout finishes, or to kick off a follow-up task when an upstream change lands. After the routine fires, it auto-disables and the web UI marks it as **Ran**. To run it again, edit the routine and set a new one-off time. Create a one-off run from the CLI by describing the time in natural language. Claude resolves the phrase against the current time and confirms the absolute timestamp before saving. + + /schedule tomorrow at 9am, summarize yesterday's merged PRs + + /schedule in 2 weeks, open a cleanup PR that removes the feature flag + +The same local-to-UTC conversion as recurring schedules applies to one-off timestamps. One-off runs do not count against the daily routine run cap. They consume your plan’s regular subscription usage like any other session. See Usage and limits for details. ### @@ -334,7 +348,7 @@ Usage and limits -Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai. +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai. One-off runs do not count against the daily routine cap. They draw down your regular subscription usage like any other session, but they are exempt from the per-account daily routine run allowance. ##
modified
--- a/routines.md +++ b/routines.md @@ -260,12 +260,10 @@ Labels| Labels applied to the PR Is draft| Whether the PR is in draft state Is merged| Whether the PR has been merged -From fork| Whether the PR comes from a fork Each filter pairs a field with an operator: equals, contains, starts with, is one of, is not one of, or matches regex. The `matches regex` operator tests the entire field value, not a substring within it. To match any title containing `hotfix`, write `.*hotfix.*`. Without the surrounding `.*`, the filter matches only a title that is exactly `hotfix` with nothing before or after. For literal substring matching without regex syntax, use the `contains` operator instead. A few example filter combinations: * **Auth module review** : base branch `main`, head branch contains `auth-provider`. Sends any PR that touches authentication to a focused reviewer. - * **External contributor triage** : from fork is `true`. Routes every fork-based PR through an extra security and style review before a human looks at it. * **Ready-for-review only** : is draft is `false`. Skips drafts so the routine only runs when the PR is ready for review. * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch routine only when a maintainer tags the PR.
modified
--- a/routines.md +++ b/routines.md @@ -56,7 +56,7 @@ * **Network access** : set the level of internet access available during each run * **Environment variables** : provide API keys, tokens, or other secrets Claude can use - * **Setup script** : run install commands before each session starts, like installing dependencies or configuring tools + * **Setup script** : install dependencies and tools the routine needs. The result is [cached](</docs/en/claude-code-on-the-web#environment-caching>), so the script doesn’t re-run on every session A **Default** environment is provided. To use a custom environment, [create one](</docs/en/claude-code-on-the-web#the-cloud-environment>) before creating the routine.
added
Show diff (354 lines)
--- a/routines.md +++ b/routines.md @@ -0,0 +1,351 @@ +Routines are in research preview. Behavior, limits, and the API surface may change. + +A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of [connectors](</docs/en/mcp>), packaged once and run automatically. Routines execute on Anthropic-managed cloud infrastructure, so they keep working when your laptop is closed. Each routine can have one or more triggers attached to it: + + * **Scheduled** : run on a recurring cadence like hourly, nightly, or weekly + * **API** : trigger on demand by sending an HTTP POST to a per-routine endpoint with a bearer token + * **GitHub** : run automatically in response to repository events such as pull requests or releases + +A single routine can combine triggers. For example, a PR review routine can run nightly, trigger from a deploy script, and also react to every new PR. Routines are available on Pro, Max, Team, and Enterprise plans with [Claude Code on the web](</docs/en/claude-code-on-the-web>) enabled. Create and manage them at [claude.ai/code/routines](<https://claude.ai/code/routines>), or from the CLI with `/schedule`. This page covers creating a routine, configuring each trigger type, managing runs, and how usage limits apply. + +## + +​ + +Example use cases + +Each example pairs a trigger type with the kind of work routines are suited to: unattended, repeatable, and tied to a clear outcome. **Backlog maintenance.** A schedule trigger runs every weeknight against your issue tracker via a connector. The routine reads issues opened since the last run, applies labels, assigns owners based on the area of code referenced, and posts a summary to Slack so the team starts the day with a groomed queue. **Alert triage.** Your monitoring tool calls the routine’s API endpoint when an error threshold is crossed, passing the alert body as `text`. The routine pulls the stack trace, correlates it with recent commits in the repository, and opens a draft pull request with a proposed fix and a link back to the alert. On-call reviews the PR instead of starting from a blank terminal. **Bespoke code review.** A GitHub trigger runs on `pull_request.opened`. The routine applies your team’s own review checklist, leaves inline comments for security, performance, and style issues, and adds a summary comment so human reviewers can focus on design instead of mechanical checks. **Deploy verification.** Your CD pipeline calls the routine’s API endpoint after each production deploy. The routine runs smoke checks against the new build, scans error logs for regressions, and posts a go or no-go to the release channel before the deploy window closes. **Docs drift.** A schedule trigger runs weekly. The routine scans merged PRs since the last run, flags documentation that references changed APIs, and opens update PRs against the docs repository for an editor to review. **Library port.** A GitHub trigger runs on `pull_request.closed` filtered to merged PRs in one SDK repository. The routine ports the change to a parallel SDK in another language and opens a matching PR, keeping the two libraries in step without a human re-implementing each change. The sections below walk through creating a routine and configuring each of these trigger types. + +## + +​ + +Create a routine + +Create a routine from the web, the Desktop app, or the CLI. All three surfaces write to the same cloud account, so a routine you create in the CLI shows up at claude.ai/code/routines immediately. In the Desktop app, click **New task** and choose **New remote task** ; choosing **New local task** instead creates a [local Desktop scheduled task](</docs/en/desktop-scheduled-tasks>), which runs on your machine and is not a routine. The creation form sets up the routine’s prompt, repositories, environment, connectors, and triggers. Routines run autonomously as full Claude Code cloud sessions: there is no permission-mode picker and no approval prompts during a run. The session can run shell commands, use [skills](</docs/en/skills>) committed to the cloned repository, and call any connectors you include. What a routine can reach is determined by the repositories you select and their branch-push setting, the [environment’s](</docs/en/claude-code-on-the-web#the-cloud-environment>) network access and variables, and the connectors you include. Scope each of those to what the routine actually needs. Routines belong to your individual claude.ai account. They are not shared with teammates, and they count against your account’s daily run allowance. Anything a routine does through your connected GitHub identity or connectors appears as you: commits and pull requests carry your GitHub user, and Slack messages, Linear tickets, or other connector actions use your linked accounts for those services. + +### + +​ + +Create from the web + +1 + +Open the creation form + +Visit [claude.ai/code/routines](<https://claude.ai/code/routines>) and click **New routine**. + +2 + +Name the routine and write the prompt + +Give the routine a descriptive name and write the prompt Claude runs each time. The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like.The prompt input includes a model selector. Claude uses the selected model on every run. + +3 + +Select repositories + +Add one or more GitHub repositories for Claude to work in. Each repository is cloned at the start of a run, starting from the default branch. Claude creates `claude/`-prefixed branches for its changes. To allow pushes to any branch, enable **Allow unrestricted branch pushes** for that repository. + +4 + +Select an environment + +Pick a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for the routine. Environments control what the cloud session has access to: + + * **Network access** : set the level of internet access available during each run + * **Environment variables** : provide API keys, tokens, or other secrets Claude can use + * **Setup script** : run install commands before each session starts, like installing dependencies or configuring tools + +A **Default** environment is provided. To use a custom environment, [create one](</docs/en/claude-code-on-the-web#the-cloud-environment>) before creating the routine. + +5 + +Select a trigger + +Under **Select a trigger** , choose how the routine starts. You can pick one trigger type or combine several. + + * Schedule + + * GitHub event + + * API + +Pick a preset frequency: hourly, daily, weekdays, or weekly. See Add a schedule trigger for timezone handling, stagger, and custom cron intervals. + +Select the repository, the event to react to, and optional filters. See Add a GitHub trigger for the full list of supported events and filter fields. + +Select **API** here, then save the routine. The URL and token are generated after the routine is saved, since they depend on the routine ID. See Add an API trigger to copy the URL and generate a token. + +6 + +Review connectors + +All of your connected [MCP connectors](</docs/en/mcp>) are included by default. Remove any that the routine doesn’t need. Connectors give Claude access to external services like Slack, Linear, or Google Drive during each run. + +7 + +Create the routine + +Click **Create**. The routine appears in the list and runs the next time one of its triggers matches. To start a run immediately, click **Run now** on the routine’s detail page.Each run creates a new session alongside your other sessions, where you can see what Claude did, review changes, and create a pull request. + +### + +​ + +Create from the CLI + +Run `/schedule` in any session to create a scheduled routine conversationally. You can also pass a description directly, as in `/schedule daily PR review at 9am`. Claude walks through the same information the web form collects, then saves the routine to your account. `/schedule` in the CLI creates scheduled routines only. To add an API or GitHub trigger, edit the routine on the web at [claude.ai/code/routines](<https://claude.ai/code/routines>). The CLI also supports managing existing routines. Run `/schedule list` to see all routines, `/schedule update` to change one, or `/schedule run` to trigger it immediately. + +### + +​ + +Create from the Desktop app + +Open the **Schedule** page in the Desktop app, click **New task** , and choose **New remote task**. The Desktop app shows both local scheduled tasks and routines in the same grid. See [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>) for details on the local option. + +## + +​ + +Configure triggers + +A routine starts when one of its triggers matches. You can attach any combination of schedule, API, and GitHub triggers to the same routine, and add or remove them at any time from the **Select a trigger** section of the routine’s edit form. + +### + +​ + +Add a schedule trigger + +A schedule trigger runs the routine on a recurring cadence. Pick a preset frequency in the **Select a trigger** section: hourly, daily, weekdays, or weekly. Times are entered in your local zone and converted automatically, so the routine runs at that wall-clock time regardless of where the cloud infrastructure is located. Runs may start a few minutes after the scheduled time due to stagger. The offset is consistent for each routine. For a custom interval such as every two hours or the first of each month, pick the closest preset in the form, then run `/schedule update` in the CLI to set a specific cron expression. The minimum interval is one hour; expressions that run more frequently are rejected. + +### + +​ + +Add an API trigger + +An API trigger gives a routine a dedicated HTTP endpoint. POSTing to the endpoint with the routine’s bearer token starts a new session and returns a session URL. Use this to wire Claude Code into alerting systems, deploy pipelines, internal tools, or anywhere you can make an authenticated HTTP request. API triggers are added to an existing routine from the web. The CLI cannot currently create or revoke tokens. + +1 + +Open the routine for editing + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine you want to trigger via API, then click the pencil icon to open **Edit routine**. + +2 + +Add an API trigger + +Scroll to the **Select a trigger** section below the prompt, click **Add another trigger** , and choose **API**. + +3 + +Copy the URL and generate a token + +The modal shows the URL for this routine along with a sample curl command. Copy the URL, then click **Generate token** and copy the token immediately. The token is shown once and cannot be retrieved later, so store it somewhere secure such as your alerting tool’s secret store. + +4 + +Call the endpoint + +Send the token in the `Authorization: Bearer` header when you POST to the URL. The Trigger a routine section below shows a complete example. + +Each routine has its own token, scoped to triggering that routine only. To rotate or revoke it, return to the same modal and click **Regenerate** or **Revoke**. + +#### + +​ + +Trigger a routine + +Send a POST request to the `/fire` endpoint with the bearer token in the `Authorization` header. The request body accepts an optional `text` field for run-specific context such as an alert body or a failing log, passed to the routine alongside its saved prompt. The value is freeform text and is not parsed: if you send JSON or another structured payload, the routine receives it as a literal string. The example below triggers a routine from a shell: + + curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \ + -H "Authorization: Bearer sk-ant-oat01-xxxxx" \ + -H "anthropic-beta: experimental-cc-routine-2026-04-01" \ + -H "anthropic-version: 2023-06-01" \ + -H "Content-Type: application/json" \ + -d '{"text": "Sentry alert SEN-4521 fired in prod. Stack trace attached."}' + +A successful request returns a JSON body with the new session ID and URL: + + { + "type": "routine_fire", + "claude_code_session_id": "session_01HJKLMNOPQRSTUVWXYZ", + "claude_code_session_url": "https://claude.ai/code/session_01HJKLMNOPQRSTUVWXYZ" + } + +Open the session URL in a browser to watch the run in real time, review changes, or continue the conversation manually. + +The `/fire` endpoint ships under the `experimental-cc-routine-2026-04-01` beta header. Request and response shapes, rate limits, and token semantics may change while the feature is in research preview. Breaking changes ship behind new dated beta header versions, and the two most recent previous header versions continue to work so that callers have time to migrate. + +#### + +​ + +API reference + +For the full API reference, including all error responses, validation rules, and field limits, see [Trigger a routine via API](<https://platform.claude.com/docs/en/api/claude-code/routines-fire>) in the Claude Platform documentation. The `/fire` endpoint is available to claude.ai users only and is not part of the Claude Platform API surface. + +### + +​ + +Add a GitHub trigger + +A GitHub trigger starts a new session automatically when a matching event occurs on a connected repository. Each matching event starts its own session. + +During the research preview, GitHub webhook events are subject to per-routine and per-account hourly caps. Events beyond the limit are dropped until the window resets. See your current limits at [claude.ai/code/routines](<https://claude.ai/code/routines>). + +GitHub triggers are configured from the web UI only. + +1 + +Open the routine for editing + +Go to [claude.ai/code/routines](<https://claude.ai/code/routines>), click the routine, then click the pencil icon to open **Edit routine**. + +2 + +Add a GitHub event trigger + +Scroll to the **Select a trigger** section, click **Add another trigger** , and choose **GitHub event**. + +3 + +Install the Claude GitHub App + +The Claude GitHub App must be installed on the repository you want to subscribe to. The trigger setup prompts you to install it if it isn’t already. + +Running `/web-setup` in the CLI grants repository access for cloning, but it does not install the Claude GitHub App and does not enable webhook delivery. GitHub triggers require installing the Claude GitHub App, which the trigger setup prompts you to do. + +4 + +Configure the trigger + +Select the repository, choose an event from the supported events list, and optionally add filters. Save the trigger. + +#### + +​ + +Supported events + +GitHub triggers can subscribe to either of the following event categories. Within each category you can pick a specific action, such as `pull_request.opened`, or react to all actions in the category. + +Event| Triggers when +---|--- +Pull request| A PR is opened, closed, assigned, labeled, synchronized, or otherwise updated +Release| A release is created, published, edited, or deleted + +#### + +​ + +Filter pull requests + +Use filters to narrow which pull requests start a new session. All filter conditions must match for the routine to trigger. The available filter fields are: + +Filter| Matches +---|--- +Author| PR author’s GitHub username +Title| PR title text +Body| PR description text +Base branch| Branch the PR targets +Head branch| Branch the PR comes from +Labels| Labels applied to the PR +Is draft| Whether the PR is in draft state +Is merged| Whether the PR has been merged +From fork| Whether the PR comes from a fork + +Each filter pairs a field with an operator: equals, contains, starts with, is one of, is not one of, or matches regex. The `matches regex` operator tests the entire field value, not a substring within it. To match any title containing `hotfix`, write `.*hotfix.*`. Without the surrounding `.*`, the filter matches only a title that is exactly `hotfix` with nothing before or after. For literal substring matching without regex syntax, use the `contains` operator instead. A few example filter combinations: + + * **Auth module review** : base branch `main`, head branch contains `auth-provider`. Sends any PR that touches authentication to a focused reviewer. + * **External contributor triage** : from fork is `true`. Routes every fork-based PR through an extra security and style review before a human looks at it. + * **Ready-for-review only** : is draft is `false`. Skips drafts so the routine only runs when the PR is ready for review. + * **Label-gated backport** : labels include `needs-backport`. Triggers a port-to-another-branch routine only when a maintainer tags the PR. + +#### + +​ + +How sessions map to events + +Each matching GitHub event starts a new session. Session reuse across events is not available for GitHub-triggered routines, so two PR updates produce two independent sessions. + +## + +​ + +Manage routines + +Click a routine in the list to open its detail page. The detail page shows the routine’s repositories, connectors, prompt, schedule, API tokens, GitHub triggers, and a list of past runs. + +### + +​ + +View and interact with runs + +Click any run to open it as a full session. From there you can see what Claude did, review changes, create a pull request, or continue the conversation. Each run session works like any other session: use the dropdown menu next to the session title to rename, archive, or delete it. + +### + +​ + +Edit and control routines + +From the routine detail page you can: + + * Click **Run now** to start a run immediately without waiting for the next scheduled time. + * Use the toggle in the **Repeats** section to pause or resume the schedule. Paused routines keep their configuration but don’t run until you re-enable them. + * Click the pencil icon to open **Edit routine** and change the name, prompt, repositories, environment, connectors, or any of the routine’s triggers. The **Select a trigger** section is where you add or remove schedules, API tokens, and GitHub event triggers. + * Click the delete icon to remove the routine. Past sessions created by the routine remain in your session list. + +### + +​ + +Repositories and branch permissions + +Routines need GitHub access to clone repositories. When you create a routine from the CLI with `/schedule`, Claude checks whether your account has GitHub connected and prompts you to run `/web-setup` if it doesn’t. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for the two ways to grant access. Each repository you add is cloned on every run. Claude starts from the repository’s default branch unless your prompt specifies otherwise. By default, Claude can only push to branches prefixed with `claude/`. This prevents routines from accidentally modifying protected or long-lived branches. To remove this restriction for a specific repository, enable **Allow unrestricted branch pushes** for that repository when creating or editing the routine. + +### + +​ + +Connectors + +Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear. When you create a routine, all of your currently connected connectors are included by default. Remove any that aren’t needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form. To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI. + +### + +​ + +Environments + +Each routine runs in a [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) that controls network access, environment variables, and setup scripts. Configure environments before creating a routine to give Claude access to APIs, install dependencies, or restrict network scope. See [cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>) for the full setup guide. + +## + +​ + +Usage and limits + +Routines draw down subscription usage the same way interactive sessions do. In addition to the standard subscription limits, routines have a daily cap on how many runs can start per account. See your current consumption and remaining daily routine runs at [claude.ai/code/routines](<https://claude.ai/code/routines>) or [claude.ai/settings/usage](<https://claude.ai/settings/usage>). When a routine hits the daily cap or your subscription usage limit, organizations with extra usage enabled can keep running routines on metered overage. Without extra usage, additional runs are rejected until the window resets. Enable extra usage from **Settings > Billing** on claude.ai. + +## + +​ + +Related resources + + * [`/loop` and in-session scheduling](</docs/en/scheduled-tasks>): schedule local tasks within an open CLI session + * [Desktop scheduled tasks](</docs/en/desktop-scheduled-tasks>): local scheduled tasks that run on your machine with access to local files + * [Cloud environment](</docs/en/claude-code-on-the-web#the-cloud-environment>): configure the runtime environment for cloud sessions + * [MCP connectors](</docs/en/mcp>): connect external services like Slack, Linear, and Google Drive + * [GitHub Actions](</docs/en/github-actions>): run Claude in your CI pipeline on repository events