Friday, August 21, 2026

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

    Domain 2 — Tool Design & MCP Integration · 18% of the exam

    Task statement 2.5

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

    What you should be able to do
    • Pick Grep for content search and Glob for path patterns, and say why the other one fails.
    • Use Read and Write for whole-file work and Edit for targeted change on unique anchor text.
    • Fall back to Read plus Write when Edit cannot find a unique match.
    • Build codebase understanding incrementally — find entry points, then follow imports — rather than reading everything up front.
    Exam traps (5)

    Use Glob to find where a function is called.

    Glob matches paths, not contents, so it returns files whose names happen to resemble the symbol and misses every real caller.

    Grep searches inside files; Glob searches the names of files.

    Read the whole directory up front so the agent has full context.

    It spends the context window on files that turn out to be irrelevant, and the relevant ones end up buried in the middle of it.

    Grep to the entry points, Read to follow the imports that matter, and let the trace decide what to load.

    Keep retrying Edit until the anchor finally matches.

    A non-unique anchor fails deterministically — Edit reports it rather than editing the wrong site — so the retries never converge and the modification never lands.

    When Edit cannot find a unique anchor, Read the file and Write it back. That is the objective's named fallback.

    Use Write for a small change because it is the most direct tool.

    Write replaces the file, so anything the agent did not reproduce in its output is gone — and nothing reports the loss.

    Edit for targeted change; Write when you intend to author the whole file.

    Search for the function name once to find every usage.

    Re-exports and wrapper modules rename it on the way through, so call sites that use the alias never appear.

    Identify the exported names first, then search for each one across the codebase.

    Where the guide and the current docs differ (1)

    recovering from a non-unique Edit anchor

    Answer this: When Edit cannot find a unique anchor, fall back to Read plus Write.

    The docs now say: The documented remedy is to extend old_string with enough surrounding context to pin one occurrence, or to set replace_all — and Edit is preferred over Write for partial changes. Edit fails loudly on a non-unique anchor rather than editing the wrong site. Read it

    Primary sources
    Know cold
    • Tool
    • Explore subagent
    • Context window
    • Lost in the middle

    6 practice questions in the bank are tagged to this task statement.

    Practise this task in context: open it inside the interactive study guide, which carries the concept cards, the mock quiz and the practice simulation.

    Blueprint-aligned independent practice. Koko's scenarios and company facts are fictional and synthetic. This aid does not reproduce official exam questions or Anthropic's undisclosed scoring model, and is not affiliated with or endorsed by Anthropic.