commit_write
Apply staged file writes to disk atomically after reviewing the diff, with safety checks against files changed since staging. Batch multiple writes into a single approval prompt.
Instructions
Apply a staged write to disk (atomic: tmp+rename). Call only AFTER reviewing the diff with get_diff. Refuses if the file changed since it was staged — pass force=true to overwrite anyway. Only works when write_mode is 'write' — do NOT call it in 'propose' mode (it refuses and the permission prompt would just show an opaque op_id). path and summary are REQUIRED because the user's approval prompt only shows tool args — make them say exactly what is being written. Pass ops: [{op_id, path, summary}] instead to commit a batch in ONE approval — use it for map_files stage_writes output so the user sees the whole set at once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | No | Batch commit: [{op_id, path, summary}] — one approval prompt shows the whole set | |
| path | No | REQUIRED for single-op: the file this op writes — verified against the staged op so the approval prompt can't lie about the target. | |
| force | No | Commit even if the file changed since staging | |
| op_id | No | ||
| summary | No | REQUIRED for single-op: one-line description of the change — the main thing the user sees when approving. |