Skip to main content

Files and search

Core file tools (always on the default catalog):

ToolRole
builtin_read_file / builtin_read_currently_open_fileRead
builtin_create_new_file / builtin_write_file / builtin_edit_fileCreate and edit
builtin_apply_patchUnified-diff / Apply Patch hunks
builtin_view_subdirectoryList a directory (default cap 1000 files if the model omits maxFiles)
builtin_globFind paths by pattern
builtin_exact_searchExact / regex search (ripgrep-style)
builtin_view_repo_mapStructure map

Deferred: builtin_enhanced_search, builtin_view_diff, builtin_generate_tests.

apply_patch fuzz​

Hunks tolerate indent, trailing whitespace, quote/dash drift, stale context (git-style fuzz), partial first/last lines, and unified-diff --- / +++ wrappers. Add File overwrites if the path already exists (same as write).

If a patch still fails, Knox retries writes more tightly in 2.1.3+; you can also apply from chat (Alt+A / ⌥A) or Cmd+I.

Review edits​

With Review edits on, file tools stage in memory. Apply writes to disk (checkpoint first on Apply all). Shell still sees the real disk, not the staged tree.

Path policy​

Always:

  • Hard denies: ~/.ssh, ~/.gnupg, **/.ssh/** (lexical and resolved)
  • Secret files (.env*, *.pem, id_*) ask, even in Auto
  • Paths outside the workspace ask or deny (symlinks resolved)
  • Cargo registry writes denied; reads of ~/.cargo/registry/src allowed

.knoxignore affects checkpoints and some walks; it is not a substitute for Ask mode on an untrusted tree.

Next​

Tool catalog · Terminal and git · Review edits