An agent in Claude Code runs "grep -r" and "find" through Bash for every search, and each call triggers a permission prompt. Which built-in tools fit better?
- Exam domain
- Tool Design & MCP Integration18% of the exam
- Difficulty
- Easy
- In this mock
- 10 questions on this domainPractise this domain
Why the exam asks this
Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively
Objective in the exam guide: Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively
Built-in tool choice is a named task statement.
Why D is the answer
Grep for searching file contents and Glob for finding files by pattern
Grep searches file contents and Glob finds files by pattern; they are purpose-built and suit search better than general shell commands.
How it works
Grep searches for patterns in file contents.
Glob finds files by name pattern.
Edit makes targeted edits; Read opens files.
Clues in the question
The words that point to the answer, and what each one tells you.
- Searching through Bash
- Use the dedicated search tools.
In detail
- Read opens specific files once they are found.
- Edit makes targeted changes; Write creates or replaces files.
Side by side with look-alikes
| Tool | Purpose |
|---|---|
| Grep | Search contents |
| Glob | Find files |
| Read | Open a file |
| Edit | Targeted change |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Write, to save search results to a file firstWrong
Writing results adds a step and changes files.
B. Edit, to change files until the pattern is foundWrong
Editing to search is backwards.
C. Bash with more piped commandsWrongMost tempting
More pipes keep the same problems.
Why it tempts: Bash can search. But dedicated tools are clearer and easier to permit.
D. Grep for searching file contents and Glob for finding files by patternRight
Grep searches file contents and Glob finds files by pattern; they are purpose-built and suit search better than general shell commands.
In practice
- Give read-only agents Read, Grep and Glob only.