AI と協働し、複利効果を高める方法
Eugene Yan は、AI と効果的に協働し成果を複利化するための具体的なワークフローとして、文脈の構造化、組織知識への接続、および新規セッションごとのオンボーディング戦略を提唱している。
キーポイント
文脈をインフラとして設計する
コードとナレッジを明確に分離したディレクトリ構造(例:~/src, ~/vault)を整備し、モデルが grep や glob で容易に文脈を検索・参照できるようにする。
組織のコンテキストへ接続する
Slack や Drive などの社内リソースを MCP(Model Context Protocol)経由で接続し、プロジェクトごとの INDEX.md に注釈付きリンクを配置してモデルの検索コストを削減する。
セッションを新規採用者として扱う
各新しい AI セッションを開始する際、CLAUDE.md を「新人向けオンボーディングドキュメント」として活用し、用語集やプロジェクトの優先順位を明示的に伝える。
嗜好と検証を構成ファイルに埋め込む
個人のコーディングスタイルや品質基準を設定ファイル(config)としてエンコードし、修正履歴が自動的に学習されるようにしてミスを減少させる。
セッションごとのオンボーディング
各プロジェクトの CLAUDE.md ファイルを新入社員へのオンボーディング資料として扱い、用語集や優先読み順などを記述することで、モデルに文脈を提供する。
記憶層の構築と分離
デフォルトではセッション間で記憶が維持されないため、プロジェクトの状態やドメイン知識を格納する~/vault と、設定やワークフローを管理する~/.claude に記憶層を分けてディスクに保存する。
行動契約としての設定
~/.claude/CLAUDE.md を振る舞いの契約として定義し、直接性を求める姿勢や失敗時の調査手順、学習支援の形式など、モデルの挙動を細かく制御する。
影響分析・編集コメントを表示
影響分析
この記事は、AI ツールを単なる検索エンジンとして扱うのではなく、組織の知識基盤と統合された「第二の労働力」として運用するための実践的フレームワークを提供しています。特に、文脈管理と設定ファイルによる嗜好の定式化は、大規模な開発チームや個人のプロダクティビティ向上において即座に適用可能な重要な示唆を含んでいます。
編集コメント
AI ツールの導入において技術的な設定よりも、人間の思考プロセスや組織の知識構造をどうモデルに読み込ませるかが成否を分けるという本質的な視点が示されています。
AI と効果的に協働するにはどうすればよいでしょうか?そのワークフローはどのようなものか、どのようにスケーリングし、時間をかけてシステムを改善していくのか。そして理想的には、それは複利効果を生むべきです。完成したすべての成果物—コード、ドキュメント、分析、意思決定—が次のセッションにおける文脈となります。また、各修正は設定を更新し、将来のミスを減らすことになります。私はまだ学習中ですが、同じ答えを何度も繰り返してきたため、次回質問された際にリンクを共有できるようにここに記しておきます。
AI を定期的に使用するなら、おそらくすでにこれらの実践の多くを適用しているでしょう。それでもなお、根本的な原則は広く適用可能だと信じています:適切な文脈を提供し、自分の嗜好を設定としてエンコードし、検証を容易にし、大きなタスクを委任し、ループを閉じるのです。もしある実践が合わない場合は、その原則を適応させて独自のものを発明してください。また、読んでいて気づくかもしれませんが、これらは AI に固有のものではありません。これは単に新しい共同作業者を迎え入れ、協働する方法です。
• • •
文脈をインフラとして
モデルがあなたの文脈をナビゲートできるように支援します。 例えば、私のすべてのコードは ~/src に、すべての知識作業は ~/vault(プロジェクト/, ノート/, kb/ などへ整理)に保存されています。私たちの仕事が整理されていれば、grep や glob を使用してモデルが文脈を取得しやすくなります。また、クリーンなディレクトリツリーを持つことで、ディレクトリをナビゲートしやすく、既存のコードやプロジェクトドキュメント、分析などを参照・活用して、現在行われている作業を改善することがより明確になります。
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等)は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
モデルを組織の文脈に接続する。 モデルは、Slack、Drive、メールなどに存在する可能性が高い組織知識から恩恵を受けることができます。Claude Code、Cowork、Claude.ai には、ほとんどが MCPs を備えています。これらに加えて、私はプロジェクトごとに INDEX.md を維持しています。これは関連するドキュメントやチャンネルの注釈付きインデックスであり、各エントリには URL、所有者、およびその内容と読むべき時期を説明する短いパラグラフが含まれています。この注釈は非常に役立ちます。URL の単なるリストでは、モデルがどのリンクが関連するかを理解するためにすべてのリンクを開く必要があり、時間とコンテキストを浪費してしまいます。事前に注釈をつけることで、重い作業を一度だけ行い、それをインデックスに保存します。
新しいセッションごとに新人のようにオンボーディングする。 新しいセッションが始まるたびに、モデルは白紙の状態から始まります。したがって、プロジェクトごとの CLAUDE.md を、1 日目に新しいチームメンバーに手渡すオンボーディングドキュメントとして扱うと役立ちます。Claude は私のプロジェクトごとの CLAUDE.md ファイルをスキャンし、それらに略語の用語集、プロジェクトコードネーム、および同じ名前の同僚が含まれていることを強調しました。また、CLAUDE.md には推奨される読み順も記載しています。例えば、モデルに対してまず INDEX.md をスクリーンショットし、次に TODOS.md、最後に特定のトピックノートを読むように指示するなどです。
メモリ層を構築する。 デフォルトでは、モデルは直前のセッションで何があったかを記憶しないため、永続化すべき内容はすべてディスクに書き込む必要があります。私はメモリ層を 2 つのバケットに分けています。~/vault にはプロジェクトの状態、アーティファクト、ドメイン知識などの事実を保存し、~/.claude(およびその中の CLAUDE.md、skills/、guides/)には私の好み、ワークフロー、個人的な嗜好を格納しています。前者は文脈を提供し、後者は設定情報を提供します。
嗜好を設定として扱う
まずは ~/.claude/CLAUDE.md から始めましょう。 Claude はセッションの開始時にこのファイルを読み込みます。私はこれを行動契約と捉えています。私の CLAUDE.md には、どの程度直接的であるべきか、いつ反論すべきか、ミスをどう扱うか、何を教えるべきかなど、好みの設定が含まれています。以下に抜粋版を示します:
<behavior>
- 意見が異なる場合は率直に述べ、反論してください;私のアプローチに問題がある場合は、それを指摘してください。
- 何かについて不確かな場合は、自信を持って推測するのではなく、「不確かである」と述べてください。
- 何かが失敗した場合、再試行する前に根本原因を調査してください。
- 差分はタスクに限定してください:不用意なリフォーマットや無関係なリファクタリングは行わないでください。
...
</behavior>
<teaching>
私は常に新しいシステムやドメインを学んでいます。私がまだ内面化していない可能性が高い重要な用語が登場した場合は、1〜2 文で説明し、その後すぐに進んでください。フォーマット:
💡 followed by 1 - 2 sentence explanation
...
</teaching>
ディレクトリ単位でスコープを定義する:グローバル、次にリポジトリ、そしてプロジェクト。 全体的に適用される設定(例:動作、長期的な目標、指導方針)は ~/.claude/CLAUDE.md に配置します。特定のリポジトリの規約(例:リンティング、命名規則、プルリクエストの手順)はそのリポジトリのルートディレクトリに記述します。プロジェクト固有のコンテキスト(つまり、ディレクトリ構成やドメイン知識)はプロジェクトディレクトリ内に格納します。Claude Code をサブディレクトリで起動すると、ツリーを遡って各 CLAUDE.md ファイルを読み込みます。また、セッション中にモデルがサブディレクトリに移動した場合も、そのディレクトリの CLAUDE.md が読み込まれます。詳細は ドキュメント を参照してください。
CLAUDE.md が長くなりすぎたら分割してください。 長い CLAUDE.md ファイルはコンテキストの負担(コンテキスト・タックス)となり得ます。セッションで必要ない場合でも、毎回すべての内容が読み込まれてしまうからです。これを解決するには、チャンクを「遅延読み込み」されるガイドにリファクタリングします。@import してはいけません(そうすると単にインライン化されてしまうだけだからです)。代わりに、CLAUDE.md ファイルに対して関連するタイミングでそれらを読み込むよう指示します。こうすることで、評価用データセットの構築を行っているセッションでは、ドキュメント作成に関するガイドは読み込まれません。以下にガイドセクションの例を示します:
<guides>
- ドキュメント、1 ページ資料、あらゆる文章作成: ~/.claude/guides/writing.md
- 評価用データセットの構築とレポート作成: ~/.claude/guides/evals.md
- ダッシュボード: ~/.claude/guides/dashboards.md
...
</guides>
週に 1 回以上行うことは、スキルとして確立してください。 スキルとは、モデルが必要に応じて読み込むための名前、トリガー、手順を備えた Markdown ファイルです。スキルは Markdown で記述されたワークフローと捉えてください。これにはロジックを含めることもできます。例えば、私の /polish スキルはアートの差分を確認します。もしメトリクスが生成されれば関連する評価(eval)を実行し、ブラウザでレンダリングされる場合は Chrome 内の Claude を通じて出力を検査します。どちらでもない場合はコードを実行して出力またはエラーを読み取ります。スキルには、どのステップを適用するかという判断を含む手順もエンコードされています。私が使用しているスキルの一部は以下の通りです:
/polish: バグのチェック、コードの簡素化、出力の検証(評価、Chrome 内の Claude、その他による)、クリティカルなフィードバックがなくなるまで反復、PR のドラフト作成
/write: アウトラインのために私にインタビューし、調査用のサブエージェントを起動し、ドラフトを作成し、敵対的批評家を通じてフィードバックを与え、クリティカルなフィードバックがなくなるまで反復
/daily: カレンダー、Slack、PR、昨日のログなどを参照して今日の優先順位を書き出す
私は SKILL.md ファイルを小さく保ち、ワークフローとルーティングに焦点を当てる傾向があります。テンプレートやスクリプトなどの知識は別ファイルとして管理し、モデルが必要に応じてのみ読み込んで実行するようになっています。これは遅延ロードされたガイドと同じ仕組みです。
一度タスクを実行し、その後モデルにその作業をスキル化させることでスキルを習得する。 これが私が最も多くのスキルを構築する方法です。まず、通常のセッションで対話形式で一度タスクを実行します。次に、直前に行った作業をスキルに変換するようにモデルに依頼します。続いて、同じまたは類似のタスクに対してそのスキルを実行します。当然ながら、出力の修正が必要になることがありますが、これは同じセッション内で行い、フィードバックがセッションのトランスクリプトに記録されるようにします。最後に、修正とフィードバックに基づいてスキルを更新するようにモデルに依頼します。また、望ましい出力の例をスキルの種として与えることもできます。コードの整理方法やドキュメントの構造・トーンなど、パターンを抽出するようにモデルに指示してください。
ファイルそのものではなく、トランスクリプトを通じてスキルを洗練させる。 スキルの最初のバージョンは、元のセッションに過剰適合しているため、完璧に機能することは稀です。これは正常な現象です。実行して出力を更新する必要がある場合は、セッション内で修正を行ってください。SKILL.md を直接開いて編集しようとしないようにしてください。セッション内でフィードバックを提供することで、モデルには「前」と「後」のペアが蓄積され、トランスクリプトに記録されます—つまり、「私たちはこうした」「私はこう欲しかった」、そしてその理由です。出力が正しいと確認できたら、モデルにフィードバックをスキルに統合するよう依頼してください。数回繰り返すことでスキルは収束し、最終的な出力を編集する必要はほとんどなくなります。
それでも、すべてのタスクにこの文脈が必要というわけではありません。 ブレインストーミング、探索、ラフドラフト作成においては、シンプルモード(CLAUDE_CODE_SIMPLE=1 claude)を使うのが好きです。ここでは CLAUDE.md は読み込まれますが、エージェント型ハーン(フック、スキル、ツールを多用するループなど)は読み込まれません。これによりモデルに近づけることができ、これは私がアウトローディングしているときではなく、思考を声に出して行っているときに望むことです。
自律性に対する検証
検証を左側にシフトさせ、記述時にエラーを検出します。 私は検証を梯子のように考えています。最下段は安価で決定論的であり、最上段は高価で判断力を要します。私たちは可能な限り低い段階で問題を解決したいと考えています。最下段に近いのは、モデルが更新したファイルに対して ruff format や ruff check --fix を実行するポスト編集フックです。これは決定論的に実行され、トークンを消費しません。梯子の上の方にはテスト、評価(evals)、LLM によるレビューなどがあります。
モデルが作業を検証しやすくします。 モデルにフィードバックループを与えて出力を改善させましょう。システムが指標を生成する場合は、モデルに評価を実行させて最適化させます。出力がブラウザでレンダリングされる場合は、Chrome 内の Claude を介してモデルがそれを検査できるようにします。どちらでもない場合は、モデルに実行させてエラーを読み取らせましょう。例えば Docker イメージを構築する際は、モデルにビルドさせ、エラーを読み取り、Dockerfile を編集し、再ビルドさせます。ハーンを調整している場合は、モデルに評価を実行させ、トランスクリプトを読み取り、失敗箇所を修正させます。ダッシュボードを構築する際は、Chrome 内でツールチップがレンダリングされているか、ラベルが重なっていないか、物語が数値と一致しているかをモデルに確認させます。
長時間実行されるタスクでは、モデルに他のモデルを監視させましょう。 長いセッションではエラーが蓄積してドリフト(逸脱)が生じることがあります。一つの解決策は、新しいコンテキストを持つセカンダリ・セッションを実行し、元の仕様とプライマリ・セッションの直近のやり取りを読み取ることです。私が推奨する最小限の設定では、2 つの tmux パンを使用します。1 つはプライマリの開発用、もう 1 つはペア・プログラマー用です。初期指示とフォローアップのプロンプトは共有ファイルに追加されます。定期的にペア・プログラマーが起動し、仕様をプライマリ・セッションの直近のトランスクリプトと比較して、何か不具合があれば是正のためのフィードバックを提供します。
これは様々な方法で行えます。例えば、ペア・プログラマーは実行ドリフト(タスクの実行における逸脱)を検知できます。モデルが正しいタスクを実行しているかです。これはローカルで戦術的なものであり、エラーを無視したり、悪いメトリクスを報告したり、仕様から逸脱したりするケースに該当します。また、方向ドリフト(適切なタスクの実行における逸脱)もあります。これはより大局的で戦略的な問題であり、モデルが元の意図を誤解して数時間を費やして間違ったものを構築している場合に発生します。実行ドリフトは頻繁にチェックし、方向ドリフトは時々チェックしましょう。
委任によるスケーリング
業務のより大きな部分を委譲する。 時にはモデルとペアプログラミングを行う:短いタスク、迅速なフィードバック、ループ内での継続。これは高速な反復、探索的分析、プロトタイピングにはよく機能します。しかし、ますます強力になるモデルに対しては、より大きなタスクを委譲することを目指すべきです。意図、制約、成功基準を事前に明確に説明し、その後モデルに任せて実行させます。検証できないものは委譲できませんので、まずは成功基準と指標を定義する必要があります。変化の方向性は、一度に一つ指示を出すことから、計画を詳細に練り、モデルがそれを最初から最後まで実行させることにあります:
「これらの評価スイート(eval suites)に基づき、各スイートごとに隔離されたコンテナを構築し、それぞれのビルドが成功するかどうかを確認する。その後、完全な実行を行い、評価指標とトランスクリプトをログに記録し、サブエージェントを使用してトランスクリプトを読み込み、評価が正しく実行されたことを確認する。信頼区間を得るために各評価を n 回実行する。最後にレポートを生成し、レポートガイドに従っているか検証し、結果とレポート URL を Slack で私に送信する。」
並行してセッションを実行し、ボトルネックを見つける。より大きなタスクを委譲することで、一度により多くのことを実行できるようになります。 Claude によると、私は通常、3 から 6 のセッションを同時に実行しています。ボトルネックは作業を行うことから、明確な仕様書を作成し、出力を迅速にレビューしてパイプラインが止まらないようにすることへと移っています。中間工程が空洞化しているのです。並行するセッションが同じリポジトリ(repo)を共有する場合、git worktrees を使用して各セッションに独自のチェックアウトを与え、互いの変更を上書きしないようにしてください。
セッションを監視しやすくする。 複数のセッションを実行している場合、それぞれの状態とどのセッションに注意が必要かを知る必要があります。私の Mac では、セッションが完了したときに停止フックが音を再生します(例は後述)。tmux ウィンドウのタイトルにはステータス絵文字(⏳作業中; 🟢完了)と、Haiku で生成された短いラベルを使用し、各パネルが何をしているか一目でわかるようにしています。Claude Code のステータスラインでは、コンテキストの使用状況と現在のモードが表示されます。これらを組み合わせることで、停止フックの音はタスク完了を知らせ、tmux タイトルはどのセッションかがわかり、ステータスラインが詳細を提供します。
例:停止フックによるアラート
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "if command -v afplay >/dev/null 2>&1; then afplay -v 1.0 /System/Library/Sounds/Glass.aiff; else tput bel; fi"
}
]
}
AFK(不在)中でも確認できます。 Claude Code の /remote-control コマンドを使えばこれが容易になります。通勤中や列に並んでいる間、Claude アプリのコードタブを開いて、何が実行中で何がブロックされているかを確認し、必要に応じて追加のコンテキストや新しい指示で停滞したセッションを解除します。これにより、セッションが数時間放置されることなく動き続けます。ただし、緊急性がある場合のみ行ってください。自分がその場にいるべき時や、自然に触れたい時には行わないでください。
ループを閉じる
オープンな環境で作業して文脈を豊かに保つ。共有ドキュメント、リポジトリ、チャンネルで作業を行うことで、チームメンバー全員—モデルを含めて—が文脈を容易に取得し、活用できるようになります。今日共有した内容は、明日の組織の文脈の一部となります。簡単なテストを試してみてください:新しいチームメンバーが、共有された文脈のみを使って先週のあなたの仕事を再現できるでしょうか?もし可能なら、あなたは組織の文脈構築に貢献できています。もし不可能なら、その貴重な文脈はあなたの頭の中に閉じ込められたままです。私はこれを、CLAUDE.md に指示を記述することで部分的に自動化しています。具体的には、重要なタスクを完了するたびに、作業ログチャンネルに短い更新情報を投稿し、関連するアーティファクトの PR やドキュメントへのリンクを含めるよう設定しています。
会話記録から設定更新点を掘り起こす。モデルに過去のセッション記録を読み込ませ、抜け漏れや不整合を見つけさせましょう。私が過去約 2,500 のユーザーとの対話履歴をスキャンした際、かなりの割合で「*can you also…*(〜もできますか)」「*did you check…*(〜を確認しましたか)」「*still wrong*(まだ間違っている)」といったフレーズが含まれていました。これらは、モデルが何らかの指示なしに行動すべきだったことを示唆しており、CLAUDE.md やスキルセットを更新する必要があるか、検証ステップが欠落しているか破損している可能性があります。修正が発生した頻度はヒット数で把握でき、記録からは何が失敗したかが具体的にわかります。そのため、私はセッション内で直接修正を行うようにしています。そうすれば、その会話記録を次の CLAUDE.md やスキルの更新のための入力として活用できるからです。
定期的にリファクタリングと整理を行ってください。設定ファイルが大きくなると、互いに重複したり競合したりするようになります。その結果、モデルがルールを無視するのは、別のルールと矛盾しているためかもしれません。これを解決するには、定期的にリファクタリングを行うことです。各ルールや優先事項は、正確に 1 つの場所に存在させるようにしてください(ただし、重要な指示はメインの CLAUDE.md に重複して記載しても構いません)。また、迷い込んだディレクトリレベルの設定ファイル settings.json をチェックし、それらを ~/.claude 内に統合するようにしています。
• • •
具体的な設定方法はモデルが向上するにつれて変化する可能性がありますが、以下の原則は引き続き重要だと考えています:適切なコンテキストを提供する、自分の嗜好をコードに反映させる、検証コストを低く抑える、より多くのタスクを委譲する、そしてフィードバックループを完結させることです。私たちが行っているのは、1 つのフィードバックごとに協力者を育成することです。よく考えてみると、これらの原則は人間とのチームでの働き方にも当てはまります。
始めるには、モデルにこの SETUP.txt を読ませて、適用を支援させてください。また、皆さんが有用だと見つけたプラクティスや原則があればぜひ知りたいです。下のコメント欄にご意見をお寄せいただくか、ご連絡ください!
もしこの記事が役に立った場合は、以下の通り引用してください:
**
Yan, Ziyou. (May 2026). How to Work and Compound with AI. eugeneyan.com.
https://eugeneyan.com/writing/working-with-ai/.
または
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等)は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
@article{yan2026default,
title = {How to Work and Compound with AI},
author = {Yan, Ziyou},
journal = {eugeneyan.com},
year = {2026},
month = {May},
url = {https://eugeneyan.com/writing/working-with-ai/}
}
Share on:
Join 11,800+** readers getting updates on machine learning, RecSys, LLMs, and engineering.
原文を表示
How can we work effectively with AI? What’s the workflow, how does it scale, and how do we improve our systems over time? And ideally, it should compound. Every finished artifact—code, docs, analysis, decisions—becomes context for the next session. And each correction updates a config that reduces future errors. While I’m still learning, I’ve repeated my answers often enough that I’m writing it here so the next time I’m asked I can share a link instead.
If you use AI regularly, you likely already apply many of these practices. Nonetheless, I believe the underlying principles apply broadly: provide good context, encode your taste as config, make verification easy, delegate bigger tasks, and close the loop. If a practice does not fit, adapt the principle and invent your own. Also notice, as you read, that none of this is specific to AI. It’s simply how you onboard and work with any new collaborator.
• • •
Context as infrastructure
Help models nagivate your context. For example, all my code lives in ~/src and all my knowledge work lives in ~/vault (organized into projects/, notes/, kb/ and so on). When our work is organized, it makes it easier for the model to retrieve context using grep or glob. And by having a clean directory tree, it’s more straightforward to navigate the directory, and find and lean on prior code, project docs, analysis, etc. to improve the work being done.
Connect models to your organization’s context. Models can benefit from organizational knowledge which likely lives in Slack, Drive, Mail, etc. Most have MCPs for Claude Code, Cowork, Claude.ai. On top of these, I also maintain a INDEX.md per project. It’s an annotated index of the relevant docs and channels, and each entry includes the URL, owner, and a brief paragraph explaining what’s inside and when to read it. The annotation helps a lot. A bare list of URLs forces the model to open every link to figure out what’s relevant, wasting time and context. By annotating upfront, we do the heavy lifting once and store it in the index.
Onboard each new session like a new hire. With each new session, the model starts with a blank slate. Thus, it helps to treat the per-project CLAUDE.md like the onboarding doc we’d hand to a new teammate on day one. Claude scanned my per-project CLAUDE.md files and highlighted that they included glossaries for acronyms, project code names, and teammates with the same first name. I also have a suggested reading order in the CLAUDE.md, like telling the model to skim INDEX.md first, then TODOS.md, and finally specific topic notes.
Build your memory layer. By default, models don’t remember what happened in the last session, so anything worth persisting should be written to disk. I split my memory layer into two buckets. ~/vault holds facts such as project state, artifacts, and domain knowledge; ~/.claude (along with its CLAUDE.md, skills/, guides/) contains my preferences, workflows, and personal taste. The former provides context while the latter provides configuration.
Taste as configuration
Start with ~/.claude/CLAUDE.md. Claude reads this at the start of every session. I think of it as a behavioral contract. My CLAUDE.md contains preferences like how direct to be, when to push back, how to handle mistakes, what to teach me, etc. Here’s a trimmed version:
<behavior>
- Be direct and push back when you disagree; if my approach has problems, say so.
- When unsure about something, say you're unsure rather than guessing confidently.
- When something fails, investigate the root cause before retrying.
- Keep diffs scoped to the task: no drive-by reformats or unrelated refactors.
...
</behavior>
<teaching>
I'm always picking up new systems and domains. When a key term surfaces that I
likely haven't internalized, explain it in 1-2 sentences and then move on. Format:
> 💡 followed by 1 - 2 sentence explanation
...
</teaching>
Scope it by directory: global, then repo, then project. Put preferences that apply everywhere (e.g., behavior, long-term goals, teaching) in ~/.claude/CLAUDE.md. Put conventions for a specific a repo (e.g., linting, naming, pull requests) in the repo’s root. Put project-specific context (i.e., directory layout, domain knowledge) in the project directory. When you start Claude Code in a subdirectory, it walks up the tree and loads each CLAUDE.md. And when the model navigates into a subdirectory mid-session, the model picks up that directory’s CLAUDE.md too. More in the docs.
When CLAUDE.md gets too long, split it out. A long CLAUDE.md can become a context tax. It loads everything every session even if the session doesn’t need it. To fix this, refactor chunks into guides that load lazily. Don’t @import them (because that just inlines them). Instead, tell your CLAUDE.md to read them when relevant. This way, a session that’s building evals skips the guide on writing docs. Here’s an example guide section:
<guides>
- Docs, 1-pagers, any writing: ~/.claude/guides/writing.md
- Eval building and reports: ~/.claude/guides/evals.md
- Dashboards: ~/.claude/guides/dashboards.md
...
</guides>
If you do something ≥ once a week, make it a skill. A skill is a markdown file with a name, trigger, and procedure that the model loads on demand. Think of skills as workflows written in markdown. They can include logic. For example, my /polish skill looks at the artifact diff. If it produces a metric, it runs the associated eval. If it renders in a browser, it checks the output via Claude in Chrome. If neither, it runs the code and reads the output or error. Skills encode both the steps and the judgment of which steps apply. A few I have include:
- /polish: checks for bugs, simplifies the code, verify the output (via evals, Claude in Chrome, or something else), iterate until no critical feedback, draft the PR
- /write: interviews me for the outline, spawn research subagents, writes the draft, gives feedback via adversarial critic, iterate until no critical feedback
- /daily: reads my calendar, slack, PRs, yesterday’s log, etc and writes today’s priorities
I tend to keep SKILL.md small and focused on the workflow and routing. The knowledge, like templates and scripts, are separate files that the model reads and runs only when needed, just like lazy-loaded guides.
Bootstrap skills by doing the task once and then asking the model to make it a skill. This is how I build most skills. First, I do the task once, interactively, in a normal session. Then, I ask the model to turn what we just did into a skill. Next, I run the skill on the same or similar task. Inevitably, I’ll need to correct the output, which I do in the same session so feedback is logged in the session transcript. Finally, I ask the model to update the skill based on the corrections and feedback. You can also seed a skill with exapmles of the desired output. Ask the model to extract the patterns, like how you organize your code, or the structure and tone of your docs.
Refine skills via the transcript, not the file directly. The first version of the skill rarely works perfect because it overfits the original session. This is normal. When you run it and need to update the output, correct it within the session. Try not to open and edit SKILL.md directly. Providing feedback in the session gives the model before-and-after pairs which accumulate in the transcript—here’s what we did, here’s what I wanted, and why. Once the output is right, ask the model to merge the feedback into the skill. After a few rounds, the skill converges and you barely have to edit the final output.
Nonetheless, not every task needs this context. For brainstorming, exploration, and rough drafts, I enjoy using simple mode (CLAUDE_CODE_SIMPLE=1 claude). Here, CLAUDE.md still loads but the agentic harness—hooks, skills, tool-heavy loops—doesn’t. This gets me closer to the model, which is what I want when I’m thinking out loud rather than shipping.
Verification for autonomy
Shift verification left; catch errors at write time. I think of verification as a ladder. The bottom is cheap and deterministic; the top is expensive and requires judgement. We want to address issues at the lowest possible rung. Near the bottom are post-edit hooks that run ruff format, ruff check --fix on files the model just updated. This happens deterministically and doesn’t cost tokens. Higher on the ladder are tests, evals, LLM reviews, etc.
Make it easy for the model to verify the work. Give the model feedback loops to improve its output. If the system produces a metric, let the model run the eval and optimize it. If the output renders in a browser, let the model inspect it via Claude in Chrome. If neither, let the model run it and read the error. For example, when building Docker images, I let the model build, read the error, edit the Dockerfile, and rebuild. If I’m tuning a harness, the model runs evals, reads the transcripts, and fixes failures. When building a dashboard, the model checks in Chrome that tooltips render, labels don’t overlap, and the narrative matches the numbers.
For long-running tasks, have models watch models. Long sessions can drift as errors build up. One fix is to run a secondary session with fresh context to read the original spec and the recent turns of the primary session. My minimal setup uses two tmux panes, one for the primary dev, one for the pair programmer. Initial instructions and follow-up prompts are appended to a shared file. Periodically, the pair programmer spins up, checks the spec against the primary’s recent transcript, and if something’s off, provides feedback to course correct.
We can do this in various ways. For example, the pair programmer can watch for execution drift—is the model doing the task right? This is local and tactical, like ignoring an error, reporting a bad metric, or diverging from the spec. There’s also direction drift—is the model doing the right task? These are bigger picture and strategic, and occur when the model misinterprets the original intent and spends hours building the wrong thing. Check for execution drift often and direction drift occasionally.
Scaling via delegation
Delegate increasingly bigger chunks of work. Sometimes, we pair-program with models: short tasks, fast feedback, staying in the loop. This well works for fast iterations, exploratory analysis, and prototyping. But with increasingly stronger models, we should aim to delegate bigger tasks. Explain your intent, constraints, and success criteria upfront, then let the model work. You can’t delegate what you can’t verify, so this requires first defining success criteria and metrics. The shift is from giving instructions, one at a time, to fleshing out plans and letting the model execute them end to end:
“Given these eval suites, build isolated containers per suite and smoke-test that each builds. Then, do the full run, log the eval metrics and transcripts, and use subagents to read the transcripts and confirm the evals ran correctly. Run each eval n times for confidence intervals. Finally, generate the report, verify it follows the report guide, and slack me the results and report URL.”
Run sessions in parallel and find the bottleneck. Delegating bigger tasks means we can run more at once. Claude says I typically run three to six sessions simultaneously. The bottleneck has shifted from doing the work to writing clear specs and reviewing outputs fast enough to keep the pipeline moving—the middle is hollowing out. If parallel sessions share a repo, use git worktrees so each session gets its own checkout and don’t overwrite each other’s changes.
Make sessions easy to observe. When running multiple sessions, I need to know their state and which one needs attention. On my mac, a stop hook plays a sound when a session finishes (example below). My tmux window titles use a status emoji (⏳ working; 🟢 complete) and a short Haiku-generated label so I know what each pane is doing. The Claude Code status line shows context usage and the current mode. Together, the stop-hook sound signals a finished task, the tmux titles shows which one, and the status line provides the details.
# Example stop hook alert
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "if command -v afplay >/dev/null 2>&1; then afplay -v 1.0 /System/Library/Sounds/Glass.aiff; else tput bel; fi"
}
]
}
You can check in even if AFK. /remote-control in Claude Code makes this easy. While commuting or waiting in line, I open the code tab in the Claude app to see what’s running and what’s blocked, and if needed, unblock a stalled session with additional context or new instructions. This keeps sessions moving instead of sitting idle for hours. Only do this if there’s something urgent though, not when you’re trying to be present or touch grass.
Closing the loop
Keep the context rich by working in the open. When we do our work in shared docs, repos, and channels, it makes it easier for everyone—including models—to retrieve and benefit from the context. What we share today becomes part of the org context tomorrow. Try this simple test: could a new teammate replicate your work from last week using only the shared context? If yes, you’re contributing well to the org context; if not, that precious context is stuck in your head. I automate this somewhat via instructions in my CLAUDE.md to post short updates in a worklog channel whenever I finish a substantial task, with links to the artifact PR or doc.
Mine your transcripts for config updates. Have the model read past session transcripts to find gaps. When I scanned ~2,500 of my past user turns, a sizable percentage contained phrases like *“can you also…“*, *“did you check…“*, *“still wrong”*, etc. These suggest that the model should have done something unprompted, and I should update the CLAUDE.md or skill, or that a verification step is missing or broken. Hit counts show how often a correction happens and the transcripts show exactly what failed. This is why I make corrections within the session, so I can use the transcript as input for my next CLAUDE.md or skills update.
Refactor and prune periodically. As configs grow, they can overlap or conflict with each other. As a result, if the model ignores a rule, it can be because another rule contradicts it. Fix this by refactoring periodically. Each rule or preference should live in exactly one place (though critical instructions can be repeated in the main CLAUDE.md). I also check for stray directory-level settings.json and consolidate them back into ~/.claude.
• • •
While the specific setup will likely change as models get better, I think the principles will remain relevant: provide good context, encode your taste, make verification cheap, delegate more, and close the loop. What we’re doing is training a collaborator, one feedback at a time. And if you think about it, these principles apply to how we work with a human team too.
To get started, have your model read this SETUP.txt and help you apply it. Also, I’d love to learn what practices or principles you’ve found valuable—please comment below or reach out!
If you found this useful, please cite this write-up as:
Yan, Ziyou. (May 2026). How to Work and Compound with AI. eugeneyan.com.
https://eugeneyan.com/writing/working-with-ai/.
or
@article{yan2026default,
title = {How to Work and Compound with AI},
author = {Yan, Ziyou},
journal = {eugeneyan.com},
year = {2026},
month = {May},
url = {https://eugeneyan.com/writing/working-with-ai/}
}Share on:
Join 11,800+ readers getting updates on machine learning, RecSys, LLMs, and engineering.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み