Claude Certified Architect - FoundationsCCAR-F Learning Guide
Domain 2 · Lesson 2.5 · 5 min read

Choosing the Right Built-in Tool

Exam taskSelect and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively

Grep searches file contents, Glob matches file paths, Read and Write handle whole files and Edit makes targeted changes; build understanding incrementally instead of reading everything up front.

What you need to know

Which tool for which job

ToolSearches or changesExample
GrepFile contents, by patternEvery caller of calculateTax; every place that throws RateLimitExceeded
GlobFile paths, by name patternEvery test file: **/*.test.tsx
ReadOne whole fileLoad a file to understand or change it
WriteOne whole fileCreate a file, or replace one entirely
EditPart of a file, by unique text matchChange one line in a 2,000-line file
BashCommandsRun tests, a build, git

The distinction the exam tests most is Grep versus Glob: contents versus names. Finding files called *.test.tsx is Glob; finding files that contain "PaymentDeclinedError" is Grep.

Edit, and when it fails

Edit replaces a piece of text that must appear exactly once in the file. For a small change in a large file it is preferred over rewriting the whole file, because nothing else can be lost or altered by accident.

If the anchor text is not unique (the same boilerplate appears six times), Edit fails. Two good responses:

  • Include more surrounding text so the match becomes unique.
  • Fall back to Read the whole file, make the change in the full text, and Write it back.

Build understanding incrementally

Asked "how does billing work?", an agent that reads all 30 files in the directory fills its context before it has answered anything. The better approach:

  1. Grep for entry points: exported functions, main classes, route handlers.
  2. Read those files.
  3. Follow imports and calls with further Reads, only along the paths that matter.

Tracing through wrappers

When a function is re-exported through wrapper modules (sometimes under a different name), a single Grep for its original name misses callers. First find every name it is exported under, then Grep for each name.

Grep "calculate_tax" in pricing/        -> defined in pricing/tax.py
Grep "from pricing.tax import"          -> re-exported as compute_tax in billing/__init__.py
Grep "compute_tax|calculate_tax" in src -> all real call sites

In the exam

Scenario 4 (developer productivity) is the home of these questions: a pair of search tasks to match to Grep and Glob, a failing Edit, an agent drowning in file reads, or callers missed through wrappers.

Check your understanding

Question 1

You need (a) every file named *.test.tsx and (b) every file containing "PaymentDeclinedError". Which tools?

Show answer

Answer: D. Glob matches file names and paths; Grep searches inside files. Reading every file would waste context.

Question 2

An Edit fails because its anchor text appears six times in the file. What should the agent do?

Show answer

Answer: B. Edit needs a unique match. Reading the full file and writing the modified version back is the reliable fallback (a longer, unique anchor also works).

Question 3

Asked how billing works, an agent reads all 30 billing files and runs out of context. What is the better approach?

Show answer

Answer: C. Incremental exploration finds the entry points and follows only the paths that matter, so the context holds what is relevant.

Apply it: Lakeshore's exploration recipe

Exercise · about 10 minCase: Lakeshore Freight

Write the tool recipe Lakeshore's agent should follow for three common requests.

  1. "Find every place that throws RateLimitExceeded." Name the tool and pattern.
  2. "List every integration test file." They end in IT.java and live anywhere in the tree.
  3. "How does a booking become an invoice?" Write the first four tool calls.
  4. "Rename calculateTax everywhere." Allow for wrapper modules, and say what to do if an Edit anchor is not unique.
Check your work
Show model answer
  1. Grep for throw new RateLimitExceeded (and RateLimitExceeded( to catch factories) across the repository.
  2. Glob for **/*IT.java.
  3. Grep for class .*Booking.*Service|createInvoice to find entry points; Read the booking service; Grep for the invoice method it calls; Read the invoice service it leads to. Continue only along that path.
  4. Grep for the definition and for every import or re-export of calculateTax to collect all its exported names; Grep for each name to find call sites; Edit each site. Where an anchor repeats, widen it with surrounding lines, or Read the file, change all occurrences and Write it back.

Sources