AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
Claude Blog·2026年6月2日 09:00·約18分で読める

Claude Code における全タスク対応のハッチ:動的ワークフローの実装

#Claude Code#Agentic Workflow#Dynamic Systems#Autonomous Agents
TL;DR

Claude Code がタスク固有の動的ハルネスを自動生成する「Dynamic Workflows」機能を導入し、複雑なタスクに対する自律的な実行能力と汎用性を大幅に向上させた。

AI深層分析2026年6月11日 23:05
4
重要/ 5段階
深度40%
4
関連度30%
5
実用性20%
4
革新性10%
4

キーポイント

1

動的ハルネスの自動生成機能

Claude Code がタスクの内容に応じて、その場で最適化された独自の「ハルネス」を動的に作成・実行できるようになった。

2

特定領域への対応強化

リサーチ、セキュリティ分析、エージェントチーム編成、コードレビューなど、従来の汎用ハルネスでは限界があった分野でも高パフォーマンスを発揮可能となった。

3

ワークフローの共有と再利用

ユーザーが作成したカスタムワークフローを他者と共有・再利用できる仕組みが提供され、組織内でのナレッジ蓄積と効率化を促進する。

影響分析・編集コメントを表示

影響分析

この機能は、AI エージェントが単なる命令実行から、状況に応じて戦略を自ら構築・適応する「自律型」へと進化することを示す重要な転換点です。開発者や企業にとって、複雑な業務プロセスを自動化するための新たなパラダイムを提供し、LLM の実社会への適用範囲を大きく広げる可能性があります。

編集コメント

静的なプロンプトエンジニアリングの限界を超え、AI が自らの実行環境を動的に構築する時代が到来しました。今後はワークフロー設計のノウハウが、単なるコーディングスキル以上に重要な資産となるでしょう。

先週、Claude Code で 動的ワークフロー をリリースしました。これにより、Claude は現在、その場でタスクに合わせた独自のカスタム ハネス を作成できるようになりました。

デフォルトの Claude Code ハネスはコーディング向けに設計されていますが、実際には多くのタスクがコーディングタスクと類似しているため、他の多くの種類のタスクにも有用です。ただし、リサーチ、セキュリティ分析、エージェントチーム、または コードレビュー のように、最高パフォーマンスを達成するために Claude Code 上にカスタムハネスを構築する必要のある特定のタスククラスも存在します。

ワークフローを使用すると、Claude がこれらの問題をよりネイティブに解決できるようにする、Claude Code を基盤とした動的なハネスを作成できます。また、これらのワークフローを他者と共有・再利用することも可能です。

この記事では、私が得た初期のワークフロー体験と教訓について取り上げますので、最大限に活用していただけるよう努めます。ベストプラクティスはまだ発展途上であることを念頭に置いてください:動的ワークフローは多くのトークンを消費する傾向があり、複雑で価値の高いタスクに最も適しています。

例示プロンプト

技術的な詳細に踏み込む前に、ワークフローの可能性について考えていただくために、いくつかの例示プロンプトを紹介しましょう:

「このテストは約 50 回の実行に 1 回の割合で失敗します。これを再現するためのワークフローを設定してください。競合する仮説を複数立て、証拠によって一つの仮説が生き残るまで決して止めないでください。」

「ワークフローを使用して、過去 50 セッションをすべて確認し、私が繰り返し行っている修正点を抽出して、頻繁に発生するものを CLAUDE.md ルールとして定式化してください」

「ワークフローを使用して、過去 6 ヶ月間の Slack の #incidents チャンネルを検索し、誰もチケットを提出していないような再発する根本原因を見つけてください。」

「私のビジネスプランを持ってきて、投資家、顧客、競合他社のそれぞれの視点から異なるエージェントがそれを徹底的に分析・批判するワークフローを実行してください。」

「ここに 80 枚の履歴書が入ったフォルダがあります。バックエンド職種の採用に向けてワークフローでランク付けを行い、上位 10 件をダブルチェックしてください。AskUserQuestion ツールを使用して、評価基準に基づいて私に面接を行ってください。」

「この CLI ツールの名前が必要です。ワークフローを使って多数の候補名をブレインストーミングし、トーナメント方式で上位 3 つを選出してください。」

「ワークフローを使用して、私たちの User モデルという名称を、あらゆる場所で Account にリネームしてください。」

