docx

docx is a command for Claude Code from hamr0/agentic-toolkit. It costs 77 tokens per session (13,999 once invoked), scanned B, original, Apache-2.0.

A toolkit for creating, editing, and reading Microsoft Word documents in .docx format, while preserving formatting, comments, and tracked changes.

In plain words
What is it for?
Creating new Word documents, extracting and analyzing text, editing content, and reviewing or applying tracked changes in legal, academic, business, or government files.
Why use it?
It helps an agent work with professional documents without losing layout or review history. It also provides different methods for reading documents and changing them safely.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python ooxml/scripts/pack.py unpacked reviewed-document.docx.

Good fit Creating new Word documents, extracting and analyzing text, editing content, and reviewing or applying tracked changes in legal, academic, business, or government files.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/hamr0/agentic-toolkit
agentmods
npx agentmods add commands/hamr0/agentic-toolkit/docx

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 docx

README.md
[![agentmods](https://agentmods.dev/badge/commands/hamr0/agentic-toolkit/docx/github.svg)](https://agentmods.dev/commands/hamr0/agentic-toolkit/docx)
Your own site
<a href="https://agentmods.dev/commands/hamr0/agentic-toolkit/docx"><img src="https://agentmods.dev/badge/commands/hamr0/agentic-toolkit/docx/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docx

Your own site · 80×15
<a href="https://agentmods.dev/commands/hamr0/agentic-toolkit/docx"><img src="https://agentmods.dev/badge/commands/hamr0/agentic-toolkit/docx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 13,999 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00077 $0.13999
Opus 5.5 $0.00031 $0.05600
Sonnet 5.5 $0.00015 $0.02800
Haiku 4.5 $0.00008 $0.01400

Measured 3mo ago against content hash eb0dd3244e93, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

docx scanned grade B with 1 finding 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 3mo ago.

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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- **pandoc**: `sudo apt-get install pandoc` (for text extraction)
ai/customize/skill-to-command/commands/docx.md · 1,163 lines

How it starts

The opening of the file, as written. The whole thing — 1,163 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DOCX creation, editing, and analysis

Overview

A user may ask you to create, edit, or analyze the contents of a .docx file. A .docx file is essentially a ZIP archive containing XML files and other resources that you can read or edit. You have different tools and workflows available for different tasks.

Workflow Decision Tree

Reading/Analyzing Content

Use "Text extraction" or "Raw XML access" sections below

Creating New Document

Use "Creating a new Word document" workflow

Editing Existing Document

  • Your own document + simple changes Use "Basic OOXML editing" workflow

  • Someone else's document Use "Redlining workflow" (recommended default)

  • Legal, academic, business, or government docs Use "Redlining workflow" (required)

Reading and analyzing content

Text extraction

If you just need to read the text contents of a document, you should convert the document to markdown using pandoc. Pandoc provides excellent support for preserving document structure and can show tracked changes:

# Convert document to markdown with tracked changes
pandoc --track-changes=all path-to-file.docx -o output.md
# Options: --track-changes=accept/reject/all

Raw XML access

You need raw XML access for: comments, complex formatting, document structure, embedded media, and metadata. For any of these features, you'll need to unpack a document and read its raw XML contents.

Unpacking a file

python ooxml/scripts/unpack.py <office_file> <output_directory>

Key file structures
  • word/document.xml - Main document contents
  • word/comments.xml - Comments referenced in document.xml
  • word/media/ - Embedded images and media files
  • Tracked changes use <w:ins> (insertions) and <w:del> (deletions) tags

Creating a new Word document

When creating a new Word document from scratch, use docx-js, which allows you to create Word documents using JavaScript/TypeScript.

Workflow

  1. MANDATORY - READ ENTIRE FILE: Read docx-js.md (~500 lines) completely from start to finish. NEVER set any range limits when reading this file. Read the full file content for detailed syntax, critical formatting rules, and best practices before proceeding with document creation.
  2. Create a JavaScript/TypeScript file using Document, Paragraph, TextRun components (You can assume all dependencies are installed, but if not, refer to the dependencies section below)
  3. Export as .docx using Packer.toBuffer()

Read the full file on GitHub · 1,163 lines

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. 3mo ago First seen · 1,163 lines · 77 tokens per session scan B eb0dd3244e93

Subscribe to this mod's changes

docx is a command published in the GitHub repository hamr0/agentic-toolkit (23 stars, last pushed 3d ago), licensed Apache-2.0. It adds 77 tokens to every session and 13,999 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

docx compared with commands from other repositories

docx next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
docxhamr0/agentic-toolkitCommand233d agoApache-2.0B77Claude Code
cti-report7onez/cti-expertCommand6296d agononeA45Claude Code
brand-generateferdinandobons/brand-docsCommand3074mo agoMITA0Claude Code
cost-trackerrohitg00/pro-workflowCommand3.0k2mo agononeA12Claude Code
ppt-image2-editable-rebuildwwe-dog/ppt-image2-editable-rebuildCommand2076mo agoUnlicenseA15Claude Code
arckit.uk-food-record-sheetstractorjuice/arckit-codexCommand196d agononeA73Claude Code
publish-api-docsnavraj007in/architecture-cowork-pluginCommand34mo agoApache-2.0A17Claude Code