Solutions

Can Claude Code read Word and Excel files?

Updated

Quick Answer

Not directly. A .docx, .xlsx or .pptx file is a zip archive of XML, and a coding agent's file reader expects text, so it either refuses the file or improvises a conversion every time. Converting the document to Markdown once gives the agent what it needs: headings, lists and tables from a Word document, one table per sheet from a workbook, one section per slide from a deck. Forkbench does this when an agent calls read_file on a document kept in Files.

The requirements are in a Word document, the test data is in a spreadsheet, the plan is in a slide deck. Point the agent at one and it either refuses a binary file or starts writing a script to unzip it, which works until the next document, and leaves a converter in your project that nobody asked for.

Markdown is the format agents already read best, and it keeps the structure that matters for the job: a heading is still a heading, a table still has rows and columns, a sheet still has its name. Text a reader of a Word document never sees, hidden runs, is not dropped silently: it is shown to the agent marked as hidden, because hidden text is exactly where an instruction aimed at an agent would be planted. The conversion runs on your Mac in a process with no network, no way to write files and no way to read yours, and the result is framed as file content the agent works with rather than instructions it follows.

How it works

  1. 1Keep the document in Files: drag it onto the Files page, or hold Option and drop it on a terminal.
  2. 2Expose it to the thread the agent works in. Dropping it on a terminal, a thread's Home or a thread in the panel does that in one step.
  3. 3Ask the agent to read it by name. read_file returns Markdown; a long workbook is read a slice at a time.
  4. 4Keep the original. get_file still saves the real .docx or .xlsx to disk when the agent has to edit it with a library.

Straight about the guarantee: Formulas come back as their last calculated values, not the formulas. Charts, images, comments and tracked changes are not converted. Older .doc and .xls files are not read yet; save them as .docx or .xlsx first.

Frequently asked

Related: Giving an agent a document without putting it in the repo