As of October 2026, Claude Code can read a PDF on its own, Cursor reads a PDF you attach to the chat, and the Codex CLI documents image input but not PDFs. None of the three lists Word (DOCX) files among the formats it reads directly. For specs, manuals, papers and contracts the agent will use more than once, convert them to Markdown, keep the copies in the project and tell the agent where they are.
This guide is for coding agents that work in a project folder. If you are building a separate folder of reference documents rather than a code project, start with our guide to preparing documents for AI agents.
What each agent reads directly
This is what each vendor's documentation says as of October 2026.
| Agent | Word (DOCX) | Images | |
|---|---|---|---|
| Claude Code | Reads PDF files with its file tool | Not in the list of supported file types | PNG, JPG and other formats |
| Cursor | Reads PDFs you attach to the chat | Not mentioned | PNG, JPG, GIF, WebP and SVG |
| Codex CLI | Not mentioned for the CLI | Not mentioned | Common formats, including PNG and JPEG |
Claude Code reads a short PDF whole. A PDF over 10 pages is read in ranges of up to 20 pages at a time, and those reads need the pdftoppm program from poppler. On Windows you install a poppler build yourself and add it to your PATH; without it, the read fails. The details are in the Claude Code tools reference.
Cursor added PDF reading in version 2.4, released in January 2026. Cursor's default ignore list still includes PDF files and several Office formats, and Cursor's help says that ignored files are blocked from the agent. Attach the PDF to the chat yourself rather than expecting the agent to find it in the project.
The Codex CLI accepts images passed on the command line or pasted into the prompt. Its documentation does not describe PDF or Word input for the CLI.
An agent can still try to pull text out of a document by running a program installed on your computer. Sometimes that works, but you don't see which text it got, and a misread table goes straight into its answer.
Why a Markdown copy works better
Markdown is plain text with headings, lists and tables. Inside a project, that gives you four things a PDF or a DOCX file does not.
- The agent can search it. A text search finds a phrase in a Markdown file. A DOCX file is a ZIP archive of XML parts, so a plain text search finds nothing inside it.
- The agent can quote exact lines, and you can find each quoted sentence in the file and read what surrounds it.
- The agent reads only what it needs: it searches a long manual, then opens the one section that matters instead of working through the pages.
- Git shows what changed. When a new edition of a spec arrives, the diff lists the changed lines.
You also see exactly what the agent reads. If a table came out wrong, you fix it once in the Markdown file, and every later session uses the corrected copy.
A scanned PDF without a text layer is only pictures of pages. It needs OCR (text recognition) before an agent can search it. MD Factory recognizes text in scanned PDFs on your PC. To check the result, see our guide to converting scanned PDFs.
Put the documents in a docs folder
Keep the originals and their Markdown copies inside the project, next to the code that depends on them:
payments-service/
AGENTS.md
docs/
partner-api-spec.pdf
partner-api-spec.md
partner-api-spec_images/
supplier-contract.docx
supplier-contract.md
src/
- Copy the PDF and Word files into the docs folder. MD Factory saves each Markdown file next to its original, so this is where the copies will appear.
- In MD Factory, click Add folder and choose the docs folder, or drop the folder on the window. Conversion starts at once.
- Wait until every file shows a status: Completed, Needs review or Failed.
- Click Needs review next to a file to see what to check, then compare that part with the original.
Images from a document go into a folder named after it, such as partner-api-spec_images. The PDF and Word files themselves are not changed.
Keep the originals in the project. Page numbers, figures and the exact signed wording live there, and you will need them whenever the copy and the agent's answer disagree.
Point the agent to the files
Give the agent a short list of documents in its instruction file. Claude Code reads CLAUDE.md, or AGENTS.md when the project has no CLAUDE.md. Codex and Cursor read AGENTS.md. For example:
## Reference documents
Markdown copies of PDF and Word files are in docs/.
The original of each copy is next to it.
- `docs/partner-api-spec.md`: partner API specification, version 3.2
- `docs/supplier-contract.md`: supplier contract, 2026 edition
Search docs/ before answering questions about the partner API or the contract.
Quote the section heading you relied on.
Do not edit files in docs/.
Write the paths in backticks, as above, not as @docs/partner-api-spec.md. In CLAUDE.md, an @ path is an import: Claude Code loads the whole file at the start of every session. A path in backticks stays a plain mention, and Claude opens the file when a task needs it.
Keep the list short. Codex stops reading instruction files once together they reach 32 KiB, its default limit.
For a single task, mention the file in your prompt:
- In Claude Code, type @ and pick the file. Claude Code adds its contents to the conversation if they fit the read limit, 25,000 tokens by default. For a longer file, ask Claude to search it first.
- In Cursor, type @ and choose the file or the whole docs folder, as described in Cursor's help.
- In the Codex CLI, type @ to insert a file path, or use the /mention command to attach a file, as described in the Codex prompting guide.
A prompt that names the document and asks for quotes might look like this:
Read the "Authentication" and "Rate limits" sections of
docs/partner-api-spec.md. Update the API client to follow them.
For each change, quote the line of the spec it relies on.
Check answers and update the copies
Before you rely on an answer, find the quoted passage yourself. Use the first command in PowerShell and the second in Git Bash:
Select-String -Path docs\*.md -Pattern "rate limit"
grep -n -i "rate limit" docs/*.md
If the quote is not in the Markdown file, look in the original. If it is not there either, the agent did not take it from the document. For page numbers and figures, always open the original.
Watch your .gitignore file. Claude Code's search skips gitignored files, though Claude can still search or read a file you name by its path. Cursor keeps gitignored files away from the agent unless a line starting with ! in .cursorignore lets them back in. If the documents must stay out of Git, list every file path in the instruction file for Claude Code, and add this line to .cursorignore for Cursor: !docs/
Reference files should change only when you decide. Look at the diff after each task. If you want Claude Code to leave the docs folder alone, add an Edit deny rule for it.
When a new edition arrives, replace the original in the docs folder, keeping the same file name, and add it to MD Factory again. If you have not edited the old Markdown copy, MD Factory replaces it. If you have, the new copy gets a numbered name, such as partner-api-spec (2).md, and your edits stay in the old file. A diff of the Markdown file then shows which sections changed and which code may need to follow.
Confidential documents: what the agent sends
MD Factory converts documents on your PC and does not upload them, but that covers only the conversion. When the agent reads the Markdown copy, the text goes to the model provider like the rest of your prompt.
- Claude Code runs on your computer but sends prompts and model output over the network. How long Anthropic keeps that data depends on your account type and privacy settings: see data retention in Claude Code.
- Cursor says that when the agent opens a file, its content can be included in the model request.
- Codex uses OpenAI as its default model provider.
Before an agent reads a confidential document:
- Convert and add only the documents the task needs.
- If a document is covered by a confidentiality agreement or a client contract, check whether it allows sending the text to an outside AI service.
- Keep documents the agent must not read outside the project folder. Claude Code's deny rules and Cursor's ignore files block the built-in file tools. Both vendors note that some terminal commands can still read such files: see Claude Code permissions and Cursor ignore files.
- Treat documents from other people as untrusted input: they can contain text written to steer an agent. Review the commands and edits the agent proposes.