# `ExAthena.Tools.Edit`
[🔗](https://github.com/udin-io/ex_athena/blob/v0.7.1/lib/ex_athena/tools/edit.ex#L1)

Exact-string replacement in a file.

Mirrors the semantics of Claude Code's `Edit` tool:

  * `old_string` must appear in the file.
  * Unless `replace_all` is `true`, `old_string` must be unique.
  * If unique, exactly one occurrence is replaced by `new_string`.

This is intentionally strict. An agent that passes ambiguous `old_string`
should be told to add surrounding context until it's unique — never silently
replace the first match.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
