> ## Documentation Index
> Fetch the complete documentation index at: https://codexceed.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# avatar.tools.edit

Editing tools: str\_replace + write\_file + delete\_file (§10, tier 1, ADR-0015).

The mutating tools. `str_replace` makes a targeted, string-anchored edit to an existing
file — `old_string` → `new_string`, no line numbers, no diff; a miss comes back as a
model-correctable `ToolResult`, never an exception thrown at the loop (§10). `write_file`
(ADR-0003 B) is the plain-content transport for creation and explicit whole-file rewrites,
and `delete_file` removes one. Modification is anchored on the exact existing text (the
read-before-edit staleness proof), which replaced the line-numbered unified diff models
could not produce reliably (ADR-0015).

## Classes

### `DeleteFileInput`

Input for `delete_file`: remove one existing workspace file (ADR-0015).

```python theme={null}
DeleteFileInput(*, path: str) -> None
```

**Fields**

| Field  | Type  | Required |
| ------ | ----- | -------- |
| `path` | `str` | yes      |

### `StrReplaceInput`

Input for `str_replace`: an exact-text find/replace in one existing file (ADR-0015).

```python theme={null}
StrReplaceInput(*, path: str, old_string: str, new_string: str, replace_all: bool = False) -> None
```

**Fields**

| Field         | Type   | Required |
| ------------- | ------ | -------- |
| `path`        | `str`  | yes      |
| `old_string`  | `str`  | yes      |
| `new_string`  | `str`  | yes      |
| `replace_all` | `bool` | no       |

### `WriteFileInput`

Input for `write_file`: create a file with full content (overwrite only if explicit).

```python theme={null}
WriteFileInput(*, path: str, content: str, overwrite: bool = False) -> None
```

**Fields**

| Field       | Type   | Required |
| ----------- | ------ | -------- |
| `path`      | `str`  | yes      |
| `content`   | `str`  | yes      |
| `overwrite` | `bool` | no       |
