Skip to content
BENIBIX Learn

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

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.

json
{
  "permissions": {
    "allow": ["Edit(./src/**)"],
    "deny": ["Edit(./dist/**)", "Read(./.env)"]
  }
}
Edits inside src run without asking. The built folder and the secrets file stay off limits.
Each file tool does one job, and only the ones that change files ask first.

Worked example

Lucy's edit misses by one space

Lucy watches an Edit fail on a config file. The old text Claude sent had 4 spaces, and the file had a tab.

Claude reads the file again, copies the line exactly, and the second Edit works. Nothing was changed by the failed try.

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.