ポッドキャストに戻るClaude
Claude Code 101
Claude Code における探索→計画→コード→コミット ワークフロー
If you take one thing away from Claude code, let it be this workflow: explore, plan, code, and commit.
Claude Code から一つだけ持ち帰るとしたら、このワークフローです: 探索、plan、コーディング、commit。
Without this, most people jump straight to pasting in Claude to write code, which means more course correcting later on.
これがないと、ほとんどの人はすぐに Claude にコードを貼り付けて書かせてしまい、後で軌道修正が増えることになります。
The fastest way to handle step one and two is with plan mode.
ステップ1と2を最速で処理する方法は plan mode の使用です。
With plan mode, Claude can't edit files.
plan mode では、Claude はファイルを編集できません。
It just reads files to gather research on how to tackle this implementation.
この実装にどう取り組むかを調査するために、ファイルを読み込むだけです。
To enter plan mode, hit shift and tab until you see the plan mode under the text input.
plan mode に入るには、テキスト入力の下に plan mode が表示されるまで shift と tab を押します。
I need to add WebP conversion to our image upload pipeline.
画像アップロードパイプラインに WebP 変換を追加する必要があります。
Figure out where in the pipeline it should happen, whether we need new dependencies, and how to approach it.
パイプラインのどこで行うべきか、新しい依存関係が必要かどうか、どのようにアプローチするかを把握してください。
And Claude will read relevant files, do some web searches, and give you a plan of action.
Claude は関連ファイルを読み込み、ウェブ検索を行い、行動計画を提示します。
Make sure you review it and determine if it meets your criteria.
必ず確認して、それが基準を満たしているか判断してください。
Otherwise, I can ask it to add on or revise some areas.
そうでなければ、追加や修正を依頼することができます。
Perfect.
完璧です。
And this right here is the best place to course correct because it's before any code is written.
ここがコードが書かれる前の最良の軌道修正ポイントです。
You can also use explore without being in plan mode by just asking Claude to explore your code base.
plan mode に入らずに、Claude にコードベースを探索するよう依頼するだけで探索することもできます。
Now, once the plan looks good, you can select approve to accept the plan and let Claude toggle all of the list items it provided.
plan が良さそうになったら、承認を選択して plan を受け入れ、Claude が提供したすべての項目を実行させることができます。
You can determine if you want Claude to auto accept the file edits or ask every single time.
Claude にファイル編集を自動承認させるか、毎回確認させるかを決めることができます。
Claude will do its best to troubleshoot your code base before considering the plan finished.
Claude は plan が完了したと判断する前に、コードベースのトラブルシューティングに最善を尽くします。
But at times, you'll need to course correct.
しかし、時には軌道修正が必要になります。
This is the benefit of working with plan mode because after the plan is finished, we also have the context of how it got to the results to help it guide its next decision.
これが plan mode を使う利点です。plan が完成した後も、結果にどのように至ったかのコンテキストが残り、次の判断の指針となります。
In order for Claude to be confident in its results, it has to be clear on what it deems correct.
Claude が結果に確信を持つためには、何が正しいとみなすかを明確にする必要があります。
When writing your plan, make this explicit.
plan を書く際には、これを明示してください。
Adding tools that will help Claude complete its goals will remove a lot of back and forth.
Claude が目標を達成するためのツールを追加することで、多くのやり取りを省けます。
For example, if you're building web UIs, make sure you have the Claude and Chrome extension so that Claude code can control a tab and test out the UI before deeming it finished.
例えば、Web UI を構築している場合は、Claude と Chrome 拡張機能を用意して、Claude Code がタブを制御し、完了と判断する前に UI をテストできるようにしてください。
In your project, include a test suite that Claude can continuously validate on.
プロジェクトに Claude が継続的に検証できるテストスイートを含めてください。
Claude can even write tests for you.
Claude はテストを書くこともできます。
Before passing this off to Claude, make sure that the tests are a source of truth for you and your team to avoid any false positives.
これを Claude に渡す前に、テストがあなたとチームにとって偽陽性を避けるための信頼できる事実の源であることを確認してください。
Quick tip, if you find Claude keeps running into the same issues, ask Claude to save the solution to his Claude MD file.
クイックヒント: Claude が同じ問題に繰り返しぶつかっている場合は、解決策を Claude MD ファイルに保存するよう依頼してください。
Now, once you have tested for yourself and are happy with the results, it's time to push your code.
自分でテストして結果に満足したら、コードをプッシュする時です。
A tip before you commit, run a sub agent code reviewer to look at your code.
commit 前のヒント: サブエージェントのコードレビュアーを実行してコードを確認させてください。
Then you get Claude to generate a commit message for you in your style.
そして、Claude にあなたのスタイルで commit メッセージを生成させてください。
Rinse and repeat.
繰り返してください。
If you want to be effective with Claude code, follow the explore, plan, code, and commit workflow.
Claude Code を効果的に使いたいなら、探索、plan、コーディング、commit のワークフローに従ってください。
Exploration will give the relevant context
探索は Claude にプロジェクトに必要な関連コンテキストを提供します
Claude needs for your project.
Claude があなたのプロジェクトに必要とするものです。
Plan will create a plan of action that Claude will use to determine if they are successful.
plan は Claude が成功を判断するために使う行動計画を作成します。
Code is the back and forth that you and Claude do before settling on the final outcomes of the plan.
コーディングは、plan の最終的な結果に落ち着く前に、あなたと Claude が行うやり取りです。
Commit helps you review and push your code so you can start on your next feature.
commit はコードをレビューしてプッシュするのを助け、次の機能に取り掛かれるようにします。