Claude Code ships with a small toolbox — Read, Write, Edit, Bash, Grep, Glob — and the exam loves the Grep-vs-Glob distinction because it's the one everyone fumbles. One searches file contents; the other searches file names. Pick the wrong one and the agent wastes turns and tokens hunting in the dark.
Below is a tiny codebase. Type a query and run it as a Glob (matches the file path) and as a Grep (matches text inside files). Watch how the same string finds completely different things:
Try: auth, *.test.js, password, TODO
| Tool | Use it to… | Don't use it to… |
|---|---|---|
| Glob | find files by name/path pattern (**/*.test.ts). | search what's in the files. |
| Grep | search file contents for a string/regex (function login). | find files whose name matches — that's slower & noisier. |
| Read | open a specific file you already located. | "explore" — locate first with Glob/Grep, then Read precisely. |
| Edit | change exact text in a file you've Read. | create brand-new files (use Write). |
| Write | create a new file or fully replace one. | make a small change (use Edit — Write overwrites). |
| Bash | run commands, tests, git, builds. | search/read files — the dedicated tools are faster & safer than cat/find. |
login() is defined" → that's
Grep (content), not Glob. "Find all the test files" → that's Glob (names). And using Bash
with grep/find/cat when the dedicated tools exist is the wrong answer —
the built-ins are faster, safer, and don't dump huge output into the context window.find/grep/cat — the dedicated tools keep context lean.Curated companion: Claude Code docs — built-in tools.