How to Build a Harness

10. The `write` Tool

Let Claude create new files.

Creates new files or overwrites existing ones.

File: packages/coding-agent/src/core/tools/write.ts

const writeSchema = Type.Object({
  path: Type.String({ description: "Path to the file to write (relative or absolute)" }),
  content: Type.String({ description: "Content to write to the file" }),
});

The Amp blog combines write into edit_file (empty old_str = create file). pi separates them for clarity.


Open this chapter inside the full course