CCA-F start here · Trap gym · Which built-in tool?

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

At a glance: use Grep to search inside files and Glob to find files by name pattern, use Edit for a small targeted change, and when Edit fails because the text appears more than once, Read the whole file and Write it back.

Start here: the cookbook

You are looking for a recipe in a thick cookbook.

Finding. You either flip to the index of dish names (that's Glob: finding by name) or scan the pages for the word “saffron” (that's Grep: finding by what is written inside).
Changing. To fix one typo you cross it out and write the right word (Edit). If the same phrase appears five times and you can't point to just one, you copy the page out fresh, with the one change (Read, then Write).

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.

Find Look Change Glob files by name **/*.test.ts Grep text inside files calculateTax( Read one whole file follow imports Edit one small change unique match only not unique Bash runs commands: tests, builds, git not the pick for finding or editing Read + Write replace the whole file the Edit fallback To understand code: Grep the entry point, then Read along the imports, one file at a time.
The one question to ask: am I looking for a file by its name, or for text inside files, and is the change small enough for one unique match?

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.

1. The job

2. The tool
Tokens read into the session:

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

TrapWhat the wrong option looks likeWhy it loses
OverbuiltUse Glob with a broad pattern and Read every file it returns to find the callersIt reads far more than needed. Grep finds the files that contain the name directly.
Wrong toolRun grep, find or sed through the Bash tool insteadThe 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 worksRetry Edit with a longer piece of surrounding text until the match is uniqueIt can take several tries, and with identical blocks the text may never be unique. The guide's fallback is Read + Write.
OverbuiltRead the whole codebase up front so Claude has the full pictureIt 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

Grep searches inside files, Glob finds files by name, Edit needs a unique match, and Read + Write is the fallback when it isn't unique.

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).”

← All traps