惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fox-IT International blog
Recent Announcements
Recent Announcements
D
Docker
IT之家
IT之家
B
Blog
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
量子位
C
Check Point Blog
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
博客园 - 司徒正美
李成银的技术随笔
美团技术团队
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
T
Tailwind CSS Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
小众软件
小众软件
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
M
Microsoft Research Blog - Microsoft Research
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
GbyAI
GbyAI
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog

Hacker News: Best

Taking a walk may lead to more creativity than sitting, study finds (2014) Microsoft Copilot Cowork Exfiltrates Files Jony Ive's Ferrari Norway's 2 petabytes of Huawei flash storage and LLM training The bootstrapper's EU stack for under €10 per month Exit IP VPN servers mitigation rollout Ubers COO says its getting harder to justify the money spent on AI tokenmaxxing Founder of 7&#x2F;11 Japan, Toshifumi Suzuki, has died at age 93 Using AI to write better code more slowly California moves to exempt Linux from its upcoming age-verification law after backlash over forcing operating systems to collect users’ ages — amendment proposed by the same lawmaker who wrote the original law The Cost of Safetyism Netherlands Seizes 800 Servers, Arrests 2 for Aiding Cyberattacks Pope Leo XIV says AI must serve humanity, not the powerful few Leave Me Behind Encyclical Letter of His Holiness Leo XIV Magnifica Humanitas (15 May 2026) The Eternal Sloptember CBP Directive 3340-049B: Border Search of Electronic Devices Australia Four-Day Work Week Study Data Shows Boosted Productivity Migrating from Go to Rust | corrode Rust Consulting Claude Is Not Your Architect. Stop Letting It Pretend. Building Pi With Pi AI Chip Component Costs: Memory at 63% | Epoch AI Computer and coding books from Usborne | Usborne | Be Curious Show HN: Audiomass – a free, open-source multitrack audio editor for the web abyss * your_dotfiles_are_not_a_distro The Front Page DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost Childhood Computing - Susam Pal A Fundamental Principle of Aeronautical Engineering Has Been Overturned Greg Brockman: Inside the 72 Hours That Almost Killed OpenAI ‘AI washing’: firms are scrambling to rebrand themselves as tech-focused Amazon Web Services - Four Years and Out AMD Customer Community wake up! 16b ICE Awards $25 Million Iris-Scanning Contract to Bi2 Technologies Toxic chemical leak at a manufacturing facility in Orange County seriot.ch It's time to talk about my writerdeck Texas woman arrested for Facebook post about town water quality Italy moves to Airbus A330 tankers in major NATO-aligned shift Oura says it gets government demands for user data. Will it share how many? On the <dl> The Art of Money Getting – Cool Tools The spell that wouldn't leave · mahl.me 80386 microcode disassembled « Reenigne blog Making Deep Learning go Brrrr From First Principles DeepSeek 将对其旗舰 AI 模型实施永久性 75% 折扣 US tech firms share Dutch regulator officials’ names with senate The FBI Wants ‘Near Real-Time’ Access to US License Plate Readers -​-dangerously-skip-reading-code BambuStudio has been violating PrusaSlicer AGPL license since their fork Spanish Court Declines to Fine NordVPN over LaLiga Piracy Blocking Order GitHub - amatsuda/rubish Is AI Profitable Yet? FBI director&#x27;s Based Apparel site has been spotted hosting a &#x27;ClickFix&#x27; attack SpaceX successfully launches prototype of Starship rocket SpaceX just launched Starship V3 &mdash; its most powerful megarocket yet &mdash; into space for the 1st time in… Client Challenge Shipping a Laptop to a Refugee Camp in Uganda Green Card Seekers Must Leave U.S. to Apply, Trump Administration Says Project Glasswing: An initial update KanBots — a kanban that runs parallel agents Yt-dlp – [Announcement] Bun support is now limited and deprecated Microsoft reports are exposing AI's real cost problem: Using the tech is more expensive than paying human employees | Fortune Lawmakers Demand Answers as CISA Tries to Contain Data Leak U.S. researchers face new restrictions on publishing with foreign collaborators You can no longer Google the word ‘disregard’ Why Japanese companies do so many different things Trump Mobile confirms it exposed customers’ personal data, including phone numbers and home addresses The elephant in the room • Josh W. Comeau If you're an LLM, please read this – Anna's Blog Post unavailable | Deno OpenSCAD LLM Benchmark: Building the Pantheon | ModelRift Blog Steve Wozniak cheered after telling students they have AI – actual intelligence Experience: we found a baby on the subway – now he’s our 26-year-old son Cleve Moler (Matlab, MathWorks) passed away on May 20, 2026 AI is killing the cheap smartphone Uv is fantastic, but its package management UX is a mess Using Kagi Search With Low Vision | Veronica With Four Eyes Six search engines worth trying now that Google isn’t really Google anymore This blog ran on Ubuntu 16.04 for 10 years. I migrated it to FreeBSD BBEdit 16 is here! | Bare Bones Software Amazon, Facebook, FBI have access to a private intelligence-sharing network More than 340 local news outlets are limiting the Internet Archive&#x27;s access Project Hail Mary – Stellar Navigation Chart Freenet Waymo pauses Atlanta service as its robotaxis keep driving into floods Indexing a year of video locally on a 5-year-old M1 Max with Gemma 4 31B Google's Antigravity Bait and Switch AI is just unauthorised plagiarism at a bigger scale Hating AI Is Good US employers spend more than $1.5bn a year to fight labor unions, report finds Show HN: I Dedicated 4 Years to Mastering Offline Password Cracking Samsung chip workers will get an average $340,000 bonus as AI profits soar Scammers are abusing an internal Microsoft account to send spam links Python 3.15: features that didn't make the headlines Flipper One — we need your help Lost Images From the 1945 Trinity Nuclear Test Restored no slop grenade Vivaldi 8.0: our biggest design overhaul, ever
Automate work with routines - Claude Code Docs
2026-04-15 · via Hacker News: Best

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.

A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of connectors, 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, 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

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 enabled. Create and manage them at 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. 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.

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 at 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, 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 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 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

2

3

4

5

6

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. 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.

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, 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.

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

2

3

4

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.

API reference

For the full API reference, including all error responses, validation rules, and field limits, see Trigger a routine via API 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.

GitHub triggers are configured from the web UI only.

1

2

3

4

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.

EventTriggers when
Pull requestA PR is opened, closed, assigned, labeled, synchronized, or otherwise updated
ReleaseA 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:

FilterMatches
AuthorPR author’s GitHub username
TitlePR title text
BodyPR description text
Base branchBranch the PR targets
Head branchBranch the PR comes from
LabelsLabels applied to the PR
Is draftWhether the PR is in draft state
Is mergedWhether the PR has been merged

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.

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 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. Connectors are the claude.ai integrations 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, or declare it in a committed .mcp.json 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.

Environments and network access

Each routine runs in a 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 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

2

3

4

5

See Network access for details on access levels and the default allowlist.

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 or 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.

Troubleshooting

/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. 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 instead
  • Your CLI is older than v2.1.81. Run claude update

You can always create and manage routines at 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. 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.