Claude Code File Tools
Level 4 · The tools it uses
The Claude Code tools that read, write, edit and find files. Which ones ask first, how Edit matches text, and why Glob and Grep may be missing.
Course contentsLesson 9 of 16
Level 1 · Starting out
Level 2 · Asking before it acts
Level 3 · Telling it how you work
Level 4 · The tools it uses
Level 5 · Growing past one chat
After this lesson you can
- Name the file tools and what each does
- Say which tools ask before they run
- Write a tool name in a permission rule
10 mincovers 8 glossary entries
Worth reading first: Claude Code Models and Effort
Which tools touch your files
A built-in tool is one action Claude Code gives Claude, such as Read, Edit or Bash. Claude picks the tool for each step. You only name tools when you write rules for them. Read opens a file and returns up to 25,000 tokens per call, so Claude reads a long file in pages. Read never asks first.
Write makes a new file, or replaces a whole file with new text. Edit changes one part of a file. It takes a piece of old text and the new text to put in its place. The old text must match the file exactly, down to the spaces, and it must appear only once. Both tools ask before they run.
That exact match is what keeps Edit safe. It never guesses which line you meant. If the old text shows up twice, Claude must add more of the lines around it, or ask to replace every copy. NotebookEdit does the same job for a Jupyter notebook, one cell at a time.
Glob finds files by name, with a pattern such as **/*.ts for every TypeScript file. It returns up to 100 files, newest first. Grep searches inside files for text, and it is built on a fast search program called ripgrep. Neither one asks first.
On macOS, Linux and WSL, Claude Code leaves Glob and Grep out by default. Claude runs find and grep through Bash instead, which does the same work. On Windows both tools are on. So do not be surprised when your session shows no Glob calls at all.
The LSP tool lets Claude use a language server, the same helper your code editor uses. After each edit it reports type errors and warnings, so Claude can fix them without a full build. It can also jump to where a function is made. It stays off until you add a code intelligence plugin for your language.
A tool's name is also how you write rules for it. The same form, a name with an optional pattern in brackets, works in permission rules, in the --allowedTools flag and in a helper's tool list. Edit(./src/**) means edits inside src. Read(./.env) means reading that one file.
{
"permissions": {
"allow": ["Edit(./src/**)"],
"deny": ["Edit(./dist/**)", "Read(./.env)"]
}
}Worked example
The words for this lesson8
Check yourself
Why can the Edit tool not change the wrong line by mistake?
Finished this lesson?
Marking it complete also marks its 8 glossary entries learned, which updates your roadmap and your saved page. 0 are already marked.