Hashline Edit
hleditEdit files safely using hash-anchored line references. Anchors from reads detect stale context before any write, enabling reliable single or batch changes.
Instructions
Read, edit, or batch-edit files using hash-anchored line references (LN#HASH). Use op:'read' to get anchors, op:'edit' for single changes, op:'batch' for multiple edits in one call. Anchors come from the most recent read and detect stale context before any write.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | Operation: 'read', 'edit', or 'batch' | |
| grep | No | Filter lines by substring (read) | |
| path | Yes | File path | |
| after | No | For action:'insert', insert after anchor | |
| edits | No | JSON array of batch edit ops (op: read/edit/batch) | |
| limit | No | Max lines to return (read) | |
| action | No | Edit action: replace, insert, delete, or replace-range. Defaults to replace unless end_anchor or after imply otherwise. | |
| anchor | No | LN#HASH anchor, e.g. 12#NK | |
| offset | No | 1-indexed starting line (read) | |
| content | No | Replacement or inserted content; empty = delete | |
| end_anchor | No | End anchor for replace-range/delete range |