Built-in tools: Read, Write, Edit, Bash, Grep, Glob
Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively.
This subtopic (2.5) sits in Tool Design & MCP Integration (D2) on Anthropic's Claude Certified Architect — Foundations (CCAR-F) exam. The bank holds 20 practice questions here — 4 easy, 12 medium, and 4 hard — with 6 free to try, answers and explanations included. 3 of the free questions are below; the rest are in the practice stream.
What the exam tests here
- building codebase understanding incrementally — Grep entry points then Read to trace
- Edit for targeted modifications — unique text matching; Read+Write as fallback
- Grep for content search — file contents, function names, error messages
- Glob for file path pattern matching — by name or extension
Free practice questions: Built-in tools: Read, Write, Edit, Bash, Grep, Glob
A developer needs to update a single error message string inside process_refund without touching surrounding code. Which built-in tool is the best first choice?
Show answer & explanation
Correct answer: D. Use Edit with unique matching text to replace only the target string
Edit is designed for targeted, surgical changes using unique text anchors — it avoids rewriting unchanged code and minimizes risk of unintended side effects. 'Read the file, modify...' is the fallback when Edit cannot match uniquely. 'Run a Bash sed command...' bypasses the built-in tool layer unnecessarily. 'Use Grep to locate...' adds steps without benefit when Edit handles the task directly.
A billing dispute spike is causing your support agent to misroute cases. You suspect process_refund is being called from a code path that skips policy checks. You need to locate every call site of process_refund across a large Python monorepo before patching. Which approach finds them most reliably?
Show answer & explanation
Correct answer: A. Use Grep with pattern 'process_refund\(' restricted to type python to list every invocation site with line numbers.
Grep with an anchored call-syntax pattern and a language type filter deterministically surfaces every invocation across the monorepo. 'Use Glob with pattern' finds files by name, missing call sites in unrelated filenames. 'Use Bash to run python -c' imports code with side effects and misses dynamic references. 'Use Read on the MCP tool registration' traces declaration not usage, so downstream callers go unseen.
A support agent needs to understand how escalate_to_human is triggered across a large codebase before modifying the escalation flow. The agent doesn't know which files call this function. What is the correct two-step approach?
Show answer & explanation
Correct answer: C. Use Grep to find all call sites of escalate_to_human across files, then use Read on the most relevant files to trace the flow
Grepping for escalate_to_human locates all call sites efficiently; then Reading the relevant files traces the execution flow — this is the incremental approach to building codebase understanding. 'Read entry point then Glob by name' doesn't locate all call sites efficiently. 'Bash piped to sort' is functional but bypasses the built-in Grep tool. 'Glob all Python files then Read each' is exhaustive and inefficient — Grep narrows the reading list.
3 more free questions on this subtopic in the practice stream, plus 14 in the full bank. Keep practicing →