Solutions

Claude Code says "PDF too large". How do I get it to read the PDF?

Updated

Quick Answer

Claude Code sends a PDF to the model as a document, whole, so a long or heavy one goes past the request limit and is refused, and the failed attempt can stay in the session's history. The reliable fix is to stop sending the PDF at all: turn it into text first and let the agent read the pages it needs. Forkbench does that for any PDF you keep in its Files: an agent's read_file returns the document as Markdown, one heading per page, in slices it can page through.

You hand the agent a spec, a contract or a datasheet as a PDF and it stops with "PDF too large". Sometimes it gets worse: the oversized document is already in the conversation, so every message after it fails too, even for small files. You wanted the agent to read twelve pages of requirements, and now you are clearing sessions.

Text is a fraction of the size of the PDF it came from, and it can be read a slice at a time, which is the part that matters for a long document. The agent reads page 1, finds the section it needs, and asks for the slice that holds it, instead of pushing the whole file through one request. The conversion happens on your Mac, in a separate process that has no network access and cannot read or write your files, because a PDF is a format with a long history of being used to attack the program that opens it. What comes back is marked as file content, data for the agent to work with, never instructions for it to follow.

How it works

  1. 1Add the PDF to Files in Forkbench: drag it onto the Files page, or hold Option and drop it on the terminal you are working in.
  2. 2Expose it to the thread, so the agents working there may read it. Dropping it on a terminal or a thread does this for you.
  3. 3Ask the agent to read it. It calls read_file and gets Markdown with a heading per page, 256 KB at a time.
  4. 4If the session already has the error stuck in it, clear or compact it first so the failed upload leaves the history.

Straight about the guarantee: A scanned PDF is a picture of text, so it has no text to extract: each page comes back marked as having none, and there is no OCR yet. Tables and multi-column layouts come out as the reading order of the text, not as a grid. Files is part of the Mac app; Windows and Linux are in development.

Frequently asked

Related: Giving an agent a document without putting it in the repo, Prompt injection and coding agents

Sources