File tools

Agents read and write inside the workspace root via built-in file tools.

Core tools

Tool Purpose
read_file Read text or Office/PDF (size-limited)
write_file Create or overwrite
edit_file Targeted search/replace
batch_edit Multi-file edits (v0.8.0+)
apply_patch Unified diff patch
refactor_imports Import cleanup helpers (Code)
list_dir List a directory
file_info Metadata (size, mtime)

Search & discovery

Tool Code Office
glob_files
file_search ✅ (can merge symbol-index hits)
grep_files ✅ (ripgrep)

Composite tools (v0.8.6+, Code):

Tool Purpose
explore_codebase Chains glob → grep → read
edit_and_check Edit then scoped tests (edit → run_tests)

You can still hand-roll glob_filesgrep_filesread_file. Long tasks: LHT.

Office uses only glob_files / file_search — no grep_files, no shell grep.

Assert tools (Harness)

Tool Purpose
assert_file_count Assert file counts by glob
assert_output_matches Assert command output
assert_tests_pass Assert tests pass

Same predicate library as Gate-as-Code.

Safety

UI

Changes show in Diff and File preview.

Related: Git tools · Office I/O · Gate-as-Code