Edit¶
Performs targeted modifications to existing files using string replacement.
Runtime Comparison¶
| Aspect | Claude Code | Opencode |
|---|---|---|
| Tool name | Edit |
edit |
| Mechanism | String replacement | String replacement |
| Multi-edit | No (one replacement per call) | No (one replacement per call) |
| Pre-read requirement | Yes | Yes |
| Replace all | replace_all parameter |
No |
Edit modifies specific strings in a file without touching the rest. The old_string must be unique in the file, so include surrounding context to guarantee a match.
Opencode also provides a patch tool for multi-location edits in one operation.