Skip to content
Claude Certified Architect – Foundations (CCAR-F) Exam Prep

Lesson 12 of 30 · 7 min

x
12/30

Built-in Tools

Video lesson: CCAR-F 12/30: Built-in Tools

The core tools

ToolPurposeAsks permission (Manual mode)
ReadRead file contentsNo (inside working dirs)
WriteCreate or overwrite a fileYes
EditTargeted exact-string replacementYes
BashRun shell commandsYes (a built-in read-only command set runs without prompting)
GrepSearch file contents for a patternNo
GlobFind files by name patternNo
AgentSpawn a subagentNo
WebFetchFetch a URLYes
NotebookEditEdit Jupyter cellsYes

Tool names are the exact strings used in permission rules, subagent tools lists and hook matchers. Note: the tools reference lists Grep and Glob as absent by default on macOS, Linux and WSL (version-sensitive; check your build).

Edit semantics

  • Exact string replacement with old_string and new_string: no regex, no fuzzy matching.
  • old_string must match the file exactly, including whitespace and indentation.
  • old_string must appear exactly once. If it appears more than once, use a longer string with surrounding context to pin one occurrence, or set replace_all: true.
  • A file that changed after Claude last read it can still be edited if old_string matches current content exactly and unambiguously.

Design guidance for repeated Edit failures: re-read the file to get exact current text, or fall back to reading and rewriting the file with Write when edits are large.

Choosing between them (design guidance)

  • Know the name pattern: Glob. Know a string or symbol inside files: Grep.
  • Small precise change: Edit. New file or total rewrite: Write.
  • Anything needing a shell (tests, git, builds): Bash.
  • Broad exploration of a large codebase: delegate to a subagent so reads do not fill the main context.

Bash behaviour

  • A cd carries over to later Bash calls while it stays inside the project or an added working directory; subagent sessions never carry over directory changes.
  • Default timeout is two minutes, ceiling ten minutes. A foreground command that reaches its timeout is moved to the background, not killed (unless it starts with sleep).
  • Long output is saved to a file with a preview; Claude reads the file when needed.

@ references

@path includes the file's content when it fits the Read limit (25,000 tokens by default; text files over 256 KB are not included). A directory reference shows a listing, not contents. @ file references also add the CLAUDE.md of that file's directory and parents.

Exam traps

  • Using Grep to find files by name, or Glob to search inside files.
  • Edit with a non-unique old_string and expecting it to pick one.
  • Expecting regex in Edit.
  • Assuming a subagent keeps the main session's working directory change.

References

  1. Tools reference — checked Oct 16, 2026
  2. Common workflows — checked Oct 16, 2026

Check your understanding

  • Find every file named *.test.ts. Tool?Show answer

    Answer

    Glob.
  • Edit fails: "string appears more than once". Two fixes?Show answer

    Answer

    Add surrounding context to make it unique, or replace_all: true.
  • A build command exceeds its timeout. What happens?Show answer

    Answer

    It moves to the background; it is not killed.
Previous

Progress is saved in this browser.

Next Lesson