「私のブログ記事の下書きを確認し、ワークフローを利用してコードベースと照合してすべての技術的主張を検証してください。間違ったものを公開したくありません。」

ダイナミックワークフローの仕組み

ダイナミックワークフローは、サブエージェント subagents の生成と調整を支援するいくつかの特殊関数を含む JavaScript ファイルを実行します:

image
image

動的ワークフローには、データを処理するために役立つ JSON、Math、Array などの標準的な JavaScript 関数も含まれています。

エージェントがどのモデルを使用するかや、サブエージェントを独自の worktree で実行するかどうかを動的ワークフローが決定できることは特に有用です。これにより、Claude は必要な知能レベルと分離性を自ら選択することが可能になります。

例えば、ユーザーの操作やターミナルの終了によってワークフローが中断された場合でも、セッションを再開することで、ワークフローは中断された場所から継続して実行されます。

動的ワークフローが必要な理由

デフォルトの Claude Code ハーネスにタスクの実行を依頼すると、そのコンテキストウィンドウ内で計画と実行の両方を行う必要があります。多くのコーディングタスクにおいてはこれが非常に効果的ですが、長時間実行されるものや、大規模な並列処理が行われるもの、高度に構造化されているもの、あるいは敵対的な性質を持つタスクでは機能しなくなることがあります。

その理由は、Claude が単一のコンテキストウィンドウ内で複雑なタスクに取り組む時間が長くなるほど、特定のいくつかの失敗モードに対して脆弱になるからです。

  • エージェントの怠惰とは、Claude が特に複雑で多段階のタスクを完了する前に停止し、部分的な進捗(例えばセキュリティレビューの 50 項目のうち 35 項目への対応など)だけで作業完了と宣言してしまう現象を指します。
  • 自己優遇バイアスとは、Claude がルブリックに対して自身の結果や発見を検証・評価するよう求められた際、それらを優先しようとする傾向を指します。
  • ゴールドリフトとは、多くのターンにわたって、特にコンパクション(圧縮)の後などに、元の目的に対する忠実度が徐々に失われる現象を指します。各要約ステップは情報損失を伴うため、エッジケースの要件や「X を行わない」といった制約などの詳細情報が失われてしまう可能性があります。

これらの課題に対抗するためには、それぞれ独自のコンテキストウィンドウと焦点を絞った孤立した目標を持つ、複数の Claude サブエージェントをオーケストレーションするワークフローを作成することが有効です。

動的ワークフローと静的ワークフロー

以前、Claude Agent SDK や claude -p を使用して、複数の Claude Code インスタンスを協調させるための静的なワークフローを作成したことがあるかもしれません。

しかし、静的なワークフローはあらゆるエッジケースに対応する必要があるため、通常はより汎用的なものになりがちです。Claude Opus 4.8 と動的ワークフローを活用することで、Claude は現在、ユースケースに特化したカスタムハネス(枠組み)を自ら作成できる十分な知能を獲得しました。

image
image

ダイナミック・ワークフローを使用する際の便利なパターン

Claude に作成を依頼するか、トリガーワード「ultracode」を使用して Claude Code がワークフローを作成するように指示することで、すぐにダイナミック・ワークフローの使用を開始できます。

しかし、ダイナミック・ワークフローがどのように機能するかというメンタルモデル(心的モデル)を構築しておくことは、いつそれを使用すべきか、またプロンプトを通じて Claude にどのような働きかけができるかを理解する上で役立ちます。

Claude はワークフローを構築する際に、いくつかの一般的なパターンを組み合わせて使用することがあります:

image
image

分類して実行(Classify-and-act)

タスクの種類を決定するために分類器エージェントを使用し、タスクに応じて異なるエージェントや行動へルーティングします。あるいは、出力を決定するために末尾に分類器を使用することもできます。

分散して統合(Fan-out-and-synthesize)

タスクを多数の小さなステップに分割し、各ステップでエージェントを実行した後に、それらの結果を統合します。これは、小さなステップが非常に多い場合や、各ステップが独自のクリーンなコンテキストウィンドウ(文脈窓)の恩恵を受けて干渉したり相互汚染されたりしないようにする場合に特に有用です。統合ステップはバリアーとして機能し、すべての分散エージェントの実行を待ってから、それらの構造化された出力を一つの結果にマージします。

