# agent: Add \`write_file\` tool \(\#55865\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/70ee54da8fc7710316bb1ff7589dfc141e510f37)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 70ee54da8fc7710316bb1ff7589dfc141e510f37

Requested commit: 70ee54da8fc7710316bb1ff7589dfc141e510f37

Commit: 70ee54da8fc7710316bb1ff7589dfc141e510f37

Tree: 82d7ce9fb64ce5d9758fac84cc128bb89b10fcb7

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Add `write_file` tool (#55865)

Splits the edit tool into two separate tools `write_file` (previously
`mode = write`), and `edit_file` (previously `mode = edit`).
This makes the JSON schema for the `edit_tool` much simpler. We've seen
models (especially older ones) struggle with providing `mode = edit +
edits` and `mode = write + content` fields. This seems to improve eval
scores for Sonnet 4.6 slightly.

Also added two unit evals to ensure that the model uses the tool to
create new/override existing files

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
```

## Parents

- [cd2053e583893366013812b9e600dbe89670cd77](https://git.cafe/gitcafe/zed/commit/cd2053e583893366013812b9e600dbe89670cd77?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/70ee54da8fc7710316bb1ff7589dfc141e510f37?format=markdown)
