CCAR-F scenarios › Developer Productivity with Claude · Question 31 of 60

Scenario 4 · Developer Productivity with Claude

Your team is building internal developer tools on the Claude Agent SDK. The agent helps engineers find their way around unfamiliar or legacy codebases, generates boilerplate, and automates repetitive chores. It works through the built-in Read, Write, Bash, Grep, and Glob tools, plus connections to Model Context Protocol (MCP) servers.

Tool Design & MCP Integration

An engineer asks the agent, "Where is calculateLateFee called in this legacy billing monorepo?" Logs show the agent running Glob for **/*fee* and then using Read on all 40 matching files in full, consuming most of its context before it answers. Several real callers live in files whose names have nothing to do with fees, so they were never found. What change to the agent's tool usage best fixes this?

Show answer and explanation

Answer: B — Run Grep over file contents for calculateLateFee across the repository, then Read only the files that contain matches to examine each call site in context.

Finding callers is a content search, which is what Grep is for; Glob matches file paths, so it cannot find callers in files whose names don't mention fees. Building understanding incrementally (Grep to locate, then Read the hits) avoids reading files upfront that turn out to be irrelevant. (a) still matches on names and makes the read-everything problem worse. (c) still guesses from names, just directory names this time. (d) is the read-everything-upfront anti-pattern, and on a monorepo it would use up the context window.