Solutions

Can Codex CLI read a PDF?

Updated

Quick Answer

Not by itself, as far as OpenAI documents it: Codex CLI reads and edits the text files in your project, and a PDF needs something to turn it into text first, such as OpenAI's curated PDF skill or an MCP server. In Forkbench the document is converted for it: kept in Files and exposed to the thread, a PDF, Word, Excel or PowerPoint file comes back from read_file as Markdown that Codex can page through.

You point Codex at a spec in PDF form and it either reads binary noise, writes itself a Python script to extract the text, or asks you to paste the contents. The script works once and leaves a converter in your repository; the paste does not survive a forty-page document.

The skill route works, and it is worth knowing: it extracts text, tables and form fields on request. What it does not decide is where the document lives. A PDF dropped into the repository is visible to every agent that opens it and one careless `git add` away from a commit. Kept in Files, it stays outside the project, encrypted, and readable only by the agents in the thread you exposed it to. The conversion runs on your Mac, in a process with no network and no access to your files, and the text reaches Codex marked as file content, data rather than instructions.

How it works

  1. 1Run Codex CLI in a Forkbench terminal. It reads Files with read_file where Forkbench has set up its tools, and with `fb file read` from the shell everywhere else.
  2. 2Add the document to Files and expose it to the thread: hold Option and drop it on the terminal, which does both and pastes its name.
  3. 3Ask the agent to read it by name. read_file returns Markdown, one heading per page, sheet or slide, 256 KB at a time, so a long document is paged rather than refused.
  4. 4Keep the original. get_file still saves the real file to disk when the agent has to work on it with a library.

Straight about the guarantee: Which file types Codex reads natively is OpenAI's to change; this was checked on 25 November 2026 against OpenAI's documentation and its curated skills list. Scanned PDFs have no text layer and are not OCR'd.

Frequently asked

Related: Claude Code says "PDF too large", Giving an agent a document without putting it in the repo

Sources