一行要約

Claude Code にタスク専用の harness をその場で書かせる機能(dynamic workflows)であり、狙いは長時間の単一 context で必ず出る3つの失敗モード — agentic laziness / self-preferential bias / goal drift — を構造で潰すこと。

要点

何をするものか

dynamic workflow は、subagent を spawn して協調させる専用関数を持つ JavaScript を Claude 自身が書いて実行する仕組み。Claude Code の上に、そのタスク専用の harness を動的に構築する。

Workflows allow you to dynamically create harnesses built on top of Claude Code that enable Claude to solve all of those problems more natively. workflow を使えば、Claude Code の上に harness を動的に構築し、こうした問題を Claude がより自然に解けるようにできる。

Research、セキュリティ解析、agent teams、Code Review といった機能が解いていた問題を、より native に解けるようにする位置づけ。

動機 — 単一 context の3つの失敗モード

この3つの名前が、この記事の最も持ち帰る価値のある部分

失敗モード原典の定義
agentic laziness複雑な多要素タスクで、部分的な進捗の段階で終わったと宣言して止まってしまう
self-preferential bias特に rubric に照らして検証・判定を求められたとき、自分自身の結果や発見を好む傾向
goal drift多数のターンをまたぐうちに元の目的への忠実さが徐々に失われる。特に compaction の後

いずれも「1つの context で長く走らせる」ことに内在する問題であり、別 context の subagent に検証させる構造で緩和できる。

dynamic vs static

static workflowdynamic workflow
設計汎用的。あらゆる edge case を想定して作られるタスク固有。その場の問題に合わせて書かれる

静的なワークフローは汎用性のために冗長になる。動的なワークフローはその場のタスクにだけ最適化できる。

有用なパターン

原典が名前を付けて挙げているパターン。

パターン使いどころ
Classify-and-actまず分類し、種別ごとに処理を分ける
Fan-out-and-synthesize並列に広げて、最後に統合する
Adversarial verification別のエージェントに敵対的に検証させる(self-preferential bias 対策)
Generate-and-filter大量に生成してから絞る
Tournament候補同士を勝ち抜き戦で比較する
Loop until done条件を満たすまで回し続ける(agentic laziness 対策)

使いどころ

移行・リファクタ、深いリサーチ、深い検証、並べ替え、記憶とルール遵守、根本原因の調査、大規模なトリアージ、探索と好みの判断、evals、モデル/知能のルーティング

使わないほうがよいとき

Workflows are best suited for complex, high-value tasks and often use more tokens than default approaches. workflow は複雑で価値の高いタスクに最も向いており、既定のやり方よりトークンを多く使うことが多い。

通常のやり方よりトークンを多く使うので、複雑で価値の高いタスクに限る。

ただし大きなタスク専用というわけではない。

Workflows are not just for large tasks. You can prompt the model to use a quick workflow. workflow は大きなタスク専用ではない。手早い workflow を使うようモデルに促すこともできる。

実務上の tips

  • prompting: やってほしい構造を言葉で指定する(「対立する仮説を立てろ」「1つの仮説が証拠に耐えるまで止まるな」など)
  • /goal/loop と組み合わせる
  • トークン予算を指定できるuse 10k tokens のように書く
  • 保存と共有~/.claude/workflows に置く。保存済みワークフローのメニューは s キーで開く
  • 中断と再開ができる — 止めたところから続けられる
  • subagent は隔離された worktree で走らせられ、知能レベル(モデル)を選べる

そのまま使える具体例

原典が挙げているプロンプト例(そのまま打てる形):

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.

トークン予算を切る:

use 10k tokens

保存場所と呼び出し:

~/.claude/workflows     # 保存先
s                       # 保存済みワークフローのメニューを開くキー
ultracode               # ワークフローを起こすトリガー語

原典で言及されている関連文書

未取得の派生リンク