Show HN: Docx-CLI: agents read/edit Word docs using 1/2 the time and tokens
TL;DR Highlight
Markdown-style CLI for Word edits ran 27% faster than Anthropic's docx skill at equal accuracy.
Who Should Read
Developers automating Word document edits like contracts and invoices with agents who are struggling with token cost and speed.
Core Mechanics
- Word editing reduced to Markdown commands
- docx-cli standardizes most operations as creating, updating, deleting or replacing Markdown.
- Anthropic's official skill makes the agent unpack and manage OOXML (Word's internal XML) itself.
- Same accuracy, faster in the benchmark
- On six tasks with Haiku 5.5, it used 27% less time, 22% fewer input tokens and 41% fewer output tokens than Anthropic's docx skill.
- It solved all six tasks with 98 tool calls versus 124 for the skill.
- About 2x faster than OfficeCLI at half the tokens
- OfficeCLI solved 4.7 of 6 on average and missed four runs.
- The misses were the résumé every time and one invoice, and the résumé date-wrap trap is one docx-cli specifically repairs, per the README.
- Savings are biggest on editing existing files
- On the five editing tasks it used about 30% fewer input tokens and 35% less time than Anthropic's skill.
- Finalizing a redline took 94k tokens and 86 s versus 179k and 159 s for the skill.
- Designed to work with weak models
- It uses Markdown that survives repeated edits instead of JSON, and annotations instead of page images.
- Errors return JSON with a hint, and help text includes examples.
- Change tracking and safety built in
- track-changes handles accept/reject and multiple reviewers.
- --dry-run and docx diff let you check changes, and document content stays local.
- Author-run benchmark has limits
- The author wrote the tool, the tasks and the rubrics, with three runs per tool on one model.
- The skill was cheaper on the one from-scratch document, per the README.
Community Reactions
- The project began as a TA agent for a professor, per the author
- Comment: the author said comments, track-changes-only editing and preserving structure were essential.
- It has since grown to tables, hyperlinks and footnotes, and the eval suite includes an MNDA, contract markup and an invoice.
- Experience that CLIs are more efficient in practice
- Comment: one user ran it in Claude Code and Hermes and said it worked well on first tries.
- Another said they have built many low-token-output CLIs and expect to see more.
- Call for comparison with similar tools
- Comment: others listed recent similar projects such as OfficeCLI, python-office-mcp-server and smalldocs.
- The commenter wanted benchmarks for token use, correctness and features.
- Pushback on whether an LLM is needed
- Comment: one asked whether plain text substitution needs an LLM at all versus a human-driven batch tool.
- Others asked how embedded images are handled and about the MCP versus CLI trend.
How to Apply
- Install docx-cli and run a replace on a sample docx
- Install with bun add -g bun-docx and check docx --version.
- On a copy, turn on track-changes, run docx replace and check the tracked change in Word.
- Install the skill and make agents write to a copy
- In Claude Code, run plugin marketplace add kklimuk/docx-cli and then install.
- Tell the agent in the prompt to save with -o to a new file and keep tracking on.
- Swap your Word pipeline calls for subprocess calls
- Branch on exit codes (0 ok, 3 not found) and the JSON error on stdout.
- Group multiple edits with --batch FILE.jsonl to apply them in one go.
- Compare cost on the same tasks as your current approach
- Run 3 to 5 of your own document tasks with your current method and with docx-cli.
- Record tokens, time and tool calls for each.
Try It
# Paste into a shell (after installing docx-cli; test on a copy)
bun add -g bun-docx
cp contract.docx contract_test.docx
export DOCX_AUTHOR="Reviewer"
docx track-changes on contract_test.docx
docx replace contract_test.docx "Net 90" "Net 30" --all
docx track-changes list contract_test.docx --json
docx read contract_test.docxTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques