[BUG] "PDF too large" error persists and blocks all PDF reading

Resolved 💬 23 comments Opened Dec 10, 2025 by jfgordo Closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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:

  1. Claude Code should be able to read smaller PDFs that are within limits
  2. 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. 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

  1. Ask Claude Code to open/read a large PDF file (e.g., several MB in size or many pages)
  2. 2. Receive the "PDF too large" error message
  3. 3. Try to open a different, smaller PDF file
  4. 4. Observe that the same "PDF too large" error appears even for small files
  5. 5. Ask Claude to help find Python tools to parse the PDF instead
  6. 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.

View original on GitHub ↗

23 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/9789
  2. https://github.com/anthropics/claude-code/issues/11527
  3. https://github.com/anthropics/claude-code/issues/6231

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

emkman · 7 months ago

Still happening with v2.0.64 and none of the duplicate issues have been resolved, just closed without a solution.

paschaldev · 7 months ago

Just experiemced this problem.

File Size: 1.7M
Number of pages: 312

jiaxi98 · 6 months ago

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

hopingsteam · 6 months ago

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

syhya · 6 months ago

Still happening with v2.1.9.

markuskreitzer · 6 months ago

I'm having the same issue summarizing various dissertations in the 100-200 page range.

cobnett3 · 5 months ago

Now having issues with a just 3MB file (with 30 pages).

hiltronrex · 5 months ago

Having the same issue. Is this resolved at all? Sorry new to this.

vincentsch · 5 months ago

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.

  • OS: Linux (Xubuntu)
  • Claude Code: 2.0.53
  • Error: “PDF too large. Please double press esc to edit your message and try again.”
  • Timeframe: Jan 2026

Impact: after the error, every subsequent prompt returns the same message and the session is effectively dead.

atur · 5 months ago

The error in version v2.1.14 is "Request too large." when reading pdf files. Windows 11.

marcosncosta1 · 5 months ago

I have the same error. "PDF too large" loop in CLI mode.

  • OS: Mac OS Tahoe 26.2
  • Claude Code: 2.0.53
  • Error: “PDF too large. Please double press esc to edit your message and try again.”
  • Timeframe: Jan 2026

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.

atur · 5 months ago

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.

iamcal · 5 months ago

I was stuck unable to read any PDFs, even in a new session. Clearing ~/.claude/file-history allowed me to get going again.

AsifKibria · 5 months ago

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

npx @asifkibria/claude-code-toolkit scan
npx @asifkibria/claude-code-toolkit 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

  • Scans ~/.claude/projects/ for conversation files
  • Detects oversized content (images >100KB, PDFs >100KB, documents >100KB, large text >500KB)
  • Surgically removes only the problematic content, replacing it with [PDF removed - exceeded size limit]
  • Creates backups before any changes

Install globally for easier access

npm install -g @asifkibria/claude-code-toolkit
cct health   # Quick check
cct scan     # See what's wrong
cct fix      # Fix it

Or let Claude maintain itself

Add as MCP server:

claude mcp add --scope user toolkit -- npx -y @asifkibria/claude-code-toolkit claude-code-toolkit-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!

jztan · 5 months ago

vote one, in version 2.1.22 on macOS still encountered this issue.

cobnett3 · 5 months ago

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.

jztan · 5 months ago

As a workaround for these PDF limitations, I've created an MCP server specifically for PDF processing: pdf-mcp

It handles large PDFs by:

  • Processing PDFs page-by-page instead of loading the entire file
  • SQLite-based caching for faster subsequent access
  • Supporting both local files and URLs

Install:

pip install pdf-mcp

Add to Claude Code:

claude mcp add pdf-mcp -- pdf-mcp

Or add to ~/.claude.json:

{
  "mcpServers": {
    "pdf-mcp": {
      "command": "pdf-mcp"
    }
  }
}

Available tools:

  • pdf_info - Get document metadata and structure
  • pdf_read_pages - Read specific pages (e.g., "1-10", "5,10,15")
  • pdf_read_all - Read entire document
  • pdf_search - Search text within PDF
  • pdf_get_toc - Extract table of contents
  • pdf_extract_images - Extract images as base64

This 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. 🙂

belumume · 5 months ago

Community Workaround: pdf-guard plugin

I built a plugin that prevents this issue using PreToolUse hooks:

pdf-guard

What it does:

  • Blocks direct PDF reads - Forces extraction to text/images first
  • Warns on large files (100KB+) - Early warning before context issues
  • Blocks very large files (200KB+) - Prevents the crash entirely
  • Tracks cumulative reads - Warns at 100K tokens, blocks at 150K

How it works:

PreToolUse hooks intercept Read tool 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 your settings.json under hooks.PreToolUse.

This doesn't fix the underlying 25K token limit, but it prevents hitting the persistent error state described in this issue.

markoplankelj · 5 months ago

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.

mmaestrini · 5 months ago

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.

ashwin-ant collaborator · 2 months ago

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.

github-actions[bot] · 2 months ago

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.