How to Build an NDA Review App with Claude and SafeDocx
Steven Obiajulu
April 2, 2026 · 12 min read
The gap between "I have a process" and "I have a product" is closing fast. Legal professionals are encoding their domain expertise into AI workflows that produce real document output — not just text summaries, but actual redlined Word documents with tracked changes.
You don't need to build a custom application to do this. With Claude and SafeDocx (an open-source MCP server for Word document editing), your NDA review playbook becomes a working tool in about 15 minutes. The playbook is a markdown file — it looks like a Word document, not code.
This tutorial shows you how.
What You'll Build
Give Claude an NDA and a playbook. Get back:
- A completeness audit — which clauses are standard, which need attention, which are missing
- A redlined Word document with your proposed changes as tracked changes
The counterparty opens the document in Word and sees exactly what you'd change — accept or reject, same as any negotiation.
The complete tutorial project is available at github.com/UseJunior/nda-review-tutorial.
Prerequisites
You need two things:
1. A coding agent — this tutorial uses Claude Code, but the same approach works with any tool that supports MCP servers, including Claude Chat, Cursor, and others. (See Try Other Coding Agents below for Gemini CLI and ChatGPT Codex setup.)
2. SafeDocx MCP server — install with one command:
claude mcp add safe-docx -- npx -y @usejunior/safe-docx
MCP servers are plugins that give AI tools direct access to capabilities — in this case, reading and editing Word documents. SafeDocx works across Claude Code, Claude Chat, Gemini CLI, Cursor, Windsurf, and other MCP-compatible tools.
Optionally, add the Open Agreements MCP server if you want to compare incoming NDAs against standard templates:
claude mcp add open-agreements -- npx -y @usejunior/open-agreements
Step 1: Write Your NDA Playbook
This is the part only you can do. Claude handles the execution; you supply the judgment.
Your playbook is a markdown skill file — the same format that Anthropic's own legal plugins use. It has YAML frontmatter (a small header with metadata) and a body that reads like a checklist in Word.
Create a file called skills/nda-review/SKILL.md:
---
name: nda-review
description: |
Review an NDA against a standard playbook and produce a redlined
Word document with tracked changes. Use when given an NDA to
review, or when asked to analyze contract clauses.
---
Then write the body — your review criteria, organized by clause:
# NDA Review Playbook
You review NDAs against the criteria below. For each clause, classify
as Standard, Needs Attention, or Missing.
For clauses that need changes, use SafeDocx `replace_text` to edit
the document, then `save` with tracked changes.
## Clauses to Check
### Mutual Obligations
- Confidentiality should be mutual unless one-way disclosure is intended
- Standard: Both parties have equal obligations
- Redline if: One-sided in a mutual relationship
### Definition of Confidential Information
- Should be reasonably scoped, not overbroad
- Standard exclusions must be present:
- Public knowledge
- Prior possession
- Independent development
- Third-party receipt
- Redline if: Missing exclusions or captures "all information of any kind"
### Term and Duration
- Agreement term: 1-3 years is standard
- Survival period: 2-5 years is standard
- Redline if: Perpetual or >5 years without trade secret justification
### Standard Carveouts
- Legal compulsion (with notice where permitted)
- DTSA whistleblower immunity notice
- Redline if: Missing independent development or legal compulsion carveout
### Remedies
- Injunctive relief acknowledgment is standard
- Redline if: Liquidated damages or pre-determined penalties
### Problematic Provisions
- Flag if present: non-solicitation, non-compete, exclusivity, IP assignment
- These do not belong in an NDA
## Risk Levels
- Low: Accept standard terms as-is
- Medium: Flag for review but allow
- High: Redline or reject — propose alternative language
That's it. No JSON. No configuration files. Just a markdown document that describes your review standards, the same way you'd write them in a Word document for a junior associate.
You can customize this for your firm's positions — add clauses, change thresholds, include your preferred redline language. See the full example playbook in the tutorial repo.
Step 2: How Claude Reads the Document
When you ask Claude to review an NDA, it uses SafeDocx's read_file tool to open the Word document. The output looks something like this:
[_bk_001] MUTUAL NON-DISCLOSURE AGREEMENT
[_bk_002] This Mutual Non-Disclosure Agreement ("Agreement") is entered
into as of [DATE] by and between [PARTY A] and [PARTY B].
[_bk_003] 1. Definition of Confidential Information. "Confidential
Information" means all information disclosed by either party...
[_bk_004] 2. Obligations of Receiving Party. The Receiving Party shall
hold and maintain the Confidential Information in strict confidence...
Each paragraph has a bookmark anchor (_bk_001, _bk_002, etc.). These are stable identifiers that SafeDocx uses to target specific paragraphs when making edits. When Claude needs to change the wording of section 3, it references _bk_005 (or whichever bookmark corresponds to that paragraph) — not a line number that might shift.
Step 3: How Claude Analyzes Against Your Playbook
Claude reads the skill file and the document text together, then walks through each checklist item. For each clause, it produces an assessment:
Definition of Confidential Information: Needs Attention
The definition includes "all information, whether written, oral, or observed, relating to the business of the Disclosing Party." This is overbroad — it captures publicly available information and doesn't require any marking or identification.
Standard exclusions for public knowledge and prior possession are present, but the independent development carveout is missing. This is a significant gap that could create claims that internally-developed products were derived from the counterparty's information.
Suggested redline: Narrow the definition to information that is "marked as confidential or that a reasonable person would understand to be confidential given the nature of the information and circumstances of disclosure." Add independent development carveout.
This isn't a chatbot opinion. It's a structured walkthrough of your playbook criteria applied to the specific language in the document.
Step 4: How Claude Generates Redlines
This is the key section — the part that makes this tutorial different from every other "AI contract review" article.
Most AI review tools stop at text output. Your counterparty doesn't want a text summary — they want a marked-up Word document they can accept or reject in Microsoft Word.
Here's what happens:
1. Claude edits the document. For each clause that needs changes, Claude calls SafeDocx's replace_text tool, referencing the specific paragraph by its bookmark anchor:
replace_text:
file_path: sample-nda/mutual-nda.docx
target_paragraph_id: _bk_003
old_string: "all information, whether written, oral, or observed"
new_string: "information that is marked as confidential or that a reasonable
person would understand to be confidential given the nature of the
information and circumstances of disclosure"
instruction: "Narrow overbroad definition of confidential information"
Each replace_text call edits the in-memory copy of the document. The original file is untouched.
2. Claude saves with tracked changes. After all edits are applied, Claude calls save to produce the final output:
save:
file_path: sample-nda/mutual-nda.docx
save_to_local_path: output/clean-mutual-nda.docx
save_format: both
tracked_save_to_local_path: output/redlined-mutual-nda.docx
fail_on_rebuild_fallback: true
The save call compares the original document against the edited version and generates tracked changes markup. The result is two files:
clean-mutual-nda.docx— the document with your changes appliedredlined-mutual-nda.docx— the document with your changes shown as tracked changes
Open the redlined version in Word, and you see exactly what you'd expect: strikethrough on removed text, underlined additions, change tracking in the margin. Your counterparty can review, accept, or reject each change individually.
Try It Yourself
Clone the tutorial repo and run a review:
# 1. Install SafeDocx MCP server
claude mcp add safe-docx -- npx -y @usejunior/safe-docx
# 2. Clone the tutorial
git clone https://github.com/UseJunior/nda-review-tutorial
cd nda-review-tutorial
# 3. Run the review
claude "Review sample-nda/mutual-nda.docx and save redlines to output/"
Claude reads the skill file automatically, analyzes the NDA against your playbook, applies the redlines, and saves the tracked-change document. Open the redlined document in Word to see the result.
Customizing Your Playbook
The skill file is markdown — edit it like you'd edit a Word document.
Add a clause: Add a new ### heading under "Clauses to Check" with your criteria and redline language.
Change risk thresholds: Edit the "Risk Levels" section. If your firm accepts 5-year terms as standard, change the Term and Duration section accordingly.
Add firm-specific redline language: Under any clause, add your preferred alternative wording. Claude will use it when generating redlines.
Add more agreement types: Create additional skill files in the skills/ directory — one for MSAs, one for SaaS agreements, one for employment contracts. Each skill file is a separate playbook.
If you have an existing NDA review checklist in Word or PDF, you can ask Claude to convert it into a skill file. The format is simple enough that a single prompt gets you there.
What's Next
- More agreement types: The same pattern works for MSAs, SaaS agreements, employment contracts — any document type where you have a review checklist
- Template comparison: Add the Open Agreements MCP server to compare incoming NDAs against standard templates like the Common Paper Mutual NDA
- Batch processing: Review multiple NDAs in sequence using the same playbook
- Team deployment: Share the skill file across your team so everyone reviews against the same standards
Try Other Coding Agents
This tutorial uses Claude Code, but SafeDocx works with any MCP-compatible coding agent. Here's how to set it up with others:
Gemini CLI — SafeDocx is available in the Gemini CLI extension gallery:
gemini extensions install https://github.com/UseJunior/safe-docx
ChatGPT Codex — add SafeDocx to your Codex MCP configuration:
codex mcp add safe-docx -- npx -y @usejunior/safe-docx
Goose — add SafeDocx as an MCP server in your Goose configuration file, using the same npx command as above.
Once SafeDocx is installed in any of these agents, the same workflow applies: give it an NDA and a playbook, and it will produce redlined output.
Resources
- SafeDocx: GitHub · npm · safedocx.com
- Tutorial repo: github.com/UseJunior/nda-review-tutorial
- Anthropic legal plugins: github.com/anthropics/knowledge-work-plugins — the NDA triage skill that inspired this tutorial's format
- Open Agreements: openagreements.ai — standard contract templates for comparison
- Claude Code: docs.anthropic.com
This tutorial uses the Common Paper Mutual NDA, available under CC BY 4.0. Modifications were made for tutorial purposes.
Disclaimer: SafeDocx and this tutorial provide document editing capabilities, not legal advice. All analysis should be reviewed by qualified legal professionals before being relied upon.
Alternatives for Document Editing
Different tools are better for different jobs:
- SafeDocx — best for editing existing Word documents with high fidelity. Preserves formatting, styles, and structure. Generates tracked changes between versions. MIT licensed.
- docx by Dolan Miu — best for generating new Word documents from scratch. If you're creating contracts rather than reviewing them, this is the right tool.
- python-docx — Python library for creating and modifying Word documents. Good for generation, but does not produce tracked changes between document versions.
- mammoth.js — reads Word documents to HTML. Good for extraction, but cannot produce edited Word output.
- Superdoc — a browser-based WYSIWYG editor for Word documents. An option if you prefer editing in a browser rather than in Word, though many users still prefer the native Word experience.
- Aspose.Words — enterprise document processing. Full-featured but commercial (not open source).
About Steven Obiajulu
Steven Obiajulu
Steven Obiajulu is a former Ropes & Gray attorney with deep expertise in law and technology. Harvard Law '18 and MIT '13 graduate combining technical engineering background with legal practice to build accessible AI solutions for transactional lawyers.
UseJunior is a tool for law firms and licensed attorneys. We do not provide legal advice.