K2.5.1 Task 2.5

Each Built-in Tool Has One Job

Claude Code’s built-in tools have distinct, non-overlapping responsibilities. Grep searches content. Glob searches paths. Read loads files. Edit makes targeted changes. Write creates or overwrites files. Bash executes commands. Knowing which tool does what prevents the most common misuse.

The tool map

NeedToolNOT this tool
Find function calls across codebaseGrepNot Glob (paths only)
Find files by name patternGlobNot Grep (content only)
Load a specific fileReadNot Bash with cat
Targeted text replacementEditNot Write (overwrites entire file)
Create new fileWriteNot Edit (needs existing file)
Run tests, install packagesBashNot after trying built-in tools first

The Grep/Glob confusion

This is the single most tested distinction. Grep = file contents (what’s inside). Glob = file paths (what files exist). “Find all files calling processPayment” → Grep. “Find all .test.tsx files” → Glob.

The standard exploration workflow

  1. Grep for key patterns (entry points, function names, imports) to find relevant files
  2. Read specific files identified by Grep to understand the code
  3. Glob to find related files by naming pattern when needed

This is more efficient than reading every file — Grep narrows the field before Read loads specific content.

Bash as escape hatch

Bash handles everything the specialized tools can’t: running tests, git operations, package management, build commands. But prefer specialized tools when they fit — Grep over bash grep, Read over bash cat, Glob over bash find. Specialized tools provide better integration and context management.


One-liner: Grep searches contents, Glob searches paths, Read loads files, Edit targets replacements, Write creates/overwrites, Bash is the escape hatch — the Grep/Glob confusion is the most common misuse.