Change several files in one commit
batch_writeApply multi-file edits as one named commit, validating every quote anchor and version before writing so failed entries leave all files unchanged.
Instructions
Apply one multi-file change as ONE named commit (author Claude). Each entry carries full content (new files) or quote-anchored edits (existing files, same rules as edit_file). All edits resolve before anything is written — a stale_anchor or ambiguous_anchor writes nothing (the error names the entry as path); fix that entry and resend the whole batch. A version_conflict on any entry also writes nothing: re-read that file and resend. Use it for a coherent change across files; use edit_file for a single file. message = the intent, imperative ("Add related-work section"). The result's commit and head are that commit; a batch that leaves every file as it was makes no commit and answers commit:null with unchanged:true (nothing is pending).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | ||
| branch | No | Branch name (defaults to 'main'). Every result, error results included, echoes {branch, head} — head is the branch's current commit (after a write, the commit that write made). Pass the branch explicitly whenever you are not on main. | |
| message | Yes | Commit message stating the intent of the change, at most 200 characters. | |
| project | No | Project id. Optional when the access token is scoped to exactly one project. |