Docs

Built-in tools›Files and search

Edit file

edit
Group
Files and search
Turned on by
Its own switch on the Tools page of Conversation settings.
Approval
Reviewed: writes and open-ended actions ask for approval unless the security level or an earlier “Always allow” covers them.
Profile key
tool.edit.description

Replaces one exact passage in an existing file with new text and leaves the rest of the file untouched.

The passage must occur exactly once, or the call fails. edit never creates a file; that is write's job.

Limits

The file must be UTF-8 text of at most 2 MiB, before and after the edit.

Good to know

  • If the passage does not match as written, edit tries again ignoring Windows line endings (CRLF) and a byte-order mark, and keeps the file's own line endings.
  • The model must have read or written the file in this conversation; reads from before Mework restarted still count. If the file has changed on disk since, even while Mework was closed, the edit still applies, and the model is told the file holds changes it has not seen.
  • In Plan mode, files in a Git repository that Git does not ignore are refused. Paths outside the repository or ignored by Git can still be edited.

Parameters

ParameterTypeDetails
find required
Find text
stringExact text to replace; must match exactly once.
path required
Path
stringExisting file to modify, relative to the workspace.
replace required
Replacement
stringReplacement text; an empty string deletes the passage.

Edit this page on GitHub