Which built-in tool?
The trap: almost any tool can be made to do the job, by reading everything, by running a shell command, by retrying an edit. The exam wants the one built for the job: Grep for text inside files, Glob for file names, Edit for one unique change, and Read + Write when Edit can't find a unique match.
D2 Tool Design & MCPExam guide 2.5About 12 minutes
Start here: the cookbook
You are looking for a recipe in a thick cookbook.
Claude Code has six built-in tools for this. Glob matches file paths against a pattern such as **/*.test.ts (** means “any folder, any depth”). Grep searches the text inside files. Read opens one whole file. Edit swaps one piece of text for another, and only works when that text appears exactly once. Write replaces a whole file. Bash runs shell commands, such as tests or builds.
- A file by name or path pattern: Glob.
- Text inside files (callers, a header, a setting): Grep, then Read the matches.
- A small change whose text appears once: Edit.
- Edit failed because the text is not unique: Read the whole file, then Write it back.
- Learning how code flows: Grep the entry points, then Read to follow imports. Not everything up front.
Words in the question that tell you which tool
Points to Grep
- every place that calls
- which files mention
- find the function, search the contents
- “file names don't say which files use it”
Points to Glob
- all files named
- every
*.test.tsx - files matching a pattern
- “every generated file follows the naming rule”
Points to Read + Write
- Edit failed
- the text appears more than once
- not unique; identical blocks
- told apart only by position
Try it: run the tool
Pick a job, then pick a tool. The simulator plays the calls Claude would make, shows the tool output, and counts the tokens read into the session. For the “request flow” job, two whole strategies appear as extra choices. The diagram above highlights your tool.
The repo, outputs and token counts are illustrative, chosen to show the shape. They are not measurements, and the error text is paraphrased. The exam guide's point is that each built-in tool has one job, that Edit needs a unique match, and that understanding is built incrementally.
Things to try: Find where calculateTax is called + Glob, then + Grep. Then Change a line that appears 3 times + Edit to see the error and the fallback, and + Bash to see sed change all three. Then Change one line + Read + Write: it works, but it is overbuilt. Last, Understand how a request flows + Read everything up front, then + Grep entry points, then Read along imports.
The four traps
| Trap | What the wrong option looks like | Why it loses |
|---|---|---|
| Overbuilt | Use Glob with a broad pattern and Read every file it returns to find the callers | It reads far more than needed. Grep finds the files that contain the name directly. |
| Wrong tool | Run grep, find or sed through the Bash tool instead | The built-in tools are made for content search, path search and edits. Reaching for Bash adds nothing, and sed can change every match. |
| Only usually works | Retry Edit with a longer piece of surrounding text until the match is unique | It can take several tries, and with identical blocks the text may never be unique. The guide's fallback is Read + Write. |
| Overbuilt | Read the whole codebase up front so Claude has the full picture | It floods the context. Find entry points with Grep and follow imports with Read. |
Practice: three exam-style questions
Answer first, then open “Think it through”.
Rule to remember
Exam guide 2.5: “Grep = content search; Glob = file path patterns; Read/Write = full file ops; Edit = targeted change via unique text match.” “When Edit fails on non-unique match → Read + Write fallback.” “Build understanding incrementally: Grep entry points → Read to follow imports/trace flows (not read-all-upfront).”