sage_edit_file
Perform exact string replacement in a file, returning a compact change preview and preserving pre-edit content for undo. Requires a unique match or sets replace_all to true.
Instructions
Exact string replacement in a file. Returns a compact change preview instead of the whole file, and snapshots the pre-edit content for undo. old must match exactly and be unique unless replace_all=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new | Yes | Replacement (empty deletes) | |
| old | Yes | Exact string to replace | |
| path | Yes | File to edit | |
| replace_all | No |