[BUG] "PDF too large" error persists and blocks all PDF reading
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?
This is a continuation of issue #9789, which was closed as a duplicate but the bug is still occurring as of December 2025.
When Claude Code attempts to open a PDF file that exceeds size or page count thresholds, it displays the error message "⏺ PDF too large. Please double press esc to edit your message and try again."
The issue is that after this error occurs once, Claude Code continues to refuse to read ANY PDF file regardless of how small or large it actually is. Even when asking Claude to help find alternative solutions (e.g., searching for Python tools to parse the PDF), it returns the same "PDF too large" error.
Related closed issues: #9789, #6231, #6197, #8077
What Should Happen?
After displaying the "PDF too large" error for an oversized PDF:
- Claude Code should be able to read smaller PDFs that are within limits
- 2. Claude Code should be able to help find alternative solutions (e.g., suggesting Python libraries to parse PDFs) without returning the same error
- 3. The error state should not persist and affect unrelated requests
Error Messages/Logs
⏺ PDF too large. Please double press esc to edit your message and try again.
This error repeats for any subsequent attempts to read PDFs (regardless of actual file size) and also appears when asking Claude to help find workarounds (e.g., searching for Python tools to parse the PDF instead).
Steps to Reproduce
- Ask Claude Code to open/read a large PDF file (e.g., several MB in size or many pages)
- 2. Receive the "PDF too large" error message
- 3. Try to open a different, smaller PDF file
- 4. Observe that the same "PDF too large" error appears even for small files
- 5. Ask Claude to help find Python tools to parse the PDF instead
- 6. Observe that Claude still returns the "PDF too large" error
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.62 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Using Opus 4.5 with Claude Max subscription.
This bug was originally reported in #9789 and marked as a duplicate of #6231, but the issue persists. Multiple users have confirmed in the comments that the bug is still happening.
23 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Still happening with
v2.0.64and none of the duplicate issues have been resolved, just closed without a solution.Just experiemced this problem.
File Size: 1.7M
Number of pages: 312
When I encounter this issue, I usually use esc to return back to a point where the context has not blow up and ask Claude Code to read the pdf more efficiently. But it would definitely be better if there is an internal mechanism in Claude Code to handle large file input
The same thing happens to me. It's annoying because with a previous prompt it successfully split it in multiple chunks and it processed it successfully! It didn't had a problem with a 80 MB .pdf but now it has problems with 4 MB .pdf . It's ridiculous
Still happening with v2.1.9.
I'm having the same issue summarizing various dissertations in the 100-200 page range.
Now having issues with a just 3MB file (with 30 pages).
Having the same issue. Is this resolved at all? Sorry new to this.
Confirming the “PDF too large” loop in CLI (-p) mode on Linux. The error message tells you to double-press ESC, but the session keeps returning the same error no matter what you do.
Impact: after the error, every subsequent prompt returns the same message and the session is effectively dead.
The error in version v2.1.14 is "Request too large." when reading pdf files. Windows 11.
I have the same error. "PDF too large" loop in CLI mode.
Impact: after the error, every subsequent prompt returns the same message and the session is effectively dead. On top of that it drains your credits.
I tried renaming files directly with Claude code. These were PDFs, each containing a scanned image of a paper document. This worked successfully until Claude encountered a larger file of over 30 MB. It refused to rename the file, displaying the message "Request too long." After that, Claude refused to rename any files at all, not even smaller ones. The only thing that helped was to clear the Claude cache.
I was stuck unable to read any PDFs, even in a new session. Clearing
~/.claude/file-historyallowed me to get going again.Solution: I built a tool to fix this
This is the same root cause as the "image dimensions exceed max" bug (#2939). When you hit the "PDF too large" error, the oversized PDF data gets base64-encoded into your conversation history. That corrupted data then gets sent with every future request, which is why even small PDFs fail afterwards.
The "official" workaround is to clear your conversation and lose everything. I built a better solution:
Quick fix
Then close the Claude Code window/tab and reopen it (restart). Your session is recovered with all your conversation history intact.
What it does
~/.claude/projects/for conversation files[PDF removed - exceeded size limit]Install globally for easier access
Or let Claude maintain itself
Add as MCP server:
Then just ask Claude: "check your health" or "fix any issues"
Links
Open source, MIT license. Hope this helps until there's an official fix!
vote one, in version 2.1.22 on macOS still encountered this issue.
For me, there are two distinct issues:
(1) Claude Code cannot read a PDF with a decent file size
(2) Claude Code gets blocked after hitting "PDF too large" error.
Awaiting fixes for both.
As a workaround for these PDF limitations, I've created an MCP server specifically for PDF processing: pdf-mcp
It handles large PDFs by:
Install:
Add to Claude Code:
Or add to
~/.claude.json:Available tools:
pdf_info- Get document metadata and structurepdf_read_pages- Read specific pages (e.g., "1-10", "5,10,15")pdf_read_all- Read entire documentpdf_search- Search text within PDFpdf_get_toc- Extract table of contentspdf_extract_images- Extract images as base64This allows Claude Code to work with PDFs of any size without hitting the built-in limits.
Hope this helps! Feel free to open an issue or PR if you have any suggestions. 🙂
Community Workaround: pdf-guard plugin
I built a plugin that prevents this issue using PreToolUse hooks:
pdf-guard
What it does:
How it works:
PreToolUse hooks intercept
Readtool calls before execution. If the target is a PDF, it blocks and instructs Claude to use extraction scripts instead.Quick install (manual):
Copy the hooks from the plugin to
~/.claude/hooks/and add them to yoursettings.jsonunderhooks.PreToolUse.This doesn't fix the underlying 25K token limit, but it prevents hitting the persistent error state described in this issue.
Workaround (Claude Code for VS Code extension):
In the VS Code Claude Code extension, I was able to clear the persistent "PDF too large" error by running /compact.
This does not fix the underlying issue, but it resets the session context and allows Claude to function normally again within the same VS Code session, including reading extracted text files.
i still get
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.158.content.0.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels"},"request_id":"req_011CXtcWEvqpWVdSCCiR9oDH"}
i cannot continue the convo in the chat it's so frustrating that there's no easy way to manually remove the files creating the issue or restore to a previous point easily.
This was fixed in v2.1.31 — After a 'PDF too large' error, the oversized PDF is now dropped from subsequent requests instead of being re-sent on every turn. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.