敵対的検証(Adversarial verification)

生成された各エージェントに対して、別の生成されたエージェントを実行して、その出力がルブリックや基準に対して敵対的に検証されるようにします。

Generate-and-filter

トピックについて複数のアイデアを生成し、その後評価基準や検証によってフィルタリングして重複を除き、最高品質でテスト済みのアイデアのみを返します。

Tournament

作業を分割するのではなく、エージェント同士に競争させます。N 個のエージェントを起動し、それぞれが異なるアプローチを使って同じタスクに挑戦させます。その後、判定用エージェントを用いてペアごとの比較方式でプロンプトやモデルが結果を評価し、勝者が決まるまで続けます。

Loop until done

作業量が未知のタスクの場合、固定された回数ではなく、停止条件(新たな発見がない場合、またはログにエラーが残っていない場合)を満たすまでエージェントを起動し続けるループを実行します。

Use cases

Claude Code に動的ワークフローを要求するタイミングと方法を創造的に考えてください。私は、ワークフローが非技術的な作業においても、むしろさらに有用であることに気づきました。

Migrations and refactors

Bun は、ワークフローを用いて Zig から Rust へ書き換えられました。そのプロセスの詳細については、Jarred の X スレッドをお読みください。

鍵となるのは、呼び出し元サイト、失敗するテスト、モジュールなど、操作が必要な一連のステップにタスクを分解することです。各修正に対してワークツリー内でサブエージェントを起動して修正を行い、別のエージェントが敵対的にレビューし、マージさせます。リソース集約型のコマンドの使用を避けるようエージェントに指示することで、マシン上のリソース不足を防ぎつつ最大限の並列化を実現できることを考慮してください。

Deep research

Claude Code 内に、動的ワークフローを活用した「深層調査」スキル(/deep-research)を公開しました。具体的には、ウェブ検索を広範囲に実行し、ソースを取得し、それらの主張に対して敵対的な検証を行い、引用付きのレポートを合成します。

しかし、このような調査はウェブ検索のためだけに行うものではありません。例えば、Slack のコンテキストからステータスレポートをまとめさせたり、コードベースを深く探索することで機能の仕組みを調査したりする際にも活用できます。

Deep verification

image
image

一方、レポート内のすべての事実上の主張について確認と出典の特定を行いたい場合、一つのエージェントがすべての事実上の主張を特定し、その後サブエージェントを生成してそれぞれを詳細に検証するワークフローを生成することを検討してください。また、検証用エージェントがソース取得用のサブエージェントをチェックし、そのソースが高品質であることを保証させることも可能です。

Sorting

image
image

Claude Code が評価に優れていると考える定性的な測定基準に基づいて、ソートしたいアイテムのリストがあるかもしれません。例えば、バグの深刻度でソートされたサポートチケットなどです。しかし、1 つのプロンプトで 1000 行以上のデータをソートしようとすると、品質が低下し、コンテキストに収まらなくなります。代わりに、トーナメント方式を実行するか、ペア比較を行うエージェントのパイプライン(絶対的なスコアリングよりも比較判断の方が信頼性が高い)を並列実行してバケットランク付けを行い、その後マージします。各比較は独立したエージェントとして機能するため、決定論的なループがブレイクダウン(対戦表)を管理し、コンテキスト内に残るのは進行中の順序のみとなります。

メモリとルール遵守

image
image

Claude が見落としがち、あるいは CLAUDE.mds に記載しても苦労する特定のルールセットがある場合、検証エージェントがチェックしなければならないルールのリストを含むワークフローを作成してください。ルールは 1 つにつき 1 つの検証エージェントを担当させます。ルールが整合しているかを確認するために懐疑的なペルソナを持つサブエージェントを作成することで、偽陽性(false positives)を減らすのに役立ちます。

逆方向も同様です。最近のセッションやコードレビューコメントから修正内容を抽出し、並列エージェントでクラスタリングします。その後、敵対的検証(このルールがあれば実際のミスを防げたか?)を行い、生き残ったルールを CLAUDE.md に再統合します。

根本原因調査

デバッグは、複数の独立した仮説を立ててそれらを検証する際に最も効果的ですが、コンテキストウィンドウが1つしかない場合、Claude は自己選好バイアスに陥る可能性があります。

