Question 1 · choose 1
Your developer productivity agent is configured with the Read, Write, Edit, Bash, Grep and Glob tools. An engineer asks it to find every place in a large TypeScript repository that calls the function parseInvoiceLine. Which tool should the agent start with?
- AGlob, with a pattern such as **/*parseInvoiceLine* to match the relevant files
- BBash, running ls -R to list the repository tree and pick likely files to open
- CGrep, searching the contents of the repository's files for the function name
- DRead, opening every file under src to look for the calls one file at a time
Show the answer and why
AGlob, with a pattern such as **/*parseInvoiceLine* to match the relevant files
Incorrect
Glob matches file paths, not file contents; callers live in files with unrelated names.
BBash, running ls -R to list the repository tree and pick likely files to open
Incorrect
A directory listing shows names only and still leaves the agent guessing which files contain calls.
CGrep, searching the contents of the repository's files for the function name
Correct
Grep searches inside files for patterns such as function names, which is exactly what finding callers needs.
DRead, opening every file under src to look for the calls one file at a time
Incorrect
Reading everything up front is slow and fills the context with irrelevant code.
Use Grep for content searches such as callers, error messages and imports, then Read only the files the search turns up.
Anthropic documentation