stetdoc is how AI agents work in Word. Every change your agent makes lands in Word as a tracked change with its name on it, and everything it didn't touch comes back exactly as it was.
SuggestedOther ways to install
$ brew install clauseo-ai/ tap/ stetdocFree and open source, MIT or Apache-2.0.
Clause 11. Payment
11.1 Payment for each Shipment of Products shall be due within deleted: thirty (30inserted: forty-five (45) days from the date of the Bill of Lading for the relevant Shipment (the “Due Date”). The amount payable shall be determined in accordance with the pricing provisions of Clause 5.
ClaudeDeleted: thirty (3031 Oct 2026, 08:24
11.2 Payment for each Shipment shall be made by the Buyer by means of an irrevocable documentary letter of credit, confirmed by a first-class international bank acceptable to the Seller.
$ stetdoc replace msa.docx 'due within thirty (30) days' 'due within forty-five (45) days'replace "due within thirty (30) days" with "due within forty-five (45) days": once, at p145 (clause 11.1)applied 1 operation, tracked as Claude 2026-10-31T08:24:25Zvalidated 1 unit: no problems, and this file needs no separate check.wrote msa.edited.docxmsa.docx is unchanged.Word found unreadable content.
Every agent that edits a .docx's XML meets this dialog sooner or later. Word splits a sentence across many runs and stores tracked changes as XML structure. It refuses a file whose elements fall out of schema order. One slip in the XML and the document won't open.
stetdoc checks every edit against the schema and Word's own rules before it writes a byte. A batch of edits applies completely or not at all.
Microsoft Word
Word found unreadable content in contract.docx. Do you want to recover the contents of this document?
validated 1 unit: no problems, and this file needs no separate check.
- 0 of 118 stetdoc runs that wrote a file Word offered to repair.
- 6 of 6 long Harvey LAB markups, fully correct on every model.
- 1 ms from launch to a ready MCP server.
Open, save, same bytes.
Run a document through stetdoc without editing it and you get the identical file back, byte for byte. Edit one clause and only that clause's elements change. Styles, numbering, comments, other people's tracked changes and macros stay where their authors left them.
We test this every night on about 48,000 documents from 77 public sources. Every build also puts 306 more through 50 random edit batches each.
10.2 The Buyer shall, at its own cost and expense, maintain adequate insurance coverage for the Products from the point at which risk passes under Clause 10.1 through to the point of final delivery to the Buyer’s storage facilities or end customers.
CLAUSE 11 — PAYMENT
11.1 Payment for each Shipment of Products shall be due within deleted: thirty (30inserted: forty-five (45) days from the date of the Bill of Lading for the relevant Shipment (the “Due Date”). The amount payable shall be determined in accordance with the pricing provisions of Clause 5.
11.2 Payment for each Shipment shall be made by the Buyer by means of an irrevocable documentary letter of credit, confirmed by a first-class international bank acceptable to the Seller.
11.3 The Buyer shall procure the issuance of the Letter of Credit not less than ten (10) Business Days prior to the first day of the loading window specified in the accepted Purchase Order for the relevant Shipment.
$ stetdoc unpack contract.docx && stetdoc pack contract.stet -o roundtrip.docx$ cmp contract.docx roundtrip.docx && echo identicalidentical
It knows where 11.1 is.
Lawyers cite clauses by number. Word works those numbers out when it draws the page, so they appear nowhere in the file. stetdoc computes them, and a search hands your agent the clause, a stable paragraph ref and the exact text.
$ stetdoc view msa.docx --find 'thirty' --find 'governing law'p145 §11.1 …each Shipment of Products shall be due within thirty (30) days from the date of the Bill of Lading…p182 §14.3 …Party may terminate this Agreement by giving thirty (30) days' written notice to the other Party.…p211 §16.4(c) …22 (Dispute Resolution), Clause 23 (Governing Law), Clause 24 (Entire Agreement), and Clause…p272 CLAUSE 23 — GOVERNING LAW16 matches in 15 blocksTwelve matches is not one.
replace matches text the way it reads, across bold, italics and run breaks. When the text appears more than once, stetdoc writes nothing and lists every match with its clause. Missing text gets the same refusal. stetdoc also refuses an edit aimed at a paragraph that changed after the agent read it, so a change never lands in the wrong place.
$ stetdoc replace msa.docx 'thirty (30) days' 'forty-five (45) days'error[ambiguous_match]: "thirty (30) days" is in the document 12 times, and it must be there once:p81 (clause 3.3) …d to the Seller not less than [thirty (30) days] prior to the first day of the…p126 (clause 7.5(a)) …cement to be completed within [thirty (30) days] of the date on which the non-…p145 (clause 11.1) … Products shall be due within [thirty (30) days] from the date of the Bill of …p182 (clause 14.3) …nate this Agreement by giving [thirty (30) days]' written notice to the other ……next: Nothing was applied, so retry at once: to change every one, pass --all; to pick one place, pass --range with its ref, such as --range p81..p81, or make OLD longer so it matches once.
Hands off the XML.
stetdoc gives your agent the document as text, with a ref on every paragraph and a number on every clause. The zip and its XML stay with stetdoc. In Claude Code, the plugin adds a hook that stops Claude from unzipping a .docx, scripting it with python-docx or rewriting its XML. The only way into the file is the one stetdoc checks.
$ unzip -o msa.docx -d msastetdoc's guard blocked this: it opens a Word package with an archive tool. A Word file (.docx) is edited only through stetdoc, which records every change as a Word tracked change and leaves the rest of the file untouched. … Do not try another way around this.
One install for every agent you run.
stetdoc init puts its skill in Claude Code, Codex, Cursor, OpenCode, Copilot, Amp, Antigravity, Factory, Grok Build, Hermes, OpenClaw and cmx2. Agents that take tools instead of a shell get the same commands over MCP from stetdoc mcp. If you're building a product, the engine is also a Rust crate, stetdoc-core, and stetdoc mcp can serve it to cloud apps you host.
For agents
stetdoc is an open-source CLI, MCP server and Rust library that lets AI agents read and edit Word .docx files, with every edit recorded as a Word tracked change.
Install stetdoc and connect it to this agent. Run these yourself.1. brew install clauseo-ai/tap/stetdocWithout Homebrew, pick another channel at https://stetdoc.clauseo.chat/#install2. stetdoc --versionShow all five steps
3. stetdoc initThis puts the stetdoc skill in every agent it finds.4. To use stetdoc over MCP as well, register it with your agent:Claude Code: claude mcp add --scope user stetdoc -- stetdoc mcpCodex: codex mcp add stetdoc -- stetdoc mcpCursor: add {"mcpServers":{"stetdoc":{"command":"stetdoc","args":["mcp"]}}} to ~/.cursor/mcp.jsonAny other agent: stetdoc init --mcp prints the line for it5. Read https://stetdoc.clauseo.chat/docs/agents.md before you edit a document.Stet is the proofreader's mark for "let it stand". It goes under a word that was struck out by mistake, and the word stays.