Available tools
read_file — Read file contents
read_file — Read file contents
Reads the content of a file, with optional line-range scoping. The agent uses this to understand existing code before making changes.The tool returns up to 3,000 lines per call. If the file is longer, it tells the agent the remaining line count and suggests the next range to fetch — so no content is silently truncated.Binary files are detected automatically and not shown as text.Chat badge example:
Reading src/components/Button.tsxwrite_file — Create or overwrite a file
write_file — Create or overwrite a file
Writes a new file to disk, creating any missing parent directories. By default it refuses to overwrite an existing file — it will suggest
edit_file instead — unless you explicitly ask the agent to replace the file entirely.Chat badge example: Writing src/utils/format.tsedit_file — Precise string replacement
edit_file — Precise string replacement
Replaces an exact string within a file with new content. This is safer than a full overwrite for modifying existing code: the old string must match exactly, so the agent can’t accidentally clobber unrelated sections of the file.If the target string appears more than once in the file, the edit is rejected — the agent must be more specific.Chat badge example:
Editing src/api/client.tsglob — Find files by pattern
glob — Find files by pattern
Finds files whose paths match a glob pattern. Useful for discovering all files of a given type before reading or editing them.Example patterns:Chat badge example:
Listing project rootgrep — Search file contents
grep — Search file contents
Searches file contents using a regex or literal string pattern. Uses
ripgrep when it is installed, falling back to a built-in search otherwise. Results include file paths and line numbers.You can combine grep with an optional glob to narrow the search to specific file types — for example, search for useState only in .tsx files.Chat badge example: Searching handleSubmitfind_symbol — Locate a definition by name
find_symbol — Locate a definition by name
Finds where a function, class, struct, interface, type, or constant is defined. The agent passes the exact symbol name and the tool returns matching definition lines with file paths and line numbers.This is faster than a broad grep when you know the symbol name — the search pattern targets definition keywords (
fn, function, class, def, struct, type, etc.) directly.Chat badge example: Finding AuthProviderlist_dir — Browse directory structure
list_dir — Browse directory structure
Lists the files and subdirectories at a given path, with optional depth control. Build directories and dependency caches (
node_modules, target, .vs) are automatically skipped to keep the output clean.Chat badge example: Listing src/componentsdelete_file — Remove a file
delete_file — Remove a file
Deletes a file from the project. The agent uses this to clean up generated files, remove obsolete code, or tidy up after a refactor.Chat badge example:
Deleting src/legacy/old-utils.tsrename_file — Move or rename a file
rename_file — Move or rename a file
Moves or renames a file within the project. Parent directories for the new path are created automatically if they do not exist.Chat badge example:
Renaming src/utils.tsHow the agent uses file tools
For most tasks the agent follows a consistent pattern:- Explore — calls
list_dirorglobto understand the project structure. - Read — calls
read_fileon relevant files to understand the current code. - Search — calls
greporfind_symbolto locate the exact section it needs. - Edit or write — calls
edit_filefor targeted changes orwrite_filefor new files.
edit_file over write_file for existing files because it is more precise and less likely to discard content unintentionally.
Viewing file activity in chat
Every file operation appears inline in the conversation as a collapsible badge. The badge shows a short label likeReading src/auth.ts. Click the expand arrow to see the full file path, the line range read (for read_file), or a diff of what was changed (for edit_file and write_file).
When the agent reads several files simultaneously — a common optimisation when exploring a codebase — they appear as a grouped batch badge.
