Skip to main content

Module file_tools

Module file_tools 

Source

Functions§

delete_file
edit_file
edit_file_multi
Apply multiple (old_string → new_string) replacements to a file in one call. All replacements are validated before any are applied: if any old_string is not found, the entire operation fails with an index hint.
explain_code
Analyze the code structure at root and return a structured summary that the LLM can use to explain the codebase to the user.
find_closest_match_hint
Given a file’s content and a failed old_string, return a human-readable hint pointing at the closest matching block — helps the LLM fix whitespace or indentation mismatches without re-reading the entire file.
list_dir
load_files
Load all files matching a glob pattern (e.g. src/**/*.rs), returning their contents concatenated with path headers. Caps at 100 files and 500 KB total to keep context manageable.
read_file
read_file_outline
Return a structural outline of a file — function/class/struct signatures with line numbers, without the bodies. Ideal for surveying a large file before deciding which section to read in full.
read_file_ranged
Read a file with optional pagination.
write_file