edit-docx

edit-docx is a command for Claude Code from eigenweltlabs/legalwork. It costs 19 tokens per session (408 once invoked), scanned A, original, MIT.

A command for editing Word documents with reviewable comments and tracked changes. Tracked changes are suggested insertions, deletions, or replacements that someone can accept or reject.

In plain words
What is it for?
It is for redlining clauses, adding margin comments, and applying proposed changes either to a document open in Word or to a local .docx file.
Why use it?
It lets users request contract edits while preserving a review trail and leaving the original document available for comparison.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions subagents.

Good fit It is for redlining clauses, adding margin comments, and applying proposed changes either to a document open in Word or to a local .docx file.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eigenweltlabs/legalwork/edit-docx
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/eigenweltlabs/legalwork

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for edit-docx

README.md
[![agentmods](https://agentmods.dev/badge/commands/eigenweltlabs/legalwork/edit-docx.svg)](https://agentmods.dev/commands/eigenweltlabs/legalwork/edit-docx)
Your own site
<a href="https://agentmods.dev/commands/eigenweltlabs/legalwork/edit-docx"><img src="https://agentmods.dev/badge/commands/eigenweltlabs/legalwork/edit-docx.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 408 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.00408
Opus 5 $0.00010 $0.00204
Sonnet 5 $0.00004 $0.00082
Haiku 4.5 $0.00002 $0.00041

Measured yesterday against content hash 1f2d6c0c0456, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

edit-docx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

apps/server/resources/core-opencode/commands/edit-docx.md · 33 lines

What it actually says

Edit a Word document with AI — write back comments and tracked-change redlines the lawyer reviews and accepts where they are working: directly in Microsoft Word when this session runs inside the Word add-in, or in the in-app viewer otherwise (the firm's open-model version of "ask the assistant to redline this contract").

Load and follow the docx-edit skill — start with its Step 0 to pick the backend. First try the document open in LegalWork's in-app editor and use inapp_docx_* tools; otherwise try the Microsoft Word add-in and use word_* tools. Only when neither live surface has the target document should you use the file pipeline. Then carry out this request:

$ARGUMENTS

Reminders from the skill (FILE backend):

  • inspect the .docx first to get the stable paragraph map; anchor every edit to a 0-based paragraphIndex.
  • For a full redline pass, fan out the docx-redliner subagent (Task tool); for a small targeted change, build the plan yourself.
  • comments are margin notes (the why); proposals are tracked-change edits. Every search string must be verbatim from the paragraph.
  • apply writes a non-destructive <base>.redlined.docx by default — open it in the viewer to see the redlines inline. Use --in-place only if asked.
  • Report any ops that didn't match verbatim instead of dropping them; never fabricate parties, numbers, or terms.

If no document is named in the arguments, use the active in-app document or the document open in Microsoft Word. Ask which .docx to edit only if neither is open.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed 1f2d6c0c0456
  2. 8d ago First seen · 33 lines · 19 tokens per session scan A 64f595039193

Subscribe to this mod's changes

edit-docx is a command published in the GitHub repository eigenweltlabs/legalwork (100 stars, last pushed yesterday), licensed MIT. It adds 19 tokens to every session and 408 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.