CLAUDE CODE AGENTS: FUNDAMENTALS - Chapter 10, Exercise 2 Adding a Search Breadth Signal to "Find the Caching Logic" ==================================================================================== QUESTION: A brief simply says "find the caching logic," with no stated search breadth. Explain what could go wrong in either direction (too shallow or too wide a search), and rewrite the brief to include an appropriate breadth signal. SOLUTION / EXPLANATION: WHAT GOES WRONG TOO SHALLOW: If the research agent treats this as a quick lookup and stops at the first plausible-looking match - say, a single file literally named "cache.ts" - it might miss caching logic implemented elsewhere under a different name or spread across multiple locations (an HTTP-layer cache, a database-query cache, and a client-side cache might all exist separately, none of them obviously named "cache"). The report would sound confident and complete while actually missing most of the real picture. WHAT GOES WRONG TOO WIDE: If the research agent instead treats this as requiring an exhaustive, thorough search across the entire codebase's every naming convention, and the real answer was actually sitting in one obvious, easily found location, the agent spends unnecessary effort exploring alternatives that were never genuinely in doubt - a waste of time and search effort disproportionate to how straightforward the actual question was. Since the original brief gives no signal about which situation applies, the agent has to guess, and could reasonably land on either extreme. A well-formed rewrite, assuming (for this example) genuine uncertainty about where caching might live: "Find where caching is implemented across this codebase - I'm not sure if it's centralized in one place or spread across multiple layers (HTTP responses, database queries, computed values). A thorough search across different naming conventions would be appropriate here, since I genuinely don't know where to expect it." This explicitly names the uncertainty driving the request and states the appropriate breadth (thorough), giving the agent a clear calibration signal instead of leaving it to guess. -------------------------------------------------------------------------- WHY THIS WORKS AS AN ANSWER: It explains concretely what could go wrong at each extreme (a false sense of completeness from stopping early, versus wasted effort from over-searching an easy question), and produces a rewrite that states genuine uncertainty plus an explicit breadth signal, matching this chapter's own stated guidance.