Built-in Tools

Estimated time: 3 minutes

Selection is by what you're looking for, not habit:

  • Grep — search file contents (function callers, error messages, import statements).
  • Glob — match file paths (**/*.test.tsx, by extension or naming convention).
  • Read/Write — full-file operations.
  • Edit — targeted modification via unique text matching.
  • Bash — shell execution.

Grep versus Glob comparison chart: Grep searches file contents, Glob matches file paths

The discriminator: content vs. path. Grep for what's in files; Glob for what files are called. Conflating the two — Globbing for content, or Grepping to enumerate a naming pattern — is a basic but real trap.

When Edit fails because its target text isn't unique in the file, the fallback is Read + Write (rewrite the section with full context), not repeated Edit attempts with progressively longer anchor strings — that approach burns turns without addressing why the match was ambiguous in the first place.

Build codebase understanding incrementally: Grep to find entry points, then Read to follow imports and trace flows from there. Reading every file upfront exhausts context before any actual analysis has started, and it doesn't scale to any codebase of meaningful size.

Tracing a function's usage across wrapper modules is a specific, testable case of this: if the function is re-exported under different names in one or more wrapper modules, a single grep on the original name will only find direct callers and will silently miss everything routed through a re-export. The correct approach identifies all the exported names first — across the wrapper modules — and then searches for each of those names in turn.