ポッドキャストに戻るClaude
Claude Code 101
Claude Code はどのように動作するか
We know that Claude code is different from usual chat applications, but how does it work?
Claude Code は通常のチャットアプリとは異なることはわかっていますが、どのように機能するのでしょうか?
Claude code is best explained through the agentic loop.
Claude Code は agentic ループを通じて最もよく説明されます。
You enter a prompt into Claude code.
Claude Code にプロンプトを入力します。
Claude code will then gather contacts required to complete your prompt.
Claude Code はプロンプトを完了するために必要なコンテキストを収集します。
It does so by interacting with the model which will return text or a tool call that Claude code can execute.
これはモデルとやり取りすることで行われ、モデルはテキストまたは Claude Code が実行できるツール呼び出しを返します。
Then it takes action.
そして、それは行動を取ります。
For example, editing a file or running a command.
例えば、ファイルを編集したりコマンドを実行したりします。
Finally, it verifies those results and determines if they achieve what your prompt set out to do in the first place.
最後に、それらの結果を検証し、プロンプトが最初に目指していたことを達成しているかどうかを判断します。
If they do, then Claude finishes and waits for the next prompt.
達成していれば、Claude は終了して次のプロンプトを待ちます。
And if they don't, Claude goes back and runs the loop again until the results are complete and verifiable.
達成していなければ、Claude は戻ってループを再実行し、結果が完全で検証可能になるまで続けます。
Throughout this loop, you're able to add contacts, interrupt it, or steer the model to help guide it towards your end goal.
このループ全体を通じて、コンテキストを追加したり、中断したり、モデルを誘導して最終目標に近づけることができます。
Claude has a context window, which determines how much of your conversation, file contents, command outputs, and more it can store and look back on.
Claude にはコンテキストウィンドウがあり、会話、ファイルの内容、コマンド出力などをどれだけ保存して振り返れるかを決定します。
Once you reach that limit, Claude code compacts your conversation, which automatically determines what it can take out of the context window and what it can summarize in order to bring the context window back down.
その上限に達すると、Claude Code は会話を圧縮し、コンテキストウィンドウから何を取り除き、何を要約してコンテキストウィンドウを縮小できるかを自動的に判断します。
Tools are the backbone of how agents work.
ツールはエージェントの動作の根幹です。
Currently, most AI assistants are simply input text and output text.
現在、ほとんどの AI アシスタントはテキストを入力してテキストを出力するだけです。
Nothing in between.
その間には何もありません。
Tools let Claude code and other agents determine when to execute code to get closer to a task.
ツールにより、Claude Code や他のエージェントはタスクに近づくためにいつコードを実行するかを判断できます。
This could be read file tool or search web tool, for example.
これは例えば、ファイル読み取りツールやウェブ検索ツールなどです。
Claude code uses semantic searching to determine when to call a tool and get the output of it.
Claude Code はセマンティック検索を使用して、ツールをいつ呼び出し、その出力を取得するかを判断します。
Claude code also has permission modes.
Claude Code には権限モードもあります。
Default behavior is that it has to ask explicit permission before editing a file or running a shell command.
デフォルトの動作では、ファイルを編集したりシェルコマンドを実行する前に明示的な許可を求める必要があります。
You can use shift and tab to toggle between different modes.
Shift と Tab を使って異なるモードを切り替えることができます。
Auto accept edits files without asking, but still ask for commands.
自動承認はファイルを確認なしに編集しますが、コマンドについては引き続き確認します。
Plan mode uses read-only tools to help compile a plan of action before starting.
計画モードは読み取り専用ツールを使用して、開始前に行動計画をまとめるのに役立ちます。
It's worth being cautious when skipping permissions.
権限をスキップする場合は慎重にする価値があります。
Giving Claude code free reign to run commands means a mistake could be harder to catch before even happens.
Claude Code にコマンドを自由に実行させると、ミスが発生する前に気づくのが難しくなる可能性があります。
Claude code works by combining different agentic concepts, an agentic loop, a managed context window, tools, and configurable permissions into your terminal.
Claude Code は、agentic ループ、管理されたコンテキストウィンドウ、ツール、設定可能な権限という異なる agentic コンセプトをターミナルに組み合わせることで機能します。
It can read your code base, take action, and verify its own work, and that makes it fundamentally different from a chat window.
コードベースを読み込み、行動を取り、自分の作業を検証できるため、チャットウィンドウとは根本的に異なります。