Claude Code’s built-in tools each do one thing. The most common mistake is confusing which tool handles which dimension of the codebase. Get this right and you’ll understand the standard exploration workflow.
The core trio: Grep, Glob, Read
Grep — searches file contents by pattern. “Which files contain processPayment()?” That’s Grep. It takes a regular expression, scans across files, and returns matching lines and file paths. This is your tool for finding where functions are called, where variables are used, where patterns appear in code.
Glob — searches file paths by pattern. “Where are all the test files?” That’s Glob. It takes a glob pattern like **/*.test.tsx and returns matching file paths. It tells you what files exist and where they are — it never looks inside them.
Read — loads a specific file’s content. Once you know which file you need (from Grep or Glob), Read shows you what’s inside. It takes an exact file path, not patterns. It doesn’t search or match — it just loads.
The workflow: Grep to find where something lives → Read to examine it in detail. Or Glob to find files by naming pattern → Read to look inside them.
The modification pair: Edit and Write
Edit — precise text replacement within an existing file. You specify the exact text to find and what to replace it with. The target text must be unique within the file — if it appears multiple times, Edit fails (you’d need more surrounding context to make the match unique).
Write — creates a new file or completely overwrites an existing file. It replaces everything. Using Write for a small change in a large file is wasteful — Edit exists for targeted modifications.
These two are not interchangeable. Edit is surgical (find-and-replace on a unique match). Write is wholesale (entire file content). The right tool depends on whether you’re making a targeted change or creating something from scratch.
Bash: the escape hatch
Bash — executes shell commands. This is for things the specialized tools can’t do: running tests, installing packages, git operations, build commands, system administration. You should prefer the specialized tools when they fit — Grep over grep, Glob over find, Read over cat, Edit over sed. Bash is the fallback, not the default.
The Grep/Glob confusion
This is the most tested distinction. Remember: Grep = content (what’s inside files), Glob = paths (what files exist). If someone says “use Glob to search for text patterns inside files,” that’s wrong. If someone says “use Grep to find files matching a name pattern,” that’s also wrong. Each tool has a single, clear responsibility.
One-liner: Grep searches file contents, Glob searches file paths, Read loads specific files, Edit makes targeted replacements, Write creates/overwrites whole files — prefer specialized tools over Bash.