Oversized PDF kills the REPL
Resolved 💬 19 comments Opened Nov 13, 2025 by josmithiii Closed Apr 6, 2026
See CLI transcript below:
In Claude Code Version: 2.0.37
...
⏺ PDF too large. Please double press esc to edit your message and try again.
Do not read a PDF, just read my message
⏺ PDF too large. Please double press esc to edit your message and try again.
Please commit what we have so far
⏺ PDF too large. Please double press esc to edit your message and try again.
Do not read any PDFs right now
⎿ Interrupted · What should Claude do instead?
Do not read any PDFs right now
⏺ PDF too large. Please double press esc to edit your message and try again.
19 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This issue should be reopened as it is not a duplicate of the referenced issues.
Why This Is a Distinct Bug
This issue (#11527) and #9789 describe a specific bug where Claude Code enters an infinite error loop that makes the REPL completely unusable:
Why the Referenced "Duplicates" Are Different
The issues marked as duplicates describe different symptoms:
This bug is about the REPL entering a persistent error state where it stops processing any input at all and only echoes the PDF error message.
Evidence
Issue #9789 was incorrectly auto-closed as a duplicate of #6231, and users confirmed "Still happening" after closure. The infinite loop behavior is a specific manifestation that requires its own fix - likely in the TUI/REPL error handling rather than just PDF size validation or API error handling.
Please reopen this issue so the specific infinite loop bug can be tracked and fixed.
Workaround: Prevent PDF crashes with CLAUDE.md configuration
I've been experiencing the same crash issue when Claude Code tries to read
large PDFs. Found a reliable workaround by adding mandatory instructions to
.claude/CLAUDE.md:
## PDF Processing
# NEVER use the Read tool to open PDF files directly
# ALWAYS extract PDFs to text first using pdftotext via Bash before
processing
# Reading large PDFs can cause crashes and loss of work
The # prefix makes these instructions high-priority and enforceable.
Workflow that works:
This completely avoids the crash issue and is actually faster since text
files are easier to search/process. Would be great if this could be built
into Claude Code as a default behavior or at least a warning before
attempting to read large PDFs.
I have this exact same problem in:
Claude Code v2.0.42
Sonnet 4.5 · Claude Pro
Here is a transcript:
⏺ PDF too large. Please double press esc to edit your message and try again.
Impacts 2.0.55. A workaround is that you can use
/rewindto restore to the message before the read.It is a hang at the pure repl level, the json SDK seems to continue to function. I suspect a hung bit of state in the outer typescript.
Happening to me also in v2.0.59 :/
I have this exact same issue, but I can't rewind it because I referenced a PDF in a question Claude asked me. If I rewind, I'll need to redo the whole plan Claude created for me. This is very annoying and it would be nice if it could be fixed.
see the screenshots below
<img width="1568" height="102" alt="Image" src="https://github.com/user-attachments/assets/362b28cf-f94b-44a0-8c6d-ad21e70ad082" />
<img width="1109" height="562" alt="Image" src="https://github.com/user-attachments/assets/80f73755-7a8c-4b78-bf89-154ce53bb6b2" />
Happening to me as well in v 2.0.76 :( And I just learned there is no rewind command in CC via VS Code IDE, so no way to go back, I have to create a new conversation
When working with complex PDF tables—especially engineering specifications, multi-column data sheets, or documents with merged cells and nested headers—Claude Code struggles significantly with traditional text extraction methods.
Why text extraction fails on complex tables:
I was spending hours manually copying data or wrestling with Power Query's "Get Data from PDF" feature, which required:
The Solution: WebP Image Conversion
Instead of fighting with text extraction, convert PDF pages to WebP images and let Claude Code's vision capabilities read the table directly.
The Workflow
# Convert PDF page(s) to WebP images
pdftoppm -webp -r 150 "specs.pdf" "output"
# Results in: output-1.webp, output-2.webp, etc.
Then simply ask Claude Code to read the image:
Read output-1.webp and extract the table data to CSV format
Why This Works
Claude Code's multimodal capabilities can:
This works approximately 100x faster than Power Query for complex tables.
Best Practices
Image Quality Settings
# 150 DPI is usually sufficient for tables
pdftoppm -webp -r 150 input.pdf output
# For dense/small text, use 200-300 DPI
pdftoppm -webp -r 200 input.pdf output
Why WebP over PNG/JPEG?
For Multi-Page Tables
# Convert specific pages only
pdftoppm -webp -r 150 -f 3 -l 5 input.pdf output # Pages 3-5
# Then process sequentially
Prompting Tips
Good prompt:
Read this image and extract the table to CSV format.
The table has headers: Part Number, Size, Dimension A, Dimension B, and Weight.
Use commas as delimiters and preserve empty cells.
Better prompt (for complex tables):
Extract all table data from this engineering specification sheet.
Limitations
Tools Required
# Install poppler-utils for pdftoppm
sudo apt install poppler-utils
# Verify installation
pdftoppm -v
Conclusion
If you're spending significant time extracting table data from PDFs using Power Query, Python libraries like tabula-py, or manual copy-paste, try the WebP conversion method with Claude Code. For complex tables with irregular structures, it's not just faster—it's more accurate.
The key insight: treat table extraction as a vision problem, not a text parsing problem.
Tested with Claude Code on engineering specification sheets, mfg list price sheets, and it works every time where Claude struggled before.
Ultra plan user here. Happens to me almost everyday... it's a nightmare :(
I can confirm that I ran into this issue today (Jan 2, 2026) while using claude to read PDF files. Same infinite loop, even if restarting with claude --continue.
Cam back to check on this. This workaround still works:
https://github.com/anthropics/claude-code/issues/11527#issuecomment-3599387617
Can you explain what this means? How does that help in practice? Sorry, might be obvious ...
Happening to me right now on v2.1.42. How do I get out of this loop?
This is hardly stale just because Anthropic people haven't commented they are working on it.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.