記事一覧へ
多くの人はClaudeを「話しかけるもの」だと思っている。しかし今やClaudeは「デプロイするもの」になった。
Anthropicは静かに、AIの考え方をまるごと変えるものを出荷した。それはRoutinesと呼ばれる。
そして何かを作ったり、チームを運営したり、何らかの繰り返し作業を管理しているなら、これはClaudeが今年出荷した中で最も重要なものだ。
https://code.claude.com/docs/en/routines#example-use-cases
どういうものかというと:
タスクを一度定義する。プロンプト、リポジトリ、トリガーを設定する。ClaudeはAnthropicのクラウドインフラ上でそれを自動実行する。
ラップトップが閉じていてもClaudeは動き続ける。チャットボットでも、コパイロットでもなく、デプロイされたワーカーだ。
## 3つのトリガー
すべてのRoutineはトリガーが必要だ。3種類があり、同じRoutineで組み合わせることができる。
### スケジュール
繰り返しの間隔で実行する。毎時、毎日、平日、毎週、またはカスタムcron式。
時刻はローカルタイムゾーンで設定でき、Claudeが自動的に変換する。
クロックに従って発生するものすべてに使う。デイリースタンドアップ。週次ドキュメントレビュー。夜間バックログメンテナンス。朝のダイジェスト。
### API
Routineに専用のHTTPエンドポイントを与える。bearer tokenでPOSTすれば即座にClaudeが実行を開始する。リクエストボディのテキストフィールドで追加コンテキストを渡せる。
HTTPリクエストを送れるものすべてにClaudeを組み込むために使う。アラートツール。デプロイパイプライン。社内ダッシュボード。システムが検知した何かにClaudeを反応させたいあらゆる場所に。
### GitHub
リポジトリで何かが起きたとき自動的に実行する。Pull requestがオープンされた。コミットがプッシュされた。Issueが作成された。ワークフローが完了した。イベントを選び、必要に応じてフィルタを追加して、必要なものだけにトリガーさせる。
コードレビュー、PRトリアージ、changelog生成、コードが動くたびに何かが起きるべき場合に使う。
## 今日セットアップできる5つのRoutine
ドキュメントからの実際のユースケース。各RoutineにはトリガータイプとPrompt構造、Claudeが実際に何をするかを記した。
### Routine 1: 朝のバックログダイジェスト
トリガー: スケジュール、平日の午前7時
Prompt構造:
```
過去24時間にオープンされたすべてのIssueを読む。
参照されているコードエリアに基づいてラベルを付ける。
そのエリアのオーナーに基づいて担当者を割り当てる。
新しいIssue、ラベル、割り当てられたオーナーを載せた
サマリーを#dev-standup Slackに投稿する。
10行以内に収める。
```
何が起きるか: 目が覚めてSlackを開くと、バックログはすでに整理されている。
誰も手を触れる必要がなかった。月曜の朝に週末からの30枚のラベルなしチケットが驚きとして待ち構えることもない。
### Routine 2: 自動PRレビュアー
トリガー: GitHub、pull_request.opened
Prompt構造:
```
チームのチェックリストに対してこのpull requestをレビューする。
チェック対象: セキュリティ問題、パフォーマンス問題、
スタイル違反、テスト不足。
特定の問題にインラインコメントを残す。
人間のレビュアーが設計の判断に集中できるよう、
pass/flagの評決を示すサマリーコメントを投稿する。
機械的な確認は私たちに任せて。
```
何が起きるか: 人間が見る前にすべての新しいPRがレビューされる。
機械的なことはすでに捕捉されている。チームはアーキテクチャとロジックにレビュー時間を使える。セミコロンの欠落などではなく。
フィルタも追加できる。mainをターゲットにするPRのみトリガー、ドラフトでないPRのみトリガー。
forkからのPRのみトリガー。何がRoutineを起動するかを正確に制御できる。
### Routine 3: アラートトリアージBot
トリガー: API(監視ツールから呼び出す)
Prompt構造:
```
プロダクションでアラートが発火した。
アラートの詳細は以下のコンテキストにある。
関連するスタックトレースを取得する。
過去48時間のコミットと相関させる。
提案された修正のドラフトpull requestをオープンする。
PRをアラートにリンクする。
PRリンクをSlackの#on-callに投稿する。
```
使い方:
監視ツールがRoutineのエンドポイントにbearer tokenをヘッダーに付け、アラートの詳細をボディに含めてPOSTリクエストを送る。
Claudeがそのテキストからコンテキストを取得し、すぐに作業を開始する。
何が起きるか: 監視ツールが午前3時にアラートを発火 → Claudeが起動し、関連するコミットを見つけ、提案された修正のドラフトPRをオープンし、Slackに投稿する。
オンコールエンジニアは午前3時に空のターミナルを見つめる代わりにPRをレビューする。
### Routine 4: ドキュメントドリフトチェッカー
トリガー: スケジュール、毎週月曜の午前9時
Prompt構造:
```
過去7日間にマージされたすべてのPRをスキャンする。
これらのPRで変更されたAPIや関数を参照しているドキュメントを探す。
各古いドキュメントに対して、docsリポジトリに
正しい情報を含む更新PRをオープンする。
ドリフトを引き起こしたコードPRへのリンクをコメントに追加する。
```
何が起きるか: ドキュメントが自動的に最新を保つ。
どのエンジニアリングチームでも最も嫌われるメンテナンスタスクが、毎週誰にも頼まれることなく自動実行される。
### Routine 5: デプロイ検証
トリガー: API(デプロイ後にCDパイプラインから呼び出す)
Prompt構造:
```
新しいビルドがプロダクションにデプロイされた。
新しいビルドに対してスモークチェックを実行する。
前回のデプロイと比較してエラーログのリグレッションをスキャンする。
デプロイウィンドウが閉じる前にgo/no-goの評決を
Slackの#releasesに投稿する。
no-goの場合、見つかった特定のエラーを含める。
```
何が起きるか: すべてのデプロイが自動的に検証される。チームは誰かが手動で確認する前にSlackでgo/no-goを受け取る。
誰もが何も壊れていないことを祈りながらデプロイウィンドウが閉じることはない。
## 最初のRoutineのセットアップ方法
10分で完了。Webからの正確なパス:
1. claude.ai/code/routinesにアクセスし、new routineをクリック
2. 名前を付け、promptを書く。promptが最重要部分だ。
Claudeは自律的に実行するため、具体的である必要がある。「PRをレビューして」ではなく「mainをターゲットとするPRをレビューし、エラーハンドリングの欠落とセキュリティ問題をチェックし、インラインコメントを残し、サマリーの評決を投稿する」のように。
3. GitHubリポジトリを選択する。Claudeはデフォルトブランチから始まるすべての実行開始時にそれをcloneする。
4. 環境を選ぶ。デフォルトのものがほとんどの場合に機能する。カスタム環境ではAPIキーの設定、依存関係のインストール、ネットワークアクセスの制御ができる。
5. トリガーを選択する: スケジュール、API、またはGitHubイベント。必要に応じてフィルタを追加する。
6. コネクターを確認する。接続されているすべてのMCPコネクターがデフォルトで含まれる。Routineが必要としないものは削除し、「作成」をクリック。
CLIから:
Claude Codeのセッションで `/schedule` を実行する。Claudeが会話形式ですべてをガイドし、Routineをアカウントに保存する。
```
/schedule daily PR review at 9am
```
それだけだ。Claudeが適切な質問をし、あなたが答えれば、Routineはライブになる。
CLIから既存のRoutineを管理するには:
```
/schedule list
/schedule update
/schedule run
```
## 制限について知っておくべきこと:
https://claude.ai/settings/usage
- Routinesはインタラクティブセッションと同様にサブスクリプションのクォータを使用する。
- アカウントごとのRoutine実行には1日の上限がある。/routinesまたはsettings/usageで使用状況を確認。
- 上限に達した場合: extra usageがあれば実行は従量制のオーバーに続く。なければ新しい実行はリセットまで拒否される。
- デフォルトでは、protected branchを回避するためClaude は claude/* ブランチへのpushのみ可能。どこへでもpushするには、Routine作成時に「Allow unrestricted branch pushes」を有効にする。
- Routineはユーザーごとで共有されない。すべてのアクション(コミット、PR、Slack、Linear)はあなたのGitHubアイデンティティとして表示される。
- リサーチプレビュー中、GitHubトリガーにはRoutineごと・アカウントごとの時間あたりの上限もある。超過イベントはリセットまでドロップされる。
AIの深い学習に興味のある方へ...
AIについてもっと学びたい方のために、ゼロから本物のものを作る方法を示すリンクを置いておく。
0:08
リンクをご覧ください: https://tally.so/r/2ExKYV
AIツールで稼ぐチャットボット、自動化、カスタムAIアシスタントを構築するのに技術的なバックグラウンドは不要だ。
AI Launchpadがゼロから本物のビジネス向けにこれらを構築する道を示す。
- Leo

agent-opsclaude-workflowharness-design
Claude Routinesで自律AIワーカーを実装する
♥ 81↻ 5
原文を表示 / Show original
Most people think Claude is something you talk to, tho it is now something you deploy.
Anthropic quietly shipped something that changes how you think about AI entirely, it is called Routines.
And if you build things, run a team, or manage any kind of recurring work, this is the most important thing Claude has shipped this year.
https://code.claude.com/docs/en/routines#example-use-cases
Here is what it does:
You define a task once, a prompt, a repo, a trigger, claude runs it automatically on Anthropic's cloud infrastructure.
Your laptop can be closed -> Claude is still working, not a chatbot, not a copilot a deployed worker.
The three triggers
Every routine needs a trigger, there are three types, you can combine them on the same routine.
> Schedule
Runs on a recurring cadence. Hourly, daily, weekdays, weekly, or a custom cron expression.
You set the time in your local timezone and Claude converts it automatically.
Use this for anything that needs to happen on a clock. Daily standups. Weekly doc reviews. Nightly backlog maintenance. Morning digests.
> API
Gives your routine a dedicated HTTP endpoint. You POST to it with a bearer token and Claude starts a run immediately. You can pass extra context in the request body using a text field.
Use this to wire Claude into anything that can make an HTTP request. Alerting tools. Deploy pipelines. Internal dashboards. Anywhere you want Claude to react to something your system detected.
> GitHub
Runs automatically when something happens in a repository. Pull request opened.
Commit pushed. Issue created. Workflow completed. You pick the event and optionally add filters so it only triggers on exactly what you care about.
Use this for code review, PR triage, changelog generation, or anything that should happen every time code moves.
Five routines you can set up today
These are real use cases from the docs, each one has the trigger type, the prompt structure, and what Claude actually does.
Routine 1: Morning backlog digest
Trigger: schedule, every weekday at 7am
Prompt structure:
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.
What happens: you wake up, open Slack, and your backlog is already groomed.
Nobody had to touch it. No Monday morning surprise of 30 unlabeled tickets from the weekend.
Routine 2: Auto PR reviewer
Trigger: GitHub, pull_request.opened
Prompt structure:
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.
What happens: every new PR gets reviewed before a human looks at it.
The mechanical stuff is already caught, your team spends review time on architecture and logic, not missing semicolons.
You can add filters too, only trigger on PRs targeting main, only trigger on non-draft PRs.
Only trigger on PRs from forks. You control exactly what fires the routine.
Routine 3: Alert Triage Bot
Trigger: API (called by your monitoring tool)
Prompt structure:
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.
Link the PR back to the alert.
Post the PR link to #on-call in Slack.
Call it like this:
Your monitoring tool sends a POST request to the routine's endpoint with your bearer token in the header and the alert details in the body.
Claude picks up the context from that text and starts working immediately.
What happens: your monitoring tool fires an alert at 3am -> Claude wakes up, finds the relevant commits, opens a draft PR with a proposed fix, and posts it to Slack.
Your on-call engineer reviews a PR instead of staring at a blank terminal at 3am.
Routine 4: Docs Drift Checker
Trigger: schedule, every Monday at 9am
Prompt structure:
Scan all PRs merged in the last 7 days.
Find documentation that references APIs or functions
that were changed in those PRs.
For each outdated doc, open an update PR in the
docs repository with the correct information.
Add a comment linking the code PR that caused the drift.
What happens: documentation stays current automatically.
The most hated maintenance task on any engineering team runs itself every week without anyone asking for it.
Routine 5: Deploy Verification
Trigger: API (called by your CD pipeline after deploy)
Prompt structure:
A new build was just deployed to production.
Run smoke checks against the new build.
Scan error logs for regressions compared to the
previous deploy.
Post a go or no-go verdict to #releases in Slack
before the deploy window closes.
If no-go, include the specific errors found.
What happens: every deploy gets verified automatically. Your team gets a go or no-go in Slack before anyone has to manually check anything.
The deploy window does not close with everyone hoping nothing broke.
How to Set Up Your First Routine
Ten minutes, here is the exact path, from the web:
Go to claude.ai/code/routines & click new routine
Give it a name, write the prompt, the prompt is the most important part.
Claude runs autonomously so it needs to be specific, not "review PRs" but "review PRs targeting main, check for missing error handling and security issues, leave inline comments, post a summary verdict."
Select your GitHub repository, claude clones it at the start of every run starting from the default branch.
Pick an environment. The default one works for most cases. Custom environments let you set API keys, install dependencies, or control network access.
Choose your trigger: Schedule, API, or GitHub event, add filters if needed.
Review your connectors. All your connected MCP connectors are included by default. Remove any the routine does not need, click create.
From the CLI:
Run /schedule in any Claude Code session, claude walks you through everything conversationally and saves the routine to your account.
/schedule daily PR review at 9am
That is it, claude asks the right questions, you answer, and the routine is live.
To manage existing routines from the CLI:
/schedule list
/schedule update
/schedule run
What You Need to Know About Limits:
https://claude.ai/settings/usage
> Routines use your subscription quota like interactive sessions.
> There’s a daily cap on routine runs per account, check usage at /routines or settings/usage.
> If you hit the cap: with extra usage, runs continue as metered overage, without it, new runs are rejected until reset.
> By default, Claude can only push to claude/* branches to avoid protected branches, to push anywhere, enable Allow unrestricted branch pushes when creating the routine.
> Routines are per-user, not shared. All actions via your GitHub identity (commits, PRs, Slack, Linear) show up as you.
> During the research preview, GitHub triggers also have per-routine and per-account hourly caps; extra events are dropped until reset.
Psst... For those who are interested in deep AI learning:
If you're interested in learning more about AI here's how you go from zero to building real things with it.
0:08
Leaving a link for y'all: https://tally.so/r/2ExKYV
You do not need a tech background to build AI tools that make money.
AI Launchpad takes you from zero to building chatbots, automations, and custom AI assistants for real businesses.
- Leo