Built-in Claude Code Tools
CoreSelect and apply built-in tools (Read, Write, Edit, Bash, Grep, Glob) effectively · Difficulty 2/5
0%
builtin-toolsgrepglobreadwriteeditbash
Claude Code provides built-in tools for file operations and codebase exploration. Selecting the right tool for each task is essential for efficiency.
Tool Selection Guide
| Task | Tool | Example |
|---|
|------|------|---------|
| Search file contents | **Grep** | Find all callers of `processPayment`, locate error messages |
|---|---|---|
| Find files by name/pattern | Glob | Find **/*.test.tsx, locate config files |
| Read entire file | Read | Load a file to understand its structure |
| Create new file | Write | Create a new component or config file |
| Targeted edit | Edit | Change a specific function using unique text matching |
| Run commands | Bash | Install dependencies, run tests, git operations |
Edit vs Read + Write
Incremental Codebase Understanding
Don't read all files upfront. Build understanding incrementally:
Tracing Function Usage Across Wrappers
When functions are re-exported through wrapper modules:
Key Takeaways
- ✓Grep searches file contents; Glob finds files by name pattern -- don't confuse them
- ✓Use Edit for targeted changes with unique anchor text; fall back to Read + Write when anchor text is not unique
- ✓Build codebase understanding incrementally with Grep then Read, not by reading everything upfront
- ✓Trace function usage across wrappers by first finding exported names, then searching for each