Claude認定 対策ノート

講座 › 分野2 ツール設計とMCP統合

2.5 組み込みツールの使い分け

配点 3.6%Built-in tools

名前で探すのは Glob、中身で探すのは Grep。編集は Edit、全体の書き換えは Write。目的に合う道具を選ぶ。

未読

探す道具:Grep と Glob

図解:探す道具:Grep と Glob

Glob はファイル名のパターンでファイルを探します。Grep はファイルの中身から、関数名やエラーメッセージのような文字列を探します。名前で探すか、中身で探すかが分かれ目です。

出典:Tools reference
The Glob tool finds files by name pattern.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)
出典:Tools reference
Where Glob finds files by name, Grep finds lines inside them.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)

読む・書く・直す

図解:読む・書く・直す

Read はファイルの内容を行番号つきで読みます。Write は新しく作るか、全体を書き換えます。Edit は、一意に決まる文字列を指定して、狙った箇所だけを直します。

出典:Tools reference
The Read tool takes a file path and returns the contents with line numbers.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)
出典:Tools reference
The Write tool creates a new file or overwrites an existing one with the full content provided.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)
出典:Tools reference
The Edit tool performs exact string replacement.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)

Edit が失敗するとき

図解:Edit が失敗するとき

Edit は、置き換える文字列がファイルの中でひとつだけのときに通ります。同じ文字列が複数あるときは、周りを含めた長い文字列で一意にするか、全部を置き換える指定をします。それでも決まらないなら、Read で全体を読んでから Write で書き直す方法に切り替えます。

出典:Tools reference
old_string must appear exactly once. When it appears more than once, Claude either supplies a longer string with enough surrounding context to pin down one occurrence
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)
出典:Claude Certified Architect – Foundations Exam Guide v1.0(英語)
Using Read to load full file contents followed by Write when Edit cannot find unique anchor text
https://everpath-course-content.s3-accelerate.amazonaws.com/instructor…(取得 2026-11-20)

コードの理解は、段階的に

図解:コードの理解は、段階的に

全部のファイルを最初に読むのではなく、Grep で入口を見つけ、Read で参照をたどって流れを追います。ラッパーを経由する関数は、公開されている名前を洗い出して、名前ごとに検索します。

出典:Claude Certified Architect – Foundations Exam Guide v1.0(英語)
Building codebase understanding incrementally: starting with Grep to find entry points, then using Read to follow imports and trace flows, rather than reading all files upfront
https://everpath-course-content.s3-accelerate.amazonaws.com/instructor…(取得 2026-11-20)
出典:Claude Certified Architect – Foundations Exam Guide v1.0(英語)
Tracing function usage across wrapper modules by first identifying all exported names, then searching for each name across the codebase
https://everpath-course-content.s3-accelerate.amazonaws.com/instructor…(取得 2026-11-20)

環境による違いにも注意

図解:環境による違いにも注意

ツールの構成は環境で変わります。macOS・Linux・WSL では、Glob と Grep を標準に含めず、Bash の find と grep で探す構成があります。道具の役割の考え方は同じです。

出典:Tools reference
On macOS, Linux, and WSL, Claude Code leaves Glob and Grep out of the default tool set, and Claude searches with find and grep through the Bash tool instead.
https://code.claude.com/docs/en/tools-reference.md(取得 2026-11-20)
出典:How Claude Code works
Tools are what make Claude Code agentic.
https://code.claude.com/docs/en/how-claude-code-works.md(取得 2026-11-20)
試験のポイント