この問題を構造的に防ぐために、ワークフローでは不連続な証拠から仮説を生成するためのエージェントを起動することができます。例えば、ログ用、ファイル用、データ用のそれぞれ独立したエージェントを用意します。その後、各仮説は検証者および反証者のパネルによって審査されます。

これはコードに限った話ではありません。ワークフローは、販売(なぜ3 月の売上が落ちたのか?)、データエンジニアリング(なぜこのパイプラインが失敗したのか?)、あるいは事後分析(ポストモーテム)のあらゆる場面で活用できます。

スケール対応のトリアージ

image
image

すべてのチームには、人間が完全に処理しきれないサポートキューやバグレポート、あるいはその他のバックログが存在します。

トリアージワークフローは各項目を分類し、既に追跡されている内容との重複を除き、適切なアクションを実行します。これには、修正を試みるか、または人間のユーザーにエスカレートすることが含まれます。

トリアージワークフローで有用なパターンとして「隔離(クォランティーン)」があります。これは、信頼できない公開コンテンツを読み取るエージェントに対して、高権限のアクションを実行することを禁止し、その代わりに情報を元に行動する担当のエージェントがそれらのアクションを行うという仕組みです。

Claude にこれを継続的に実行させるには、トリアージワークフローを /loop コマンドと組み合わせて使用してください。

探索と審美性

ワークフローは、解決策の異なるアプローチを探索する際に有用です。特にデザインや命名のように審美性が関与し、評価基準(ルブリック)から恩恵を受けるような場合です。

Claude にさまざまな解決策を探索させるよう依頼し、良い解決策がどのようなものかを示す評価基準(ルブリック)をレビューエージェントに与えてみてください。タスクは、レビューエージェントが基準を満たしたと感じた時点で完了となります。また、解決策は評価基準(ルブリック)に基づくトーナメントを通じて順序付けたり選択したりすることもできます。

評価(Evals)

特定のタスクに対して、ワークツリー内で別個のエージェントを起動し、さらに比較エージェントを起動して、特定の出力を評価基準(ルブリック)に基づいて比較・採点することで、軽量な評価(evals)を実行できます。例えば、作成したスキルを特定の基準に対して評価し、その後改善するといったケースです。

モデルおよびインテリジェンスのルーティング

タスクに最適化された分類エージェントを作成し、どのモデルを使用するかを決定させます。これは、タスクで多くのツール呼び出しが必要となる場合や、実行前に調査を行うことで最適なモデルを特定できる場合に役立ちます。

例えば、「認証モジュールがどのように動作するか説明する」というタスクにおいて最適なモデルは、認証モジュール内のファイル数やコードベースの構造に依存します。分類エージェントはこの調査を行い、タスクの予想される複雑度に基づいて Sonnet または Opus へルーティングすることができます。

動的ワークフローを使用すべきでない場合

ワークフローは新しい機能です。多くのユースケースで大きな成果を生み出す可能性がありますが、すべてのタスクに必要というわけではなく、場合によっては著しく多くのトークンを消費する結果になることもあります。

Claude Code を以前とは異なる方法で活用するために、ワークフローを創造的に使用するのが最善です。通常のコーディングタスクについては、自問してみてください:本当に追加の計算リソースが必要なのか?例えば、従来のコーディングタスクの多くは、5 人のレビューアーによるパネルを必要としません。

動的ワークフロー構築のためのヒント

プロンプト

動的ワークフローにおいては、上記で説明した特定のテクニックを用いた詳細なプロンプトが、最も良い結果をもたらします。

ワークフローは大規模タスク専用のものではありません。モデルに「クイックワークフロー」を使用するようプロンプトすることも可能です。例えば、仮定に対する迅速な対立レビューを作成することもできます。

/goal および /loop との組み合わせ

繰り返し可能なワークフロー(例:トリアージ、調査、検証)を使用する場合は、定期的に実行するために /loop と組み合わせて使用し、確実な完了要件を設定するために /goal を併用してください。

トークン使用量の予算管理

動的ワークフローに対して明示的なトークン使用量予算を設定することで、タスクが使用するトークンの数を制限できます。プロンプトで「10k トークンを使用する」といったように予算を指定し、上限を設定することができます。

動的ワークフローの保存と共有

