File system tools cover the full lifecycle of working with files: reading content, creating or overwriting files, making targeted edits, searching by name, and searching by content.
| Tool | Description | Read-only |
|---|
FileReadTool | Read file contents (text, images, PDFs, notebooks). Supports line ranges. | Yes |
FileWriteTool | Create or overwrite files | No |
FileEditTool | Partial file modification via string replacement | No |
GlobTool | Find files matching glob patterns (e.g. **/*.ts) | Yes |
GrepTool | Content search using ripgrep (regex-capable) | Yes |
NotebookEditTool | Edit Jupyter notebook cells | No |
TodoWriteTool | Write to a structured todo/task file | No |
Reads file contents and returns them to the agent. Supports multiple file types:
- Text files — Source code, configuration, plain text
- Images — Rendered inline in the terminal UI
- PDFs — Extracted text content
- Notebooks — Jupyter
.ipynb files rendered as structured output
You can pass a line range to limit the output to a specific section of a large file:
FileReadTool({ path: 'src/index.ts', startLine: 10, endLine: 50 })
Use line ranges when working with large files to reduce context usage. Combine with GrepTool to find the relevant line numbers first.
Creates a new file or overwrites an existing file entirely. Use this when you need to replace a file’s full contents.
FileWriteTool overwrites existing files without diffing. For partial changes, use FileEditTool instead to avoid accidentally discarding content.
Makes targeted edits to an existing file using string replacement. The agent provides an oldString and a newString; the tool replaces the first match of oldString with newString.
This is the preferred tool for modifying existing files because:
- It operates on a diff rather than the full file
- It requires reading the file first, which reduces hallucinated changes
- It preserves all content outside the edited region
Finds files whose paths match a glob pattern. Returns a list of matching paths sorted by modification time.
GlobTool({ pattern: '**/*.ts', path: 'src/' })
Common patterns:
| Pattern | Matches |
|---|
**/*.ts | All TypeScript files in any subdirectory |
src/**/*.test.ts | All test files under src/ |
*.json | JSON files in the current directory only |
**/index.{ts,tsx} | All index.ts or index.tsx files |
Searches file contents using ripgrep. Supports full regular expressions and returns file paths with matching line numbers.
GrepTool({ pattern: 'buildTool\\(', include: '*.ts' })
Prefer GrepTool over BashTool with grep — it is faster on large codebases and the results are formatted for the agent’s context window.
Edits individual cells in a Jupyter notebook (.ipynb). Operates on cell index and cell type (code, markdown, or raw).
Writes structured todo items to the agent’s task file. Used by the agent to track multi-step work in progress. Supports statuses such as pending, in_progress, and completed.