[BUG] DOCX files created with Node.js docx library are corrupted/unreadable

Resolved 💬 6 comments Opened Oct 11, 2025 by PatrickRutledge Closed Jan 10, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Result: File is corrupted and cannot be opened

Describe the bug

When Claude creates .docx files using the Node.js docx library in the computer use environment, the files appear to be created successfully but become corrupted when users attempt to download and open them. Files can only be previewed in the Claude interface but cannot be opened in Microsoft Word, LibreOffice, or other document processors.

Actual behavior

  • Files appear created successfully (no errors, reasonable file size)
  • Files can be previewed in Claude interface
  • Files become corrupted when downloaded
  • Cannot be opened in any document processor
  • Error messages vary: "file is corrupted", "cannot open", "invalid format"

What Should Happen?

Expected behavior

  • .docx files should be valid Office Open XML documents
  • Files should be downloadable and openable in Microsoft Word, LibreOffice, and compatible applications
  • Formatting, structure, and content should be preserved

Error Messages/Logs

## Screenshots/Logs

# Typical successful execution log:
Document created successfully

# File appears in directory:
-rw-r--r-- 1 claude claude 15234 Oct 10 17:17 report.docx

# But file is corrupted when user downloads

Steps to Reproduce

To Reproduce

Steps to reproduce the behavior:

  1. Request Claude to create a Word document: "Create a comprehensive report as a docx file"
  2. Claude reads /mnt/skills/public/docx/SKILL.md and follows best practices
  3. Claude creates Node.js script using docx npm library
  4. Script executes successfully: console.log("Document created successfully")
  5. File appears in /mnt/user-data/outputs/ with reasonable size (e.g., 15KB)
  6. Claude provides download link: computer:///mnt/user-data/outputs/filename.docx
  7. User downloads file
  8. User attempts to open file in Word/LibreOffice

Result: File is corrupted and cannot be opened

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

claude-sonnet-4-5-20250929

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

GITHUB_ISSUE_TEMPLATE_DOCX_Bug.md

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