Skip to content
CCAR-F Prep

Task Statement 2.5·Domain 2 — 18% of exam

Built-in Tools

Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively

Jump to practice →

Official Exam Guide Objectives

The objectives below are quoted from Anthropic's Claude Certified Architect – Foundations exam guide, v1.1. Read the exam guide summary for the full blueprint.

Task 2.5: Select and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively.

Knowledge of

  • Grep for content search (searching file contents for patterns like function names, error messages, or import statements)
  • Glob for file path pattern matching (finding files by name or extension patterns)
  • Read/Write for full file operations; Edit for targeted modifications using unique text matching
  • When Edit fails due to non-unique text matches, using Read + Write as a fallback for reliable file modifications

Skills in

  • Selecting Grep for searching code content across a codebase (e.g., finding all callers of a function, locating error messages)
  • Selecting Glob for finding files matching naming patterns (e.g., **/*.test.tsx)
  • Using Read to load full file contents followed by Write when Edit cannot find unique anchor text
  • Building codebase understanding incrementally: starting with Grep to find entry points, then using Read to follow imports and trace flows, rather than reading all files upfront
  • Tracing function usage across wrapper modules by first identifying all exported names, then searching for each name across the codebase

What You Need to Know

Six built-in tools cover working with a codebase: Read, Write, Edit, Bash, Grep, and Glob. Each is built for a particular job, and reaching for the wrong one costs time, context, or both. Exam items are constructed around exactly those confusions.

One rule sorts most of them: search by what is inside a file with Grep; search by what a file is called with Glob.

The Six Tools at a Glance

ToolJobRight whenWrong when
GrepContent search across files, by patternFinding callers, error strings, imports, TODOs, config keysYou already know the path (just Read it)
GlobPath and name pattern matchingListing files by naming convention; discovering what lives under a directoryYou need to match what files contain
ReadLoad a file's contentsYou know which file and need its full contextScanning hundreds of files "to be safe", or guessing at a path you have not established (Grep or Glob first)
WriteCreate a file, or replace one in fullNew files; rewriting after Read when Edit cannot anchorA small change with a unique anchor (use Edit)
EditTargeted replacement through a unique text matchA precise change whose anchor text appears exactly onceThe anchor is repeated and nothing nearby makes it unique
BashRun commandsTests, builds, git, package managersSearching or reading files, which the dedicated tools exist for

Grep vs Glob: The Core Distinction

No other distinction takes up as many of this task statement's bullets. Get it wrong and you'll lose marks.

Grep searches file CONTENTS for patterns. Reach for it whenever the question is about what is written inside files — who calls a function, where an error string is raised, which modules import something, where a variable is assigned.

// Every call site of processLegacyOrder()
Grep: "processLegacyOrder"

// Anywhere a timeout is reported to the user
Grep: "timeout"

// Whoever imports the auth helpers
Grep: "import.*from 'utils/auth'"

Glob matches file PATHS by naming patterns. Reach for it whenever the question is about which files exist — tests, configuration, everything of one extension beneath a directory.

// Every test file, wherever it sits
Glob: "**/*.test.tsx"

// Config, whatever extension it uses
Glob: "**/config.*"

// The MDX under the domains tree
Glob: "content/domains/**/*.mdx"

The distinction in one sentence: Grep finds what is INSIDE files. Glob finds files by their NAMES.

Items are built on the substitution. Sent after function callers, Glob returns nothing useful, because a path never contains a call. Sent after test files, Grep can stumble into a partial answer by matching the word in content — which is worse than failing outright, since a partial answer looks like a working one.

Grep reads inside files; Glob matches their names Asked for every caller of processLegacyOrder, Glob returns nothing, because a file path never contains a function call — that question belongs to Grep, which finds every call site. Asked for every test file, Grep can stumble onto a partial, misleading match by finding the word "test" somewhere in content, which is worse than failing outright because it looks like a working answer. Glob, matching paths directly against **/*.test.tsx, finds every test file cleanly. Grep finds what is inside files; Glob finds files by their names. find every caller of processLegacyOrder() Glob("processLegacyOrder") → nothing — a path never contains a call Grep("processLegacyOrder") → finds every call site find every test file Grep("test") → a partial match — looks like it worked Glob("**/*.test.tsx") → matches every test file, cleanly Grep reads inside files; Glob matches their names
1 / 6Swipe diagram ↔

Grep reads inside files; Glob matches their names, step 1: Find every caller of processLegacyOrder()

Read, Write, and Edit

Three tools for touching files, each suited to a different situation.

Edit changes one thing, located by matching text you supply exactly. It is quick and it is precise, because nothing outside the matched region is loaded or rewritten.

Edit:
  old_string: "function processOrder(id: string)"
  new_string: "function processOrder(id: string, validate = true)"

When Edit fails: the match has to be unique. Where the text you gave appears more than once, Edit stops rather than guessing which occurrence you meant. That refusal is the feature — a guess would silently modify code you never looked at.

Uniqueness is judged inside the one file Edit was pointed at; the same line appearing in a dozen other files does not matter. And the refusal is deterministic: sending the identical Edit again, or splitting the work into several Edits that carry the same anchor, meets the same refusal every time. Something about the request has to change.

When Edit can't find a unique anchor. The exam guide names one recovery: Read + Write. Load the full file with Read, then Write it back with the change made, "as a fallback for reliable file modifications". It is reliable because it does not depend on anchor uniqueness at all. Its cost is that the whole file passes through context twice, which is tolerable for a 300-line module and expensive for a 4,000-line one.

The current Edit tool docs describe two cheaper moves that stay on Edit: widen old_string with more surrounding context until it pins down one location, or set replace_all: true if every occurrence genuinely should change. Widening is how unique anchor text gets found, so the two sources fit together as one ordering:

  1. Try Edit with the shortest anchor that's plausibly unique.
  2. If the match is not unique, extend old_string with surrounding lines until exactly one place matches — or set replace_all: true where every occurrence really should change.
  3. When no unique anchor can be found, Read the file and Write it back: the guide's named fallback.
// Attempt 1: refused, because old_string matches three places in this file
Edit:
  old_string: "await processLegacyOrder(orderId)"

// Attempt 2: the enclosing signature makes the anchor unique
Edit:
  old_string: "async function handleRefund(orderId: string) {\n  const result = await processLegacyOrder(orderId)"
  new_string: "async function handleRefund(orderId: string) {\n  const result = await processOrder(orderId, { validate: true })"
SituationUse
One occurrence, clear anchorEdit
Several occurrences, but surrounding context tells them apartEdit with a widened anchor
Every occurrence in the file should changeEdit with replace_all: true
The anchor cannot be made unique, or the change spans much of the fileRead + Write
The same mechanical change across many filesBash (sed) or a script, with the diff reviewed afterwards. This row goes beyond the guide, which stops at Read + Write

Two habits waste context here, and they are different mistakes. Reaching for Read + Write as the standard way to modify a file spends a whole file on every edit. Reaching for it when two more words of anchor would have settled the match spends a whole file on one line. Neither makes Read + Write a wrong answer in itself: it is the fallback the guide names, and the one that always works.

Two words of anchor away — not a reason to escalate Edit tries the shortest plausibly unique anchor first. Where the match is not unique, the documented recovery is to widen old_string with more surrounding context, or set replace_all true where every occurrence should change — both stay on Edit and cost almost nothing. Only once neither of those can single out the target does Read and Write become the right tool, loading and rewriting the whole file. Jumping straight from a non-unique match to Read and Write skips a recovery that was two words of anchor away. Defaulting to Read and Write for every edit, never trying Edit at all, wastes context on every single change. Edit — shortest anchor non-unique match widen old_string or replace_all: true still not unique (rare) Read + Write — last resort ✕ too early start with Edit — escalate only when nothing else works defaulting to Read + Write for every edit wastes context too
1 / 6Swipe diagram ↔

Two words of anchor away — not a reason to escalate, step 1: Edit — try the shortest plausibly unique anchor

Bash and the Dedicated Tools

Bash can run cat, grep, find and sed, so it can imitate every other tool on the list. The task statement is about selecting tools, and its bullets assign content search to Grep and path matching to Glob, so a shell pipeline is not the answer to a search question.

TaskPreferNot
Find files by nameGlobfind
Search contentsGrepgrep or rg in the shell
Read a fileReadcat
Write a fileWrite> redirection
Run tests, a build, git, a package managerBash—

The reasoning behind the preference, as study guidance rather than a documented rule: a dedicated tool takes the same structured input wherever it runs and hands back results in a known shape, while a shell pipeline brings quoting to get right, output to parse, and commands such as grep -r, find and sed -i whose behaviour differs between Linux, macOS, Git Bash and PowerShell. A custom wrapper around find and grep fails for a second reason: it duplicates two built-ins the agent already has.

Incremental Codebase Understanding

The order you explore in matters as much as the tools you explore with, and there is a wrong order.

Wrong: Read all files upfront. Loading everything before you know what is relevant is the single most expensive mistake available. Read a 200-file codebase in full and the context window is gone, spent overwhelmingly on files with no bearing on the task.

It fails for two independent reasons. The first is exhaustion: the window fills before the work starts, and Task 5.4 describes what follows, with answers drifting towards "typical patterns" instead of the specific classes found earlier. The second is attention dilution, the guide's term from Task 1.6: even where everything fits, the few relevant files are buried among hundreds that are not. A larger window addresses only the first.

Right: Incremental discovery. Start narrow. Expand only as needed.

  1. Grep to find entry points. Search the name or message that anchors the investigation: the domain noun, the error text, the route path. The result tells you which files are worth opening.

  2. Read to follow imports and trace flows. With the relevant files identified, read them to understand structure, and follow their imports outward to whatever else is implicated.

  3. Grep again to trace usage. A wrapper or re-export found along the way becomes a new search term, revealing consumers the first search could not have matched.

  4. Read only what you need. Every file opened should be justified by something the previous step turned up.

  5. Record what you find. On a long investigation, keep key findings in a scratchpad file so they survive a context boundary. That is a Task 5.4 skill, but it is the natural last step of this loop.

The result is understanding built at the cost of the files that mattered, rather than the cost of the repository, and an answer that can cite specific files and lines.

Understanding built at the cost of what mattered Reading every file before knowing what is relevant is the most expensive mistake available — a 200-file codebase read in full spends the context window overwhelmingly on files with no bearing on the task. Incremental discovery starts narrow: Grep to find entry points, Read to trace flows, Grep again for wrapper or barrel names surfaced along the way, and Read only what each previous step justified. The context spent is proportional to what actually mattered, not to the size of the repository. Read everything first 200 files, in full ✕ gone before work begins Incremental discovery 1 · Grep — entry points 2 · Read — trace flows 3 · Grep — wrapper names 4 · Read — only if justified ✓ spent only on what mattered understanding built at the cost of what mattered, not the whole repo
1 / 6Swipe diagram ↔

Understanding built at the cost of what mattered, step 1: Read every file before knowing what's relevant

Tracing Function Usage Across Wrapper Modules

A common codebase pattern defeats a single search: a function defined in one module, re-exported through a wrapper, and called everywhere under the wrapper's name. Grep for the original and every one of those consumers is invisible. The stem usually reports it as an undercount: "the audit found only 3 of the 40 call sites".

// src/payments/index.ts, the wrapper (a "barrel" file)
export { processRefund as refund } from './refund';   // alias: a second name
export * from './refund';                              // star re-export: a second import path

// src/services/billing.ts
import { refund } from '../payments';                  // never writes "processRefund"

// src/services/support.ts
import * as payments from '../payments';               // namespace import
payments.refund(order.id, order.total);                // a third spelling

A search for processRefund finds the definition and the barrel, and neither consumer. Three mechanisms hide them: an alias (export { x as y }) gives the function another name, a star re-export (export * from) makes the wrapper module another place to import it from, and a namespace import (import * as ns) turns a call into ns.name.

The correct approach:

  1. Grep for the function definition — locate the module that declares it
  2. Read the defining file — note every name under which it leaves that module
  3. Grep for each exported name — one search per alias, since each has its own consumers
  4. Where a barrel file such as index.ts re-exports it, Grep for the barrel's module name as well, to catch imports written against the barrel rather than the source

In search terms that is two phases. Phase one collects names: Grep the export statements, for example export .*processRefund for direct and aliased exports and export \* from './refund' for star re-exports. Phase two runs one Grep per name collected (processRefund, refund, payments\.refund), filtering a short common name such as refund by where it is imported from, and setting aside the export lines themselves, which are declarations and not call sites.

The rule to carry into the exam: enumerate the exported names before you search for usage. Grepping only the original name finds the subset of callers that never went through a wrapper. Each pass supplies the search terms for the next, which is how indirect consumers surface at all.

The Deprecation Scenario

A scenario worth rehearsing, because it needs both search tools in the right order: find every file that calls a deprecated function AND the test files that exercise it. The correct sequence:

  1. Grep for the function name — finds every file whose contents reference the function, including any tests that import it directly (content search)
  2. Glob for sibling test files — finds the test file that pairs with each caller by naming convention, e.g. OrderProcessor.ts → OrderProcessor.test.tsx, even when the test exercises the function indirectly through the source module (path matching)
  3. Grep again for wrapper names — when a caller exposes the function through a wrapper (e.g. applyLegacyOrder calls processLegacyOrder internally), Grep for the wrapper name to find tests that cover the function transitively through it

Concretely: the first pass shows OrderProcessor.ts and RefundHandler.ts among the callers. Globbing **/OrderProcessor.test.* and **/RefundHandler.test.* then brings in their paired tests, which matter even though they may never write processLegacyOrder anywhere. And where one of those files re-exposes the function under another name, a third pass on that name finds the tests reaching it indirectly.

Grep, then Glob, then Grep — contents for the direct references, paths for the tests sitting alongside them, contents again for the coverage that arrives through a wrapper. Beginning with Glob inverts it and finds only the tests whose names you could already guess.

Contents, then paths, then contents again Finding every caller of a deprecated function and the tests that exercise it takes three passes. Grep for the function name finds every file whose contents reference it, including OrderProcessor.ts and RefundHandler.ts. Glob for their paired test files, matching the naming convention, brings in tests that exercise the function indirectly through the source module. Grep again for a wrapper name such as applyLegacyOrder finds tests that reach the function transitively through it. Contents, then paths, then contents again — each pass supplies the search terms for the next. 1 · Grep — content search "processLegacyOrder" → OrderProcessor.ts, RefundHandler.ts 2 · Glob — path matching **/OrderProcessor.test.* → their paired test files 3 · Grep — wrapper name "applyLegacyOrder" → tests reaching it indirectly contents, then paths, then contents again each pass supplies the search terms for the next
1 / 6Swipe diagram ↔

Contents, then paths, then contents again, step 1: Grep for processLegacyOrder — the content search

Deep Dive

The built-in roster is bigger than the six this lesson names

This task statement names six built-ins (Read, Write, Edit, Bash, Grep, Glob), but the documented roster is larger. The Agent SDK overview lists built-in tools as covering "Read, write, edit files, run commands, and search the web", and the SDK hooks page, describing hook matchers, names them explicitly: "Built-in tools include Bash, Read, Write, Edit, Glob, Grep, WebFetch, Agent, and others." WebFetch fetches external content; Agent spawns subagents (see below). In the SDK, the tools option controls which built-ins are actually available to a given agent: tools: ["Read", "Grep"] keeps only the listed built-ins in context (MCP tools are unaffected), while tools: [] strips every built-in so the agent can only call your MCP tools. That's the mechanism behind "scope an agent's tools to its role" when the tools in question are built-ins rather than MCP tools.

Sourcescode.claude.com › overviewcode.claude.com › hookscode.claude.com › custom-toolsfetched 2026-11-19

Edit, Write and Read: what the tools reference specifies

Edit "performs exact string replacement" and "doesn't use regex or fuzzy matching". Three checks must pass before an edit applies:

CheckRuleWhat failure looks like
Read-before-editClaude reads the file in the current conversation before editing it. Older models always require this; newer models can skip it when the read would need no permission promptThe edit is refused until the file has been read
Match"old_string must appear in the file exactly as written. A single character of whitespace or indentation difference is enough to miss."Zero matches: fix the anchor text. Widening it does not help
Uniqueness"old_string must appear exactly once."More than one match: "Claude either supplies a longer string with enough surrounding context to pin down one occurrence, or sets replace_all: true to replace them all."

Zero matches and several matches are different failures with different fixes, and an item can hinge on which one the stem reports.

Write "creates a new file or overwrites an existing one with the full content provided. It doesn't append or merge." Overwriting an existing file is subject to the same read-first condition as Edit, which is why the fallback is written as Read then Write. The docs also state the default direction: "For partial changes to an existing file, Claude uses Edit instead of Write."

Read "takes a file path and returns the contents with line numbers". It reads files, not directories; to list a directory's contents Claude uses a shell command such as ls.

Sourcecode.claude.com › tools-referencefetched 2026-11-19

Grep and Glob: documented behaviour and default availability

GrepGlob
Finds"lines inside" files"files by name pattern"
Pattern languageripgrep regular expressions, "not POSIX grep"; metacharacters need escaping (interface\{\})glob syntax, with ** for recursive matching (src/**/*.ts)
ReturnsFile paths only by default (files_with_matches); content mode adds matching lines with line numbers; count gives matches per filePaths "sorted by modification time and capped at 100 files", with a truncation flag when the cap is hit
NarrowingA glob parameter (such as **/*.tsx) or a type parameter (such as py) limits which files are searchedA more specific pattern
.gitignoreRespected: ignored files are skippedNot respected by default

Two consequences for exploration. A content search limited to one kind of file ("which test files mention refund?") is still a Grep, narrowed by its glob parameter; the path pattern there is a filter, not a second tool. And a Glob broad enough to return hundreds of paths is truncated at the cap, one more reason a blanket **/* followed by reading everything is the wrong opening move.

Default availability changed after the exam guide was written. "On macOS, Linux, and WSL, Claude Code leaves Glob and Grep out of the default tool set, and Claude searches with find and grep through the Bash tool instead." Those searches "reach your hooks and permission rules as Bash calls". On Windows both tools are part of the default set. On the other platforms they return when:

  • Glob or Grep is named in --tools or --allowedTools at session start, or in the equivalent Agent SDK options ("naming either tool in --allowedTools restores both"; an allow rule in a settings file does not have this effect);
  • Bash is removed from the session by a deny rule, --disallowedTools or --restricted;
  • a subagent lists Glob or Grep in its tools field and leaves out Bash.

The tool choice the exam tests is unchanged by this: contents are Grep's question and paths are Glob's.

Sourcescode.claude.com › tools-referencecode.claude.com › cli-referencefetched 2026-11-19

Agent — the built-in for spawning subagents (formerly named Task)

Practically: "Claude invokes subagents through the Agent tool", and the SDK examples list Agent in allowedTools beside the file tools. If a coordinator's tool-use log shows Task where you expected Agent (or the reverse), that is a version artefact, not a different tool; the docs advise matching both names when detecting a subagent call.

Sourcescode.claude.com › subagentscode.claude.com › sub-agentscode.claude.com › permissionsfetched 2026-11-19

Permission-rule syntax scopes what a built-in can actually do

--allowedTools lists tools (using permission-rule syntax) that run without a prompt; to restrict which tools are available at all use --tools instead — allow-listing and availability-restriction are different mechanisms. In --disallowedTools, a bare tool name removes the tool from Claude's context entirely ("Edit" removes Edit outright, "*" removes every tool), while a scoped rule such as Bash(rm *) leaves the tool available but denies only matching calls. Bash rules support prefix matching, and the trailing space matters: Bash(git diff *) allows any command starting with git diff, but without the space, Bash(git diff*) would also wrongly match git diff-index. WebFetch uses its own rule shape — a domain: prefix matched against the hostname: WebFetch(domain:example.com) matches that host; WebFetch(domain:*.example.com) matches any subdomain at any depth but not the apex domain itself. One caveat follows from the default tool set above: on macOS, Linux and WSL the --tools default leaves out Glob and Grep, so list them by name if the agent should have them.

--allowedTools "Bash(git diff *),Read,Edit"
--disallowedTools "Bash(rm *)"        # Bash stays available; rm is denied
--disallowedTools "Edit"              # Edit removed from context entirely

Sourcescode.claude.com › cli-referencecode.claude.com › headlesscode.claude.com › permissionsfetched 2026-11-19

Built-ins and MCP tools share a permission surface but a different naming convention

Built-in tools are referenced by their bare name (Read, Grep, Bash(...)) in permission rules. MCP tools instead use the namespaced pattern mcp__<server-name>__<tool-name> — for example a list_issues tool on a server named github becomes mcp__github__list_issues. Permission rules can target a whole server (mcp__puppeteer, matching any of its tools), every tool on a server via wildcard (mcp__puppeteer__*), or one specific tool (mcp__puppeteer__puppeteer_navigate). This naming convention is how you tell, in a permission prompt or a tool-use log, whether a given call is a built-in or an MCP-provided tool — directly relevant when deciding (per Task 2.4) whether the agent should prefer a built-in like Grep or a better-described MCP alternative.

Sourcescode.claude.com › permissionscode.claude.com › mcpfetched 2026-11-19

Quick Reference

FactValue
GrepSearches file contents — function callers, error messages, imports
GlobMatches file paths by naming pattern — **/*.test.tsx, **/config.*
EditTargeted modification via unique old_string match; fails on non-unique text
Edit non-unique fix (current docs)Widen old_string with more context, or set replace_all: true
Read + WriteThe exam guide's named fallback when Edit cannot find unique anchor text; costs the whole file twice
Edit zero matchesDifferent failure: old_string must match exactly, whitespace included; fix the text
Retrying a refused Edit unchangedFails identically; the ambiguity is deterministic
BashTests, builds, git, package managers; not the choice for searching or reading files
Grep detailsripgrep regex; file paths only by default; glob and type parameters narrow the files searched; respects .gitignore
Glob details** recurses; results capped at 100 files, sorted by modification time; ignores .gitignore by default
Glob and Grep by default (current docs)Absent on macOS, Linux and WSL, where Claude searches with find and grep through Bash; named in --tools or --allowedTools to restore. Exam answer unchanged
Alias enumerationCollect every exported name (export { x as y }, export * from, import * as ns) first, then Grep for each
Documented built-in rosterBash, Read, Write, Edit, Glob, Grep, WebFetch, Agent, "and others"
SDK tools optiontools: [...] keeps only listed built-ins; tools: [] removes all built-ins (MCP tools unaffected)
Agent toolSpawns subagents; renamed from Task in Claude Code v2.1.63 — the exam guide says "Task" and requires it in allowedTools
--allowedTools vs --tools--allowedTools skips the permission prompt; --tools restricts availability
--disallowedTools bare nameRemoves the tool from context entirely (e.g. "Edit", or "*" for all)
--disallowedTools scoped rulee.g. Bash(rm *) — tool stays available, only matching calls denied
Bash prefix matchingBash(git diff *) (trailing space) matches any git diff… command; without the space it would also match git diff-index
WebFetch domain ruleWebFetch(domain:example.com); domain:*.example.com matches subdomains, not the apex
MCP tool namingmcp__<server-name>__<tool-name>, e.g. mcp__github__list_issues
MCP permission rule scopingmcp__server (whole server) · mcp__server__* (wildcard) · mcp__server__tool (one tool)
Incremental exploration orderGrep for entry points → Read to trace flows → Grep again for wrapper/barrel names → Read only what's justified → record findings in a scratchpad
Why read-everything failsContext exhaustion, and attention dilution across irrelevant files

Exam Traps

More wrong answers, and why each fails

Tempting answerWhy it failsChoose instead
Retry the same Edit, or split it into one Edit per occurrence with the same anchorThe ambiguity is in the anchor text and is deterministic; every attempt meets the same refusalChange the anchor, or fall back to Read + Write
Set replace_all: true to get past the refusal, then restore the occurrences that should not have changedMakes changes nobody intended and depends on a second edit to undo themA wider anchor for the one target; replace_all only when every occurrence should change
Bash sed at a line number for a single targeted changeGives up Edit's unique-match check, so a stale line number silently rewrites the wrong codeEdit
Glob the source tree first, then Read the files in path orderPath order says nothing about relevance; it is read-everything with a tidier startGrep for the entry point, then Read what it implicates
Read a file at a path you have guessedThe path has not been established, so the read is a guessGrep or Glob to establish the path first
A larger context window, so every file fitsPostpones exhaustion and does nothing about attention dilutionIncremental discovery

How This Is Tested

Items come from the Developer Productivity scenario above all: an agent exploring an unfamiliar codebase with the built-in tools.

Stem signalAnswerThe wrong answer beside it
"Find all callers of calculateShipping", "where is this error raised", "every file importing axios"Grep: calls, messages and import statements are file contentGlob on a name pattern; reading the tree
"Find every test file", "all files matching **/*.test.tsx", "what lives under src/api/"Glob: the question is about pathsGrep for a word such as test or describe(
"Edit failed: the text is not unique. What now?"Read + Write as the fallback (the guide's wording); a wider anchor where the options offer one and the stem shows it existsRetrying unchanged; sed; making Read + Write the default for every change
"How should the agent approach an unfamiliar 200,000-line codebase?"Grep for entry points, Read selectively, follow importsRead everything first; a bigger context window; batching the same full read
"The audit found 3 of 40 call sites", "the build broke in files the search never showed"Enumerate exported and aliased names first, then search for eachBlaming a result cap or the regex; searching the original name again
"Find the callers of a deprecated function and the tests that cover them"Grep, then Glob for sibling tests, then Grep for wrapper namesGlob first; one content search for everything

Practice Scenario

Support engineers ask the agent which modules raise the "refund window expired" message, so the wording can be updated before a policy change ships. The agent runs Glob with the pattern **/refund and reports three files, none of which contain that string — while the two modules that do raise it are named policy.ts and messages.ts. What's the most effective first step?

Practice Questions

Exam simulator

Question 1 of 13

Scenario · Multi-Agent Research System

Your document-analysis subagent must review every quarterly report from 2024 in a folder of 900 converted reports named like reports/2024-Q3-acme.md. It currently runs Grep for "2024" across the folder, which matches hundreds of older reports that merely mention the year, and it then reads most of them. Which approach should you take?

Sources