CCA Prep

Lesson 2.5Lesson 12 of 30

Built-in tools (Read, Write, Edit, Bash, Grep, Glob)

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

Built-in tools (Read, Write, Edit, Bash, Grep, Glob)Glob: findfiles by name**/*.test.tsxGrep: findusages incontentcallers, errortextRead: followimportsEdit: uniqueanchornot unique → Read+ WriteIncremental: entry points first, not the whole codebase upfront

Key points

  1. 1Grep searches file contents (callers, error messages). Glob matches file paths by pattern (**/*.test.tsx).
  2. 2Edit changes a file by matching a unique piece of text. Read and Write work with whole files.
  3. 3If Edit fails because the anchor text is not unique, fall back to Read + Write of the file.
  4. 4Build understanding step by step: Grep for the entry points, Read to follow imports. Don't read the whole codebase upfront.
  5. 5Behind a wrapper module, list what it exports, then Grep for each exported name.
What the exam guide checks here

Objective wording from the exam guide (English).

  • 2.5.K1Grep searches file contents
  • 2.5.K2Glob matches file paths by pattern
  • 2.5.K3Read/Write for whole files; Edit for targeted changes via unique text match
  • 2.5.K4When Edit fails on non-unique match, fall back to Read + Write
  • 2.5.S1Use Grep to find callers or error messages across the codebase
  • 2.5.S2Use Glob for naming patterns (**/*.test.tsx)
  • 2.5.S3Read then Write when Edit has no unique anchor
  • 2.5.S4Build understanding incrementally: Grep entry points, Read to follow imports, not read everything upfront
  • 2.5.S5Trace usage through wrapper modules: list exported names, then search each

Lock it in

Answer scenario questions on this topic. Every option comes with an explanation.

Practise 2.5 · 23 questions