← 返回 FEED
CLAUDE2026-04-20

Anthropic Routines 详解:不是聊天机器人,是可部署的工作流

Anthropic 悄悄发布了一个彻底改变 AI 使用范式的东西:Routines。

不是聊天机器人,不是 copilot,是一个可部署的劳动力——你定义一次任务、prompt、仓库和触发条件,Claude 在 Anthropic 的云基础设施上自动运行。笔记本可以合上,Claude 继续工作。

三种触发机制

Schedule:按重复周期运行。每小时、每天、工作日、每周,或自定义 cron 表达式。本地时区设置,Claude 自动转换。适合:每日站会、每周文档审查、每日待办维护、早间摘要。

API:给 routine 一个专用的 HTTP 端点。用 bearer token POST,Claude 立即启动一个 run,可以在请求体里传额外 context。适合:接入监控告警系统、部署流水线、内部 dashboard。Claude 变成你系统里任何可以发 HTTP 请求的东西的响应者。

GitHub:在仓库事件发生时自动触发。PR 打开、commit 推送、issue 创建、workflow 完成。选事件,加过滤器精确控制触发条件。适合:代码审查、PR 分类、changelog 生成。

可操作的 Workflow 示例

触发:Schedule,每天工作日 7am

Read all issues opened in the last 24 hours.
Apply labels based on the area of code referenced.
Assign owners based on who owns that area.
Post a summary to #dev-standup in Slack with
the new issues, their labels, and assigned owners.
Keep it under 10 lines.

醒来打开 Slack,背包已经 groom 好了。没有人碰过。周一早上不再有 30 个未分类工单。

触发:GitHub,pull_request.opened

Review this pull request against our team checklist.
Check for: security issues, performance problems,
style violations, and missing tests.
Leave inline comments for specific issues.
Post a summary comment with a pass or flag verdict
so human reviewers can focus on design decisions,
not mechanical checks.

每个新 PR 在人类审查之前先过机器审查。机械问题已被捕获,团队审查时间用在架构和逻辑上,而不是找分号。

触发:API(监控工具调用)

An alert has fired in production.
The alert details are in the context below.
Pull the relevant stack trace.
Correlate with commits from the last 48 hours.
Open a draft pull request with a proposed fix.

告警触发 → Claude 自动查堆栈 → 对齐最近 commits → 起草 PR。完全自动的 on-call 流程。

触发条件的过滤器

可以精确控制:

  • 只在 PR targeting main 时触发
  • 只在 non-draft PR 时触发
  • 只在 fork 的 PR 时触发

完全自定义,不是一刀切。

为什么这重要

之前的 Agent 是"你说,它做"。Routines 是"你定义,它按计划执行"。笔记本合上,它继续跑。

这是 AI 从对话工具可部署劳动力的转变。不是你在跟它聊天,是你在管理一个 worker。