Files, Search, and Memory
These tools read, write, and search files, and they store memory notes.
Use Read before Edit, because Edit replaces an exact string in a file.
For example, Grep with output_mode set to files_with_matches lists only the files that match.
Tools explains the Yes and No columns.
You can also read or edit files yourself and let Claude see the result. Deny the tool name in permissions.deny, or leave it out of a subagent tools list, to turn a tool off. The memory tools need a server-side flag.
Tools
Source: Tools Reference, Configure Permissions, and the program (the tool input schemas).
| Tool | Status | What It Does | How It Works | Available In | Read-Only | Parallel | Deferred |
|---|---|---|---|---|---|---|---|
Read | Documented: An official docs page names this item. | Reads files, images, PDFs, and notebooks. | See Read Parameters. | Main session and subagents. Kept in background subagents. | ✅ | ✅ | ❌ |
Write | Documented: An official docs page names this item. | Creates or overwrites a file. | file_ (string, required, absolute), content (string, required), machine (optional). A deny rule wins. | Main session and subagents. Kept in background subagents. | ❌ | ❌ | ❌ |
Edit | Documented: An official docs page names this item. | Replaces an exact string in a file. | file_ (required), old_ (required), new_ (required, must differ), replace_ (boolean, default false), machine (optional). | Main session and subagents. Kept in background subagents. | ❌ | ❌ | ❌ |
Notebook | Documented: An official docs page names this item. | Edits a cell of a Jupyter notebook. | See NotebookEdit Parameters. | Main session and subagents. Kept in background subagents. | ❌ | ❌ | ✅ |
Glob | Documented: An official docs page names this item. | Finds files by glob pattern. | pattern (string, required), path (string, optional, directory), machine (optional). | Main session and subagents. The docs say a subagent can get Glob and Grep when the main session lacks them (macOS, Linux, WSL). | ✅ | ✅ | ❌ |
Grep | Documented: An official docs page names this item. | Searches file contents with ripgrep. | See Grep Parameters. | Same as Glob. | ✅ | ✅ | ❌ |
LSP | Documented: An official docs page names this item. | Code intelligence: definitions, references, symbols, hover, call hierarchy. | operation, file (required), line (int, 1 or more, required), character (int, 1 or more, required), query (optional, workspace only). | Main session and subagents. Background subagents keep it since 2.. | ✅ | ✅ | ✅ |
memory_ | Undocumented: Only the program shows this item. It can change without notice. Gated: Works only behind a flag or a server gate. hidden server-side flag | Reads a document from a memory store. | store (string, required), path (string, required). | Only when auto memory is on (auto, no CLAUDE_) and the memory mode is tools. The mode is tools when the server flag tengu_ is on (default off) or organization memory is not closed. Organization memory needs the server flag tengu_, no CLAUDE_ or CLAUDE_, and the allow_ policy. The mode stays files in cloud sessions that set CLAUDE_, and when you set CLAUDE_. | ✅ | ✅ | ❌ |
memory_ | Undocumented: Only the program shows this item. It can change without notice. Gated: Works only behind a flag or a server gate. hidden server-side flag | Saves a document to a memory store. | store, path, content (all strings, required), if_ (string, max 64, version token for compare-and-set). content replaces the whole document. | Only when auto memory is on (auto, no CLAUDE_) and the memory mode is tools. The mode is tools when the server flag tengu_ is on (default off) or organization memory is not closed. Organization memory needs the server flag tengu_, no CLAUDE_ or CLAUDE_, and the allow_ policy. The mode stays files in cloud sessions that set CLAUDE_, and when you set CLAUDE_. | ❌ | ❌ | ❌ |
memory_ | Undocumented: Only the program shows this item. It can change without notice. Gated: Works only behind a flag or a server gate. hidden server-side flag | Lists memory stores and their documents. | store (optional), path_ (optional, directory-aligned), cursor (optional). | Only when auto memory is on (auto, no CLAUDE_) and the memory mode is tools. The mode is tools when the server flag tengu_ is on (default off) or organization memory is not closed. Organization memory needs the server flag tengu_, no CLAUDE_ or CLAUDE_, and the allow_ policy. The mode stays files in cloud sessions that set CLAUDE_, and when you set CLAUDE_. | ✅ | ✅ | ❌ |
Read Parameters
| Parameter | What It Does | Required |
|---|---|---|
file_ | Absolute path of the file. | ✅ |
offset | Line to start from, 0 or more. | ❌ |
limit | Number of lines to read, more than 0. | ❌ |
pages | PDF page range such as 1-, at most 20 pages at a time. | ❌ |
allow_ | Reads a file or range over the usual size limits, as far as the context allows. | ❌ |
machine | Name of an attached machine. Offered only when machines are attached. | ❌ |
NotebookEdit Parameters
| Parameter | What It Does | Required |
|---|---|---|
notebook_ | Absolute path of the . file. | ✅ |
new_ | The new source of the cell. | ✅ |
cell_ | Cell to edit. For insert, the new cell goes after it. | ❌ |
cell_ | code or markdown. Required for insert. | ❌ |
edit_ | replace (default), insert, or delete. | ❌ |
Grep Parameters
| Parameter | What It Does | Required |
|---|---|---|
pattern | The regular expression to search for. | ✅ |
path | File or directory to search. | ❌ |
glob | Glob filter such as **/. | ❌ |
output_ | content, files_ (default), or count. | ❌ |
- | Lines before each match. Needs content mode. | ❌ |
- | Lines after each match. Needs content mode. | ❌ |
- | Alias for context. | ❌ |
context | Lines before and after each match. Needs content mode. | ❌ |
- | Shows line numbers. Needs content mode, default true. | ❌ |
- | Case-insensitive search. | ❌ |
- | Prints only the matched parts. Needs content mode. | ❌ |
type | File type such as js, py, or rust. | ❌ |
head_ | Limits the first N entries. Default 250, 0 for no limit. | ❌ |
offset | Skips the first N entries before head_. | ❌ |
multiline | Lets . match newlines and patterns span lines. | ❌ |
machine | Name of an attached machine. Offered only when machines are attached. | ❌ |
Example
Block reads of secret files and all edits to lock files.
{
"permissions": {
"deny": ["Read(./.env)", "Read(./secrets/**)", "Edit(./package-lock.json)"]
}
}
How It Works
machineis an extra optional field that Claude Code adds to a tool schema when an attached-machines feature is on.- File tools check permissions with the rule syntax in Permission Rules.
Read,Glob,Grep,Write, andEditcarryremoteExecutionmetadata in the program. It marks them as runnable on a remote host.Readhas no result size cap. So useoffsetandlimitfor large files.
Write on a File That Claude Read Only in Part
Since 2.1.312, Write refuses to overwrite some very large instruction files.
The files are a CLAUDE.md file, a rules file, or an @-included file that Claude Code loads for a subdirectory.
| Item | Status | What it does | Notes |
|---|---|---|---|
| Size test | Gated: Works only behind a flag or a server gate. Server flag tengu_quizzical_mango, on by default | Claude Code cuts a loaded file when its text is longer than a limit. It adds the line Only the start of this file is shown. and marks the file as read in part. | The limit is the larger of 40,000 characters and 5% of the model context window, scaled by the bytes per token of the model. A managed file is never cut. |
Write refusal | Undocumented: Only the program shows this item. It can change without notice. | While the mark holds, Write on the file fails with error code 19. | The message says that Claude has only the start of the file. A Write could lose the rest. It tells Claude to use Edit to change part of it. To replace the file, Claude must first Read it in one call with no offset or limit. |
| Clear the mark | Undocumented: Only the program shows this item. It can change without notice. | A Read of the whole file removes the refusal. | The program tests that the stored view holds the whole file and began at line 1. |
Source: the program (chunk-r5cyd28m.js lines 164229 to 164274, 73050 to 73054, 9596 to 9609, and 77622; chunk-s2tghjwy.js line 4530; chunk-b09ckz08.js line 8515).
Errors
Each row is a family of messages. The backticked text is the start that every message in the family shares. A row marked Various gathers the messages of one feature that do not share one start.
| Start of Message | Status | What It Means | Cases |
|---|---|---|---|
| Various | Undocumented: Only the program shows this item. It can change without notice. | File tools. Read, Edit, Write, or Notebook refused a call. | A Read deny rule covers the file. Claude has not read it yet. It changed since Claude last read it. It is too large. It is a pipe or device. It is a symbolic link. It is not a valid image, PDF page, or notebook. The edit does not match (string not found, no change). A write failed after the file was truncated. |