ワークフローメニューで「s」キーを押すことで、ワークフローを保存できます。これらのワークフローは ~/.claude/workflows にチェックイン(格納)したり、スキルとして配布したりすることが可能です。

image
image

スキルを通じて共有するには、JavaScript のワークフローファイルをスキルのフォルダに配置し、SKILL.MD で参照してください。より柔軟性を確保するために、Claude に、スキル内のワークフローを実行するスクリプトとして厳密に実行されるものではなく、テンプレートとして扱うようプロンプトを与えることをお勧めします。

image
image

発見のための新たな出発点

ワークフローは、Claude Code を拡張するための有用な新しい方法です。これらを、Claude を活用してタスクを達成する新たな方法を探索するための出発点として捉えるようお勧めします。最適な使用方法については、まだ多くの発見の余地があります。見つけたことをぜひ教えてください。

‍

*この記事は、Anthropic の技術スタッフであり Claude Code に取り組んでいる Thariq Shihipar と Sid Bidasaria によって執筆されました。*

原文を表示

Last week, we released dynamic workflows in Claude Code. Claude can now write its own harness on the fly, custom-built for the task at hand.

While the default Claude Code harness is built for coding, it is also useful for many other types of tasks because, as it turns out, many tasks resemble coding tasks. But there are certain classes of tasks where we have had to build custom harnesses on top of Claude Code to achieve peak performance such as Research, security analysis, agent teams, or Code Review.

Workflows allow you to dynamically create harnesses built on top of Claude Code that enable Claude to solve all of those problems more natively. You can also share and reuse these workflows with others.

In this article, I’ll cover my initial workflows experiences and learnings so you can best take full advantage. Keep in mind, best practices are still developing: dynamic workflows often use more tokens and are best suited for complex, high value tasks.

Example prompts

Before diving into the technical details, I’d like to start with several example prompts to get you thinking about the possibilities with workflows:

"This test fails maybe 1 in 50 runs. Set up a workflow to reproduce it. Form competing theories about the race, and don't stop until one theory survives the evidence."

"Using a workflow, go through my last 50 sessions and mine them for corrections I keep making and turn the recurring ones into CLAUDE.md rules"

“Use a workflow to dig through #incidents in Slack for the past six months and find recurring root causes where nobody has filed a ticket."

"Take my business plan and run a workflow where different agents tear it apart from an investor's, a customer's, and a competitor's perspective."

"Here's a folder of 80 resumes, use a workflow to rank them for the backend role and double-check the top ten. Interview me using the AskUserQuestion tool for a rubric."

"I need a name for this CLI tool. Use a workflow to brainstorm a bunch of options and run a tournament to pick the top 3."

"Use a workflow to rename our User model to Account everywhere."

“Go through my blog post draft and verify every technical claim against the codebase using a workflow, I don't want to ship anything wrong."

How dynamic workflows work

Dynamic workflows execute a javascript file with a few special functions that help spawn and coordinate subagents:

Dynamic workflows also include standard JavaScript functions like JSON, Math, and Array, to help process data.

It’s particularly useful to know that dynamic workflows can decide which models an agent uses and whether subagents are run in their own worktree, allowing Claude to choose the intelligence level and isolation needed.

If a workflow is interrupted, for example by user action or quitting the terminal, resuming the session will allow the workflow to pick up where it left off.

Why dynamic workflows

When you ask the default Claude Code harness to do a task, it needs to both plan and execute in the same context window. For many coding tasks, this is highly effective, but it can break down over long-running, massively parallel, highly structured and/or adversarial tasks.

This is because the longer Claude works on a complex task in a single context window, the more it becomes susceptible to a few specific failure modes:

  • Agentic laziness refers to when Claude stops before finishing a particularly complex, multi-part task and declares the job done after partial progress, for example addressing 35 of the 50 items in a security review.
  • Self-preferential bias refers to Claude’s tendency to prefer its own results or findings, especially when asked to verify or judge them against a rubric.
  • Goal drift refers to the gradual loss of fidelity to the original objective across many turns, especially after compaction. Each summarization step is lossy, and details like edge-case requirements or "don't do X" constraints can get lost.

Creating a workflow helps combat these by orchestrating separate Claude subagents with their own context windows and focused, isolated goals.

Dynamic vs static workflows

You may have previously created a static workflow using the Claude Agent SDK or claude -p to coordinate multiple instances of Claude Code together.

But because static workflows need to work for all edge cases, they are usually more generic. With Claude Opus 4.8 and dynamic workflows, Claude is now intelligent enough to write a custom harness tailor-made for your use case.

Helpful patterns when using dynamic workflows

You can start using dynamic workflows just by asking Claude to make one, or by using the trigger word “ultracode” to ensure that Claude Code creates a workflow.

But building a mental model for how dynamic workflows work will help you understand when to use them and how you might nudge Claude via prompts.

There are a few common patterns that Claude might use and compose together when building workflows:

Classify-and-act

Use a classifier agent to decide on the type of task, and then route to different agents or behavior based on the task. Or, use a classifier at the end to determine output.

Fan-out-and-synthesize

Split up a task into many smaller steps, run an agent on each step and then synthesize those results. This is particularly useful for when there are a large number of smaller steps, or when each step benefits from its own clean context window so they don't interfere or cross-contaminate. The synthesize step is a barrier—it waits for all the fan-out agents, then merges their structured outputs into one result.

Adversarial verification

For each spawned agent, run a separate spawned agent to adversarially verify its output against a rubric or criteria.

Generate-and-filter

Generate a number of ideas on a topic and then filter them by a rubric or by verification, dedupe duplicates and return only the highest quality, tested ideas.

Tournament

Instead of dividing the work, have agents compete on it. Spawn N agents that each attempt the same task using different approaches. Prompts or models then judge the results in a pairwise fashion using a judging agent until you have a winner.

Loop until done

For tasks with an unknown amount of work, loop spawning agents until a stop condition is met (no new findings, or no more errors in the logs) instead of a fixed number of passes.

Use cases

Think creatively of when and how to ask Claude Code to make dynamic workflows. I’ve found that workflows are sometimes even more useful for non-technical work.

Migrations and refactors

Bun was rewritten from Zig to Rust using workflows. You can read more about how that was done in Jarred’s X thread.

The key is to break down the task into a series of steps that need to be operated on for example callsites, failing tests, modules, etc. Spin off a subagent for every fix in a worktree to make the fix, then have another agent adversarially review, and merge them. Consider telling the agent not to use resource intensive commands so that you can maximally parallelize without running out of resources on your machine.

Deep research

We published a deep research skill (/deep-research) inside Claude Code that uses dynamic workflows. Specifically, it fans-out web searches, fetches sources, adversarially verifies their claims, and synthesizes a cited report.

But you may do this sort of research for more than just web searches. For example, asking Claude to compile a status report from context in Slack or to research how a feature works by exploring a codebase in-depth.

Deep verification

On the other hand, if you have a report where you want to check and source every factual claim that it references you may want to generate a workflow which has one agent identify all of the factual claims and then spin off a subagent to check each one in-detail. You could also have a verification agent check the source subagent to make sure its source is high quality.

Sorting

You may have a list of items that you want to sort by some qualitative measurement that you believe that Claude Code is good at evaluating, for example: support tickets sorted by severity of the bug. But if you try to sort 1000+ rows in one prompt, quality degrades and it won't fit in context. Instead run a tournament, a pipeline of pairwise-comparison agents (comparative judgment is more reliable than absolute scoring), or bucket-rank in parallel then merge. Each comparison is its own agent, so the deterministic loop holds the bracket and only the running order stays in context.

Memory and rule adherence

If you have a particular set of rules that you find Claude misses or struggles with, even when put into the CLAUDE.mds, create a workflow with a list of rules that must be checked by verifier agents—one verifier per rule. Creating a skeptic persona subagent to review the rules to make sure they are in line will help avoid too many false positives.

The reverse direction works too: mine your recent sessions and code review comments for corrections you keep making, cluster them with parallel agents, adversarially verify each candidate (would this rule have prevented a real mistake?), and then distill the survivors back into a CLAUDE.md.

Root-cause investigation

Debugging works best when you come up with several independent hypotheses and test them, but if you’re only using one context window, Claude can run into self-preferential bias

A workflow can structurally prevent this by spinning up agents to generate hypotheses from disjoint evidence. For example, separate agents for logs, files, and data. Each hypothesis can then face a panel of verifiers and refuters.

This isn't just for code. Workflows can be used for sales (why did sales drop in March?), data engineering (why did this pipeline fail?), or any post-mortem exercise.

Triaging at scale

Every team has a support queue, bug reports, or some other backlog that cannot be fully processed by humans.

A triage workflow classifies each item, dedupes against what's already tracked, and takes action. This could mean attempting the fix or escalating to a human user.

A useful pattern for triage workflows is quarantine. This involves barring the agents that read untrusted public content from taking high-privilege actions, which are instead done by the agents in charge of acting on the information.

Pair triage workflows with /loop to have Claude do this continuously.

Exploration and taste

Workflows can be useful when exploring different approaches to a solution, especially when it is taste based, like design or naming, and would benefit from a rubric.

Try asking Claude to explore a bunch of solutions, and give a review agent a rubric for what a good solution looks like. The task is complete when the review agent feels like it has met the criteria. Solutions can also be ordered or selected via a tournament based on the rubric.

Evals

You can run lightweight evals for particular tasks by spinning off separate agents in a worktree and then spinning off comparison agents to compare and grade the specific outputs against a rubric. For example, evaluating and then refining a skill you’ve created against a particular criteria.

Model and intelligence routing

Create a classifier agent tuned to your tasks that decides which model to use. This can be helpful when your task will involve many tool calls and conducting research prior to execution can identify the best model for the job.

For example, the best model for the task “explain how the auth module works” depends on how many files in the auth module there are and the shape of the codebase. A classifier agent can do this research and then route to Sonnet or Opus based on the expected complexity of the task.

When not to use dynamic workflows

Workflows are new. While there are many use cases where it will create outsized results, they are not needed for every task and may end up using significantly more tokens.

It’s best to use workflows creatively to push Claude Code in ways that you haven’t previously. For regular coding tasks, try and ask yourself: does it really need more compute? For example, most traditional coding tasks do not need a panel of 5 reviewers.

Tips for building dynamic workflows

Prompting

Detailed prompting, using the specific techniques we described above, for dynamic workflows creates the best results.

Workflows are not just for large tasks. You can prompt the model to use a “quick workflow.” For example, you can create a quick adversarial review of an assumption.

Combine with /goal and /loop

When using workflows that can be repeated, for example triage, research, or verification, pair them with /loop to be run at regular intervals, and /goal to set a hard completion requirement.

Token usage budgets

You can set explicit token usage budgets for dynamic workflows to limit how many tokens a task uses. You can prompt it with a budget like: “use 10k tokens,” which will set the cap.

Saving and sharing dynamic workflows

You can save workflows by pressing “s” in the workflow menu. You can check these into ~/.claude/workflows or distribute them via a skill.

To share them via a skill, put your JavaScript workflow files in the skill and folder and reference them in the SKILL.MD. To allow for more flexibility, you may want to prompt Claude to think of the workflows in the skill as a template instead of a script that needs to be run verbatim.

A new starting point for discovery

Workflows are a helpful new way to extend Claude Code. I encourage you to think of them as a starting point to explore new ways to use Claude to help accomplish your tasks. There is still much to discover in how to use them best. Let me know what you find.

‍

*This article was written by Thariq Shihipar and Sid Bidasaria, members of technical staff at Anthropic working on Claude Code. *

この記事をシェア

関連記事

TechCrunch AI★42026年6月10日 05:37

Anthropic の Fable 5 はワンクリックで奇妙に面白いビデオゲームを生成可能

AI 企業 Anthropic が発表した「Fable 5」は、ユーザーがボタンを1回押すだけで、独自の世界観を持つ面白おかしいビデオゲームを自動生成する機能を備えている。

TLDR AI★42026年6月5日 09:00

コード参照ハッチの防御(GitHub リポジトリ)

Anthropic は、Claude を用いた自律的な脆弱性発見と修正のためのリファレンス実装を GitHub に公開し、一般ベストプラクティスに基づくカスタムパイプライン構築を可能にした。

AI News★42026年6月4日 20:41

マイクロソフトの「Scout」は M365 を横断するエージェント型オートパイロット

マイクロソフトは、ビルドイベントで新機能「Autopilot(オートパイロット)」のテスト範囲を拡大したと発表した。これはユーザーに代わって自律的に動作し、複数のエージェントが異なるルールセット内で共存できる新しいカテゴリのエージェントである